spring - Sorting the datatable works only at first time. but then it doesnt work -


there page:

<p:datatable id="selectedlimitservicestbl"                 widgetvar="selectedlimitservicestblvar" var="service"                 value="#{massorderflowbean.limitservicesbean.limits}"                 scrollable="true" scrollheight="400"                 selection="#{massorderflowbean.limitservicesbean.selectedlimitservices}"                 emptymessage="#{msg['empty.result.message']}"                 rowkey="#{service.uniquekey}"                 filteredvalue="#{massorderflowbean.limitservicesbean.filtered}"                 sortby="#{service.name}" sortfunction="#{massorderflowbean.limitservicesbean.sortbyservicename}">                 <p:ajax event="rowselectcheckbox" process="selectedlimitservicestbl"                     update=":massorderform:toconfirmlimitservices" />                 <p:ajax event="rowunselectcheckbox"                     process="selectedlimitservicestbl"                     update=":massorderform:toconfirmlimitservices" />                 <p:ajax event="toggleselect" process="selectedlimitservicestbl"                     update=":massorderform:toconfirmlimitservices" />                  <p:column selectionmode="multiple"                     style="width:25px; text-align:center"/>                 <p:column headertext="#{msg['massactions.select.service']}"                     filterby="#{service.name}" filtermatchmode="contains">                     <h:outputtext style="white-space:normal;" value="#{service.name}" />                 </p:column>             </p:datatable> 

and bean:

private list<service> selectedlimitservices; public list<service> getselectedlimitservices() {     return selectedlimitservices;   }    public void setselectedlimitservices(list<service> selectedlimitservices) {     this.selectedlimitservices = selectedlimitservices;   } public int sortbyservicename(object obj1, object obj2) {     return getstringfromobject(obj1).compareto(getstringfromobject(obj2));   } 

first time enter page sorts fine, when go page , again go table not sort whats wrong?


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -