Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

p:ajax event for pagination of lazy p:dataTable

I'm having trouble finding an ajax event that will execute my javascript when my list is updated during lazy loading of my datatable. This javascript is responsible for updating an image coverflow based upon my list that gets repopulated during initial datatable loading, when doing pagination, and changing the number of records on a page. Any help with finding a way to make an event execute my javascript during these situations is greatly appreciated! Thanks in advance!

Primefaces 3.3.1 Mojarra 2.1.5 JBoss AS 7.1.0.Final

like image 516
user1530469 Avatar asked Dec 13 '12 19:12

user1530469


1 Answers

Its not specific for Lazy Loading :

In order to run a js function upon pagination complete use the p:ajax event="page" (It might also work for changing the number of records on a page)

Like this

<p:ajax event="page" oncomplete="myJsFunction();"></p:ajax>

Additional event types are

page - On pagination.

sort - When a column is sorted.

filter - On filtering.

rowSelect - When a row is being selected.

rowUnselect - When a row is being unselected.

rowEdit - When a row is edited.

rowEditCancel - When row edit is cancelled.

colResize - When a column is being selected.

toggleSelect - When header checkbox is toggled.

colReorder - When columns are reordered.

rowSelectRadio - Row selection with radio.

rowSelectCheckbox - Row selection with checkbox.

rowUnselectCheckbox - Row unselection with checkbox.

rowDblselect - Row selection with double click.

rowToggle - Row expand or collapse.

contextMenu - ContextMenu display.

(Taken from primefaces user guide)

like image 151
Daniel Avatar answered Nov 15 '22 07:11

Daniel