0 Replies Latest reply on Nov 20, 2007 1:15 PM by Fabrice Granzotto

    Problems with a4j:poll

    Fabrice Granzotto Newbie

      Hi everybody!

      I have a problem using the tag <a4j :poll>.

      I have 2 jsp pages, one where the user enters the id of the container (inputText and commandbutton) and one which displays the content (datatable) of the container once the user clicks on the submit button of the first page.

      My goal is to refresh the second page automatically every second. To do this, I tried to integrate <a4j:poll> but the problem is that when the refresh occurs, it comes back to the first page (inputText and button)…

      What do I wrong???

      FIRST PAGE:

      <f:view>
      <h:form>
      <h:inputText value="#{containerBean.id}"></h:inputText>
      <h:commandButton value="Submit" action="#{containerBean.listContent}"></h:commandButton>
      </h:form>
      </f:view>


      SECOND PAGE:


      <f:view>

      <h:form>
      <h:dataTable border="1" value="#{containerBean.allAssets}" var="currentAsset" id="grid">
      <h:column id="column1">
      <h:outputText value="#{currentAsset.id}"></h:outputText>
      <f:facet name="header">
      <h:outputText value="id"></h:outputText>
      </f:facet>
      </h:column>
      <h:column id="column2">
      <h:outputText value="#{currentAsset.name}"></h:outputText>
      <f:facet name="header">
      <h:outputText value="name"></h:outputText>
      </f:facet>
      </h:column>
      </h:dataTable>
      </h:form>
      <a4j:region>
      <h:form>
      <a4j:poll id="picker" enabled="true"
      reRender="picker,grid"
      interval="1000"/>
      </h:form>
      </a4j:region>
      </f:view>