Reputation: 1
I need to implement conditional navigation logic using rich:dataScroller. Basically based on certain rule, the page navigation for the dataTable associated with the dataScroller should not take place. As per my preliminary analysis dataScroller provides two events which can used for this purpose. One is the onbegin event and the second is scrollListener.
First I tried by using onbegin. In my first attempt I tried the following:
onbegin="return confirm('Whats up?');"
This makes no difference to the page navigation. Second option I tried was as follows:
onbegin="var v = confirm('Whats up?'); if (!v) {var curPage = Richfaces.$(this).currentPage; Richfaces.$(this).switchToPage(curPage);}"
This prevents page navigation, but leaves the scroller in an inconsistent state, no further operations can be done on the scroller.
I checked the following link, but am not sure how scrollListener can be used to prevent page navigation.
Any pointer will be appreciated.
Upvotes: 0
Views: 216