2 Replies Latest reply on Nov 12, 2009 4:34 AM by M P

    a4j:poll interfering with navigation

    M P Newbie

      Hello there

      In our application we use Spring Web Flow as a navigation framework (thus the problem could be caused by SWF - frankly, I don't know for sure) and RichFaces 3.3.1
      There's one area where the user is informed about the state of lengthy background processes. The updates of that area are performed by ajax requests through an a4j:poll. The menu used for navigation consists of rich:dropDownMenus and rich:menuItems (usually using submitMode="server").

      The problem is that when the user selects a menu item and the navigation starts and it takes a longer-than-usual-time to fulfill that request (lengthy DB-operation, high server load, ...) and during that time the ajax-poll occours, then navigation simply is cancelled and the user stays on the page he was before.

      As I said I am not sure if this is more on RichFaces's side or SWF's side. SWF uses a post-redirect-render phase model, so the problem (don't know if it qualifies as a bug or if it's "by design") might acually be there.
      But perhaps anyone had such a problem already and found a workaround?

      The only solution would be to greatly increase the poll-time so that fewer ajax events occur.

      By the way, the code somehow looks like this:

      <a4j:region>
       <h:form>
       <a4j:poll id="poll_id"
       interval="#{someBean.pollInterval}"
       reRender="poll_panel,poll_id"
       ajaxSingle="true" limitToList="true"
       eventsQueue="poll_event_queue" />
       </h:form>
      </a4j:region>
      
      <h:form id="some_form">
       <h:panelGroup id="poll_panel">
       ... stuff that displays the internal state
       </h:panelGroup>
      </h:form>
      
      ... more forms, the menu and stuff goes here ...
      


      Any help is appreciated. Thanks!