5 Replies Latest reply on Jun 10, 2009 9:46 AM by Ilya Shaikovsky

    Concurrent a4j requests?

    jegan Newbie

      Hello,
      I am using functionality like search, sort and pagination in a single page.

      Here
      search is a4j:commandButton calls an action method.
      pagination is h:selectOneMenu using valuechangelistener on change of selection box. and
      sort is also a4j:commandButton calls an action method.

      The problem what i am facing is whenever I switch actions between the search and then select the value from selectionbox and then do sorting.

      At some point after completing the value change Listener call when i do sort then It calls the sort function and IMMEDIATELY without completing the response of sort it calls the value change listener(pagination) also - which is my previous action.

      (Some times when i see the logger the output looks like they are doing parallel requests)

      But this is not happening all the times. It is happening sometimes.
      Please let me know what might be the problem?

      My Search Button Code is below...

      
      <a4j:commandButton value="Search" styleClass="bouton" id="btnSearch" action="#{controller.retrieve}" reRender="dataTable,pageList" oncomplete="showHideTable() />
      
      .....
      .....
      .....
      <h:selectOneMenu value="#{controller.page}" id="pageList" valueChangeListener="#controller.pageNumberListener}">
       <f:selectItems value="#{controller.pages}" />
       <a4j:support event="onchange" ajaxSingle="true"
       reRender="dataTable" />
      </h:selectOneMenu>
      ......
      ......
      ......
      
      <a4j:commandButton value="Sort" styleClass="bouton" id="btnSort" action="#{controller.sort}" reRender="dataTable,pageList" oncomplete="showHideTable() />
      


      Thanks
      jegan