4 Replies Latest reply on Jan 27, 2010 6:32 PM by mark lewis

    insulating a4j:region from causing page reload

    mark lewis Newbie

      Hello,

      As in the code snippet below, I have a a4j:region containing an a4j:poll just like the poll clock example in the live demo (http://livedemo.exadel.com/richfaces-demo/richfaces/poll.jsf?c=poll&tab=usage).  I have added a form node below with a dataTable in it.  In the backing bean code which supplies the table (method: getFeedDataList) I have log4j statements which show from the console that the method is being accessed every 800ms - ie the same time my a4j:poll triggers an update for the server time from a different method in the same bean.

       

      I've read the manual and looked at using a4j:regions (tried renderRegionOnly and selfRendered) and a4j:forms in different combinations but I cannot find a way to insulate the a4j:region which controls the clock from causing a reload of the whole page.  Can anyone point out how I can do this?

       

      Many thanks for any help in advance

      Mark

       

      <f:view>
           <rich:page pageTitle="Prism" markupType="xhtml">
                <a4j:region>
                     <h:form>
                          <a4j:poll id="poll" interval="800" enabled="true"
                               reRender="poll,grid" />
                     </h:form>
                </a4j:region>
                <h:panelGrid columns="1" width="100%" id="grid">
                     <h:outputText id="datum" value="#{PrismBacking.dateTime}" />
                </h:panelGrid>
      
                <a4j:form id="nodeConfig">
                     <h:panelGrid columns="2">
                          <h:dataTable id="dt1" value="#{PrismBacking.feedDataList}"
                               var="item" border="10" cellpadding="5" cellspacing="3" first="0"
                               rows="#{PrismBacking.feedDataListSize}" width="50%" dir="LTR"
                               frame="hsides" rules="all"
                               summary="This is a JSF code to create dataTable.">
      
                               <f:facet name="header">
                                    <h:outputText value="This is 'dataTable' demo" />
                               </f:facet>
      
                               <h:column>
                                    <f:facet name="header">
                                         <h:outputText value="id" />
                                    </f:facet>
                                    <h:outputText value="|#{item.feedId}|"></h:outputText>
                               </h:column>
      
                               <h:column>
                                    <f:facet name="header">
                                         <h:outputText value="name" />
                                    </f:facet>
                                    <h:outputText value="|#{item.feedName}|"></h:outputText>
                               </h:column>
                          </h:dataTable>
                          <h:outputText value="" />
                     </h:panelGrid>
                </a4j:form>
           </rich:page>
      </f:view>