0 Replies Latest reply on Sep 27, 2011 4:28 PM by jac ba

    sorting rich:column

    jac ba Newbie

      hello there !

      I try to sort on rich:column inside the rich:dataTable. Here's an sample extract from the code

       

      <rich:column sortBy="#{order.customerNetwork.region.name}" SortOrder="#{orderSortingBean.netwOrder}"

                  filterValue="#{orderFilteringBean.netConnFilter}" style="width:200px;"

                  filterExpression="#{fn:containsIgnoreCase(order.customerNetwork.region.name,orderFilteringBean.netConnFilter)}"

                  sortOrder="#{dataTableStateHolder.sortOrders[order.customerNetwork.region.name]}">

                      <f:facet name="header">

                      <h:panelGroup>

                          <!--<h:outputText value="Network connection" /><br />-->

                          <a4j:commandLink value="Network connection" action="#{orderSortingBean.sortByNetw}"

                              render="orderSearchResultTable" />

                          <h:inputText value="#{orderFilteringBean.netConnFilter}">

                                  <a4j:ajax event="blur" render="orderSearchResultTable" execute="@this" />

                              </h:inputText>

                          </h:panelGroup>                   

                      </f:facet>

                      <h:outputText

                          value="#{order.customerNetwork.region.name}_#{order.customerNetwork.countryWorkgroup.name}" />

                  </rich:column>


      The orderSortingBean coming from a method which sort colum and render the table. here the sample code:

       

      public class orderSortingBean {

      ...

      private SortOrder netwOrder = SortOrder.unsorted;

      ...

      public void sortByNetw() {

       

          orderidOrder = SortOrder.unsorted;

          adcOrder = SortOrder.unsorted;

       

           if (netwOrder.equals(SortOrder.ascending)) {

            setNetwOrder(SortOrder.descending);

          } else {

            setNetwOrder(SortOrder.ascending);

          }

        }

       

      Could someone helps ?

       

      best regards