2 Replies Latest reply: Nov 29, 2010 7:41 AM by Sunay Shah RSS

    dyamic columns , filtering not working

    Sunay Shah Apprentice

      Hello All,

       


      I need some help/suggestion for implementing a rich:columns ,

       


      <rich:dataTable value="#{bean.childBean.oneList}" var="bean" id="instanceList"  rows="5"  >       


      <rich:columns value="#{bean.childBean.anotherList}" var="columns" index="ind" id="column#{ind}" sortBy="#{bean.map[columns.id]}"

       

                           sortOrder="#{columns.sortOrder}" filterBy="#{bean.myMap[columns.id]}"  filterEvent="onkeyup"                     headerClass="statuscolumn">                            
                      <f:facet name="header">
                          <h:outputText value="#{columns.header}" />
                      </f:facet>                           
                      <h:outputText value="#{bean.myMap[columns.id]}" />                                                    
                  </rich:columns>         

      </rich:dataTable>

       

      i want to dynamically load the columns, and its contents, my problem is , i can able to set sort order for columns, but not able apply filtering over the the columnsmm please can you suggest me the why filteringing is not able to apply on dynamic columns

       

       

      Thanks

      Sunay

        • 1. Re: dyamic columns , filtering not working
          Ilya Shaikovsky Master

          you stored sortOrder and should store filterValue in the same way. columns - reconstructed every request so that binding is nesessary to restore filtering visual state. check http://livedemo.exadel.com/richfaces-demo/richfaces/dataTable.jsf?tab=modifiableDataModel&cid=706422 sample. There is next binding:

          filterValue="#{dataTableStateHolder.columnFilterValues[field]}"

          • 2. Re: dyamic columns , filtering not working
            Sunay Shah Apprentice

            Thanks Ilya , it partially worked , i changed my code as follow

             

            filtering is only worked for the last column, for remaining, it is not working ? any idea or suggestion would be appriciable.

             

             

             

            <rich:dataTable value="#{bean.childBean.oneList}" var="bean" id="instanceList"  rows="5"   >    


            <rich:columns  value="#{bean.childBean.anotherList}" var="columns" index="ind"  id="column#{ind}" sortBy="#{bean.map[columns.id]}"

             

                                  sortOrder="#{columns.sortOrder}" filterBy="#{bean.myMap[columns.id]}" filterValue="#{columns.filterValue}" filterEvent="onkeyup"                      headerClass="statuscolumn">                            
                            <f:facet name="header">
                                <h:outputText value="#{columns.header}" />
                            </f:facet>                           
                            <h:outputText value="#{bean.myMap[columns.id]}" />                                                    
                        </rich:columns>      

            </rich:dataTable>

             

            I am using richfaces 3.3.1

             

            Thanks

            Sunay