1 Reply Latest reply on Feb 11, 2010 7:02 PM by Snake Zori

    a4j:poll to rerender h:outputText? howto?

    Chris Moerz Newbie

      Hey everyone,


      can someone tell me, how I can make an a4j:poll rerender an h:outputText element on a page?


      What I've figured out so far... I've got the following block on my xhtml page:


      <a4j:region id="TopAjaxRegion">
           <h:form>
                <a4j:poll id="secPoll" interval="500" 
                     reRenderer="serverDateTimestamp" 
                     eventsQueue="timerQueue" />
           </h:form>
                     
      </a4j:region>
      <a4j:status id="AjaxStatus" startText="Started" for="TopAjaxRegion" />
      
      Begin form
      <h:form>
           <h:panelGrid columns="1" id="dateValGrid">
                <h:outputText id="serverDateTimestamp" 
                     value="#{meetingActive.serverDateTime}" />
           </h:panelGrid>
      </h:form>
      <h:outputText value="#{meetingActive.serverDateTime}">
           <s:convertDateTime pattern="dd MMM yyyy, HH:mm" type="both" />
      </h:outputText>
      End form
      



      My backing bean has a method annotated as @Asynchronous in its @Local interface


      @Asynchronous
      public Date getServerDateTime() {
           return new Date();
      }
      



      I did add


      <async:timer-service-dispatcher />
      



      to my components.xml.


      However, it doesn't work. None of the h:outputText renders a date, not even the regular one outside the form. If I take out the @Asynchronous, the text gets rendered, but not updated. The a4j:status tells me that the request ist starting and ending (I see it switching back forth), but the output doesn't get updated.


      Does anyone have a clue why this might happen? I'm clueless.


      thx in advance
      chris


      ps. no clue if this is pertinent to the problem, but I see the following messages in the log:


      13:00:06,884 WARN  [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@d117f5
      13:00:06,884 WARN  [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@f834da
      13:00:06,884 WARN  [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@19adc06