1 Reply Latest reply on Mar 25, 2011 7:32 AM by Ilya Shaikovsky

    Help on dataTable filtering

    raid3n Newbie

      Hello,

       

      I have my datatable like this:

      <h:form id="form">

                                    <rich:dataScroller for="table" maxPages="5" />

                                    <rich:dataTable value="#{listFormBean.listFormBean}" var="fb"

                                              id="table" rowClasses="odd-row, even-row" styleClass="stable"

                                              rows="25">

                                              <f:facet name="noData">

                      Nothing found

                               </f:facet>

                                              <f:facet name="header">

                                                        <rich:columnGroup>

                                                                  <rich:column colspan="3">

                                                                            <h:outputText value="Form List" />

                                                                  </rich:column>

                                                                  <rich:column breakRowBefore="true"

                                                                            filterValue="#{filterFormBean.nameFilter}"

                                                                            filterExpression="#{fn:containsIgnoreCase(fb1.name,filterFormBean.nameFilter)}">

                                                                            <h:panelGroup>

                                                                                      <h:outputText value="Name " />

                                                                                      <h:inputText value="#{filterFormBean.nameFilter}">

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

                                                                                      </h:inputText>

                                                                            </h:panelGroup>

                                                                  </rich:column>

       

       

                                                                  <rich:column sortBy="#{fb.description}">

                                                                            <h:outputText value="Description" />

                                                                  </rich:column>

                                                                  <rich:column>

                                                                            <h:outputText value="Version" />

                                                                  </rich:column>

                                                        </rich:columnGroup>

                                              </f:facet>

                                              <rich:column>

                                                        <h:outputText value="#{fb.name}" />

                                              </rich:column>

                                              <rich:column>

                                                        <h:outputText value="#{fb.description}" />

                                              </rich:column>

                                              <rich:column>

                                                        <h:outputText value="#{fb.version}" />

                                              </rich:column>

                                              <f:facet name="footer">

                                                        <h:outputText

                                                                  value="Total of Forms: #{fn:length(listFormBean.listFormBean)}" />

                                              </f:facet>

                                    </rich:dataTable>

                                    <rich:dataScroller for="table" maxPages="5" />

                          </h:form>

       

      I would to filter the rich:column with #{fb.name} but its facet is into a rich:columngroup.

       

      So I tryed this:

       

      <rich:column breakRowBefore="true">

                                                                            <h:panelGroup>

                                                                                      <h:outputText value="Name " />

                                                                                      <h:inputText value="#{filterFormBean.nameFilter}">

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

                                                                                      </h:inputText>

                                                                            </h:panelGroup>

                                                                  </rich:column>

       

      ....

      <rich:column  id="something" filterValue="#{filterFormBean.nameFilter}"

                                                        filterExpression="#{fn:containsIgnoreCase(fb1.name,filterFormBean.nameFilter)}">

                                                        <h:outputText value="#{fb.name}" /></rich:column>

       

      But It doesn't work, any suggestions?