2 Replies Latest reply on Nov 29, 2010 7:41 AM by sunay

    dyamic columns , filtering not working

    sunay

      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

          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

            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