4 Replies Latest reply on Feb 9, 2011 5:09 AM by Joao Cunha

    Reset sort order

    Joao Cunha Newbie



      I'm developing a WebApplication using Richfaces 3.3 final and JBoss Seam 2.x.

      Currently I'm facing 2 problems that I can't resolve.

      We are using modalPanels with extendedDataTable to provide lov concept, but everytime we click on the lov again the sort order has not been reset.


      > Is it possible to reset it?

      > After sorting can we force the datatable to go to first page?


      As a side note we are trying to avoid going to server side sorting/pagination in these lov. We are already doing it in other cases.

      Thanks in advance.

        • 1. Reset sort order
          Rocky S Master

          Hi Joao,


          >Yes, it is possible to reset it.

          >After sorting the datatable can go to the first page.

          • 2. Reset sort order
            Joao Cunha Newbie



            thank for you reply.

            Could you please point me in the right direction?


            • 3. Re: Reset sort order
              Rocky S Master

              In order to reset sort order, You need to blank out the page parameters.



              <s:button id="reset" value="Reset" styleClass="tbtn">

                                          <f:param name="catgryDesc" />




              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
                Joao Cunha Newbie



                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 ..





                    private List<MdLocation> mdLocationList;


                xhtml file:


                <a:commandLink id="clDestinationLov" 

                                          tabindex="-1" eventsQueue="tsfQueue"




                                          reRender="opDestination, opDest" limitToList="true" >


                           <h:graphicImage value="#{app.lovIcon}"/>




                <rich:modalPanel id="mpDestinat" width="530" height="550" rendered="#{!tsfDetailBean.onLoad}">


                                <f:facet name="header">


                                        <h:outputText value="#{lang['tsfDetails.destinationLov.title']}"/>



                                <f:facet name="controls">


                                        <h:graphicImage value="#{app.closeIcon}" styleClass="hidelink" id="giHideSupplierLov"/>

                                        <rich:componentControl for="mpDestinat" attachTo="giHideSupplierLov" operation="hide"





                                <a:form id="fSupplier" styleClass="center-align">

                                    <a:outputPanel id="opDestination">

                                    <h:panelGrid columns="1">


                                            <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" 


                                                             reRender="tbLocation, dsLocation" limitToList="true"









                                         <rich:extendedDataTable id="tbLocation"



                                                width="500px" height="400px"

                                                rows="16" noDataLabel="#{lang['global.table.noRows']}"







                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