2 Replies Latest reply on Sep 26, 2007 7:14 PM by Jason Long

    Problem with filter in dataTable header

    Jason Long Master

      On some of my tablesI have drop down filters in the headers. They are activated by a valueChangeListener as follows

      <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns="http://www.w3.org/1999/xhtml"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:s="http://jboss.com/products/seam/taglib">
       <h:panelGrid columns="1">
       <h:selectOneMenu id="#{id}"
       class="#{styleClass}"
       valueChangeListener="#{backingBeanName[actionName]}"
       value="#{value}">
       <s:selectItems value="#{selectItems}"
       var="si"
       label="#{si[labelMethod]}"
       noSelectionLabel="Select"/>
       <s:convertEntity />
       <a4j:support event="onchange" reRender="offerPrice_dataTable"/>
       </h:selectOneMenu>
       <h:outputText value="#{label}" />
       </h:panelGrid>
      </ui:composition>
      


      The problem is that if I include this in the header of a column. The filter does not work. I am reRendering the dataTable when the value changes as well.

      This works as expected when I move the filter outside the table to a place that is not reRendered by the onchange event.

      If I try to place this inside the table the valueChangeListener is called, but when the table is reRendered the selection is not set and the filter is not applied.

      Any advice would be greatly appreciated.

      I am using 3.1.1.SNAPSHOT from today and Seam 2.0.0.CR1