0 Replies Latest reply on Dec 8, 2008 4:43 PM by Franco Fernandes

    Ajax filter on EntityQuery

    Franco Fernandes Novice

      My entityquery object is a seam-gen default, so it is in Event scope.


      I am trying to filter the list with an onkeyup event using 1 field set in the restriction parameters, the event works fine. However, the EntityQuery is fired twice.


      When the Ajax event executes, it execute the Query twice - the first time it fires the default EJBQL and then the second time with the parameter value from the Ajax event.


      I guess this is expected since the EntityQuery is in event scope.


      I have seen some examples on this forum where the EntityQuery is in conversation scope, not sure why I would need that here. I tried putting my query in conversation scope but it did not change anything. Can someone give me a use case for EntityQuery in conversation scope?


      my code


      <h:outputText value="Filter by tax description " />&#160;&#160;
      <h:inputText id="taxDescription" value="#{taxList.tax.taxDescription}"  
      size="20" required="false" 
      autocomplete="off" >
      <a4j:support event="onkeyup" reRender="filterList" ajaxSingle="true" 
      eventsQueue="taxListEvents"     ignoreDupResponses="true" 
      requestDelay="1000" /> 
      </h:inputText>
      




      Thanks in advance


      Franco