JSF Datatable datascroller Search result navigation to first page

­the problem in brief is that if you navigate using the datascroller to any page for example page number 5

and you enter a search  criteria and pressed on the search button the result is returned and the datatable is updated but the datascroller keeeps standing at page 5 which may not contain any data because­ your search result may not have enough data to be splitted on 5 pages so you want behaviour like after pressing search your datascroller will be set to page number 1 and this can be done as follows:

 

 

­   <t:commandButton value="Search" action="#{searchPageBean.search}"­
                    actionListener="#{searchPageBean.resetDataScroller}">    
  </t:commandButton>
        
  <t:dataTable id="searchResultsDataTable"    
               binding="#{searchPageBean.searchUIData}" 
  >
  
  public void resetDataScroller(ActionEvent e) {
       if(searchUIData != null) {
           searchUIData.setFirst(0);
       }
  }

thanks to https://issues.apache.org/jira/browse/TOMAHAWK-548

Powered by Drupal - Design by artinet