1 Reply Latest reply on Aug 28, 2007 2:03 PM by Florian Marwede

    Problem with poll and limitToList

    Florian Marwede Expert

      I know there are some topics about the limitToList attribute, but no answer helps me concerning the following problem so far:

      I have a tree and I want to update some text in it with a poll tag every 5 seconds. Because of other stuff on the same page i want to use the limitToList attribute, so only the content of the tree is updated by the poll and nothing more.

      My Problem: The use of the limitToList attribute causes that nothing is updated on the page, whatever I enter for the rerendered attribute.

      Here is the relevant part of my page. What id's I have to take for the rerendered attribute?

      <a4j:poll interval="5000" reRender="panel0, panel1, panel2, encoderTree, encoderTreeText"
       action="#{controller.refreshAlarm}" ajaxSingle="true" limitToList="true"/>
      <t:htmlTag value="div" styleClass="DivTopology">
       <f:facet name="header">
       <h:outputText value="Encoder Topology" />
       <a4j:outputPanel id="panel0" layout="block" styleClass="DivTopologyInner">
       <a4j:outputPanel id="panel1" layout="block">
       <a4j:outputPanel id="panel2" layout="block" ajaxRendered="true">
       <rich:tree value="#{controller.treeData}" var="item"
       nodeFace="#{item.type}" showConnectingLines="true"
       switchType="ajax" id="encoderTree" componentState="#{controller.treeState}">
       <rich:treeNode type="NetworkNode">
       <h:outputText value="#{item.name}" />
       <rich:treeNode type="EncoderNode">
       <a4j:outputPanel id="encoderTreeText" ajaxRendered="true" layout="block">
       <t:outputText rendered="#{item.alarmStatus != 'S'}" value="#{item.name}" />
       <t:outputText styleClass="DecoderWarning" rendered="#{item.alarmStatus == 'S'}" value="#{item.name}" title="#{item.alarmText}"/>

      Please notice: I need several output:panels to remember the scroll position when the tree is updated (a solution of this forum).

      Thank you!

        • 1. Re: Problem with poll and limitToList
          Florian Marwede Expert

          Hello again,

          I think my problem is solved - also I don't really understand the solution.

          Here my situation again in short:

          I have two areas (A and B) on my page and both I wanna update with AJAX, independently from each other. In area A there's a tree and I use a poll tag (poll every 5 seconds) and in area B is a drop down menu which is updated by clicking a button.

          Although the poll tag specifies which elements should be rendered (only those concerning the tree) the drop down menu is influenced by that too, and we have some funny effects when we try to select something from the menue and the poll disrupt that.

          Then I try to use the limitToList attribute in the poll tag. Then I had the effect, that nothing was updated on the page.

          Take the limitToList attribute AND place the poll tag near the tags you wanna update with it, so they have the same parent. I don't know why but in my context it works.

          Other thoughts, solutions and above all explanations for this behavior are welcome!