3 Replies Latest reply on Aug 4, 2008 12:01 PM by Jens Mueller

    polling stops after change on backend

    Jens Mueller Novice

      Hi,
      i'd need a hand with this: i got a page which displays 3 tables, presenting background processes (propspective, current and processed). To make that look nicer and more dynamic i poll the respective data. So far so good, data is being requested after 4 seconds and lists/tables are refreshed. As soon as i add a new task in a 2nd browser window, the first one stops polling.
      Any hints? Cheers,
      funky-J

        • 1. Re: polling stops after change on backend
          Fernando nothing Newbie

          Hi funky-J,

          Which richfaces version are you using?
          Browser version?
          Container version? :)
          Do you have some code examples?

          I did something similar at my work and it worked well...

          Fernando

          • 2. Re: polling stops after change on backend
            Jens Mueller Novice

            Hi fernando,
            thanks for your response! I'm using Jboss 4.2 with the JSF reference implementation+current richfaces. The respecting code pieces look code looks as following:

            <h:form id="pollerForm">
             <a4j:poll id="poll" interval="4000" enabled="true"
             eventsQueue="ViewQueue" ajaxSingle="true" action="#{BackProcesses.init}" reRender="poller"/>
             </h:form>
            and


            <a4j:outputPanel id="poller">
            
             <h:panelGrid columns="2" style="width: 100%"
             columnClasses="standardTableCol1_14p_top, standardTableCol1_86p">
             <h:outputText value="#{bproc_msg.processed}" styleClass="labelStyle" />
             <h:form id="processedProcesses">
             <div id="processed" class="borderDivDefHeight" style="height: 150px;">
             <h:dataTable binding="#{BackProcesses.closedTasksTable}"
             style="width: 100%" var="Item1" headerClass="standardTable_header"
             rowClasses="standardTable_Row1, standardTable_Row2"
             value="#{BackProcesses.closedTasks}" rows="1">
             <h:column>
             <a4j:commandButton id="editB"
             image="#{PathHandler.path}/admin/protected/images/edit.gif"
             action="#{BackProcesses.storeClosedId}"
             reRender="ajaxArea">
             <f:param name="#{taskId}" value="#{Item1.objectKey}" />
             <a4j:actionparam name="nextView"
             value="/admin/protected/pages/backprocesses/result.jsp"
             assignTo="#{ViewHandler.currentView}" />
             </a4j:commandButton>
             </h:column>
             <h:column>
             <h:outputText value="#{Item1.title}" />
             </h:column>
             <h:column>
             <h:outputText value="#{bproc.started}: #{Item1.started}">
             <f:convertDateTime pattern="dd.MM.yyyy / HH:mm:ss" />
             </h:outputText>
             </h:column>
             <h:column>
             <h:outputText value="#{bproc.stopped}: #{Item1.finished}">
             <f:convertDateTime pattern="dd.MM.yyyy / HH:mm:ss" />
             </h:outputText>
             </h:column>
             </h:dataTable></div>
             </h:form>
             </h:panelGrid>
            </a4j:outputPanel>


            The funny thing is that if i stop some process in a second browser window the process (loaded in a list from DB) disappears as expected. however if i trigger a new process on the app polling stops...

            • 3. Re: polling stops after change on backend
              Jens Mueller Novice

              Seems to work with two different browsers...