jsf - How to get the current page number of dataTable using Jquery -
i have tried solutions provided in rich:datatable paging - marking visited pages of rich:datascroller didn't work rich faces 4.3.4.
i have tried page attribute of data scroller. here's code implementing page attribute of datascroller.
<h:form id="mainform"> <rich:datascroller for="itemdatatable" maxpages="30" execute="itemdatatable" page="#{itemscontroller.pageindex}"/> <rich:datatable rowkeyvar="rkvar" rows="15" id="itemdatatable" value="#{itemscontroller.itemdm}" var="r"> <f:facet name="footer"> <h:outputtext id="pagenumberoutputtext" value="#{itemscontroller.pageindex}"/> </f:facet> <h:column id="setvalue"> <h:inputtext id="finalitem" valuechangelistener="#{itemscontroller.recalculate()}" value="#{r.items.prices}"/> </h:column> ... ... <!-- other columns --> </rich:datatable> <rich:datascroller for="itemdatatable" maxpages="30" execute="itemdatatable" page="#{itemscontroller.pageindex}"/> </h:form>
i have respective getters , setters in itemscontroller class , following scope:
@managedbean @viewscoped
with pageindex intially set 1.
private int pageindex = 1;
and tried alert current page number using:
alert('you in page : ' + $('#mainform\\:itemdatatable\\:pagenumberoutputtext').val());
but alerts 1. outputtext in datatable footer shows 1 if click next page or click other pages.
above all, wanted alert current page number using jquery. dont want use getters , setters this, if possible. wanted know how current page number using jquery.
specify region re-render ajax request update appropriate parts of view. e.g.:
<rich:datascroller render="pagenumberoutputtext"/>
Comments
Post a Comment