3 Replies Latest reply on Oct 28, 2008 5:45 AM by horako

    a4j:include and a4j:poll interaction error - wrong navigatio

    horako

      Hi,

      I have problem with navigation rules for <a4j:include> tag when it is on the same page as the <a4j:poll> tag. Sometimes it shows wrong content inside of the <a4j:include>. It only happens when I use <a4j:poll> for rerendering a different part of the page.

      More details:
      I have a page which contains:
      1) order ticket (a small wizard - 3 steps - form -> confirmation -> result page). When an user confirms his order, it is entered into the order book (list of orders)
      2) order book - contains all orders entered by the order ticket

      How it is done
      1) the order ticket is <aj4:include>
      2) the order book is a simple table which is rerendered by <a4j:poll> tag every 1 sec.

      What is wrong:
      Sometimes (more often when the interval is shorter) the order ticket steps are in wrong order. e.g.: it goes from the result to the confirmation step. But my result action returns "form" which is mapped to the form.xhtml page.
      When I use the ordet ticket wizard without the order book it works all fine.

      I do not use any special thing like conversation scope or keepalive bean. I send all values all the time to the EVENT scope bean.

      Has anybody had similar problems?

      Thanks for help,
      Ondrej

      <ui:define name="main">
      
       <!-- Order Ticket -->
       <rich:panel id="orderTicket" renderRegionOnly="true"
       styleClass="panelBottomMargin componentContainer" headerClass="panelHeaderThick"
       bodyClass="componentContainerBody"
       header="Order Ticket"
       rendered="#{!marketDetail.tradingContract.completed}">
       <a4j:region id="wizard" renderRegionOnly="true" immediate="true">
       <a4j:form eventsQueue="pollQueue">
       <a4j:include viewId="/market/trading/interfaces/orderticket/form.xhtml"/>
       </a4j:form>
       </a4j:region>
       </rich:panel>
      
      
      
       <!-- POLL -->
       <a4j:region>
       <a4j:form>
       <a4j:poll interval="500" id="poll" name="poll"
       ajaxSingle="true"
       eventsQueue="pollQueue"
       reRender="orderBook, poll"
       limitToList="true">
       <f:param name="contractId" value="#{orderticket.contractId}"/>
       </a4j:poll>
       </a4j:form>
       </a4j:region>
       <!-- Order Book -->
       <rich:panel id="orderBook" name="orderBook"
       styleClass="panelBottomMargin componentContainer" headerClass="panelHeaderThick"
       header="Order Book"
       bodyClass="componentContainerBody"
       rendered="#{!marketDetail.tradingContract.completed}">
       <ui:include src="inc/orderbook.xhtml"/>
       </rich:panel>
       </ui:define>
      


        • 1. Re: a4j:include and a4j:poll interaction error - wrong navig
          ilya_shaikovsky

          add ajaxRendered="false" to include. And reRender its parent only with components which fires navigation only.

          • 2. Re: a4j:include and a4j:poll interaction error - wrong navig
            horako

            Thanks it helped. The order of the steps of the order ticket wizard is correct.

            Unfortunately there is now another problem: sometimes when you click on wizzard button it sends ajax request but never rerender wizard to the next step. It happens only sometimes and goes away only when you refresh the whole page.

            • 3. Re: a4j:include and a4j:poll interaction error - wrong navig
              horako

              I used the <a4j:log> and I found that when it stops working it sends and empty list of ids to rerender:

              debug[9:14:34,714]: Find <meta name='Ajax-Update-Ids' content=''>
              warn[9:14:34,714]: No information in response about elements to replace
              


              When it works it sends the following:
              debug[8:42:17,950]: Update page part from call parameter for ID wizard
              debug[8:42:17,981]: call selectSingleNode for id= wizard
              debug[8:42:18,012]: Replace content of node by outerHTML()
              debug[8:42:18,028]: search for elements by name 'script' in element form
              debug[8:42:18,028]: Scripts in updated part count : 1
              debug[8:42:18,044]: Update part of page for Id: wizard successful
              


              Any ideas? It seems to me there is some bug in <a4j:include> component.