3 Replies Latest reply on Nov 18, 2009 2:11 PM by cerdiogenes

    filtering data in rich:dataTable passes wrong parameter to b

    cerdiogenes

      Hi,

      I'm using JBoss Seam 2.2.0.GA and Jboss-AS-4.2.3.GA.

      I have the following modalPanel in my application:

      <f:subview xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:s="http://jboss.com/products/seam/taglib">
       <rich:modalPanel id="ChefiaList" width="500" height="310" resizeable="false">
       <f:facet name="header">
       <h:panelGroup>
       <h:outputText value="Localizar Chefia"></h:outputText>
       </h:panelGroup>
       </f:facet>
      
       <rich:dataTable value="#{chefiaList.resultList}"
       var="_chefia"
       rendered="#{not empty chefiaList.resultList}"
       id="chefiaTable">
       <rich:column filterBy="#{_chefia.pssFscNome}" filterEvent="onkeyup" filterValue="#{chefiaList.pssFisica.pssFscNome}" reRender="chefiaTable">
       <f:facet name="header">
       Nome #{chefiaList.order=='pssFisica.pssFscNome asc' ? messages.down : ( avlPssFscEtapaList.order=='pssFisica.pssFscNome desc' ? messages.up : '' )}
       </f:facet>
       #{_chefia.pssFscNome}
       </rich:column>
       <rich:column>
       <f:facet name="header">Avaliacao</f:facet>
       <a4j:form>
       <a4j:commandLink id="selectChefia"
       value="Selecionar"
       action="#{chefiaAction.setChefia(_chefia)}"
       onclick="#{rich:component('ChefiaList')}.hide()"
       reRender="avlPssFscEtapaList">
       </a4j:commandLink>
       </a4j:form>
       </rich:column>
       </rich:dataTable>
      
       </rich:modalPanel>
      
      </f:subview>


      It's a simple list returned by a class that extends EntityQuery (ChefiaList) that have in one column person names and in the other a link to select this person. This link call a method in a backing bean and pass this person as a parameter.

      It's work okay when no filter is applied, but when I apply the filter and click in the link to select the person it's like I'm clicking in the link before the filter was applied, althought the columns with names are altered. For some reason the paramater passed to the method isn't updated.

      The filter only works if I have the class ChefiaList in the Conversation scope, otherwise I get that the entityManager is closed.

      Moreover if I make ChefiaList as a long-running conversation, the parameter to my backing bean is passed correctly, but this have the incovenient of the concurrent call to a conversation error, so I have to adjust the concurrent-request-timeout, what is not ideal in my opinion.

      So, my questions are: Is this a bug? Am I doing something wrong that is leading to the error (wrong parameter in the backing bean)? Is this the expected behavior and I have to accept the long-running conversation to accomplish this task?