-
1. Reset sort order
boy18nj Feb 8, 2011 1:05 PM (in response to luomo)Hi Joao,
>Yes, it is possible to reset it.
>After sorting the datatable can go to the first page.
-
2. Reset sort order
luomo Feb 8, 2011 1:14 PM (in response to boy18nj)Hello,
thank for you reply.
Could you please point me in the right direction?
Thanks
-
3. Re: Reset sort order
boy18nj Feb 8, 2011 2:26 PM (in response to luomo)In order to reset sort order, You need to blank out the page parameters.
Example-
<s:button id="reset" value="Reset" styleClass="tbtn">
<f:param name="catgryDesc" />
</s:button>
After sorting to go first page,
You need to set the firstResult value to blank or null or 0, this will cause the result set to move to first page. firstResult is property of Query Interface.
-
4. Re: Reset sort order
luomo Feb 9, 2011 5:09 AM (in response to boy18nj)Hi,
I don't think that solution can help me because in this case we are using in memory sorting sorting/pagination, RichFaces default. So as I see it we can't intercept sorting events ..
Maybe I'm wrong ..
ManagedBean:
@DataModel
private List<MdLocation> mdLocationList;
xhtml file:
<a:commandLink id="clDestinationLov"
tabindex="-1" eventsQueue="tsfQueue"
actionListener="#{tsfDetailBean.locationActionListener}"
oncomplete="Richfaces.showModalPanel('mpDestinat');"
reRender="opDestination, opDest" limitToList="true" >
<h:graphicImage value="#{app.lovIcon}"/>
</a:commandLink>
<rich:modalPanel id="mpDestinat" width="530" height="550" rendered="#{!tsfDetailBean.onLoad}">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="#{lang['tsfDetails.destinationLov.title']}"/>
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:panelGroup>
<h:graphicImage value="#{app.closeIcon}" styleClass="hidelink" id="giHideSupplierLov"/>
<rich:componentControl for="mpDestinat" attachTo="giHideSupplierLov" operation="hide"
event="onclick"/>
</h:panelGroup>
</f:facet>
<a:form id="fSupplier" styleClass="center-align">
<a:outputPanel id="opDestination">
<h:panelGrid columns="1">
<h:panelGroup>
<h:outputText value="#{lang['global.description']}"/>
<rich:spacer width="10"/>
<h:inputText id="itDesc" value="#{mdLocationAction.searchParam}" onkeypress="return event.keyCode!=13"/>
<rich:spacer width="10"/>
<a:commandButton id="cbLocationSearch"
value="#{lang['global.search']}"
reRender="tbLocation, dsLocation" limitToList="true"
eventsQueue="tsfQueue"
action="#{mdLocationAction.findMdLocationBySearchParam}">
</a:commandButton>
</h:panelGroup>
<rich:separator/>
<rich:extendedDataTable id="tbLocation"
value="#{mdLocationList}"
var="_locationVar"
width="500px" height="400px"
rows="16" noDataLabel="#{lang['global.table.noRows']}"
sortMode="single"
selectionMode="single">
........
findMdLocationBySearchParam is a method that delegate search to a Manager/service object implemented with spring/hibernate to fetch. But like I said before it only querys data the fist time. After that all sorting occurs in memory ..
Hope someone can help ..
Thanks in advance