2 Replies Latest reply on May 29, 2009 6:40 AM by Remi Guillemette

    a4j:poll always reRender himself

    Remi Guillemette Newbie

      Hello everyone.

      I use an a4j:poll to reRender a section of my page. I want the a4j:poll to only execute once so I did not add its ID in the reRender list and I have a limitToList="true".

      Since my update to 3.3.1, a4j:poll seem to reRender himself automatically.

      Is it normal?

      My Code (a4j:poll is at the end):

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:a="http://www.taleo.com/portal"
       xmlns:c="http://java.sun.com/jstl/core"
       xmlns:t="http://myfaces.apache.org/tomahawk">
      
      <f:subview id="subview_#{wid.widgetUserNo}">
      
       <h:form id="frm_#{wid.widgetUserNo}">
       <rich:contextMenu attached="false" id="menu_#{wid.widgetUserNo}" submitMode="ajax">
       <rich:menuItem value="Move Up" action="#{WidgetPageFactory.moveWidgetUp}" reRender="tabWidgetContainer">
       <a4j:actionparam name="moveupno" value="#{wid.widgetUserNo}" assignTo="#{WidgetPageFactory.contextWidgetNo}" />
       </rich:menuItem>
       <rich:menuItem value="Move Down" action="#{WidgetPageFactory.moveWidgetDown}" reRender="tabWidgetContainer">
       <a4j:actionparam name="movedownno" value="#{wid.widgetUserNo}" assignTo="#{WidgetPageFactory.contextWidgetNo}" />
       </rich:menuItem>
       <rich:menuItem value="Setting" action="mywidgetprofile" />
       <rich:menuItem value="Share this widget (Soon...)" />
       </rich:contextMenu>
       </h:form>
      
       <!-- Standard widget container -->
      
       <rich:panel headerClass="rich-panel-header_wid" id="bob">
       <f:facet name="header">
       <h:form>
       <rich:dragSupport dragType="widget" dragIndicator=":indicator">
       <a4j:actionparam value="#{wid.widgetUserNo}" name="widkey"/>
       <a4j:actionparam value="#{wid.page.widgetPageNo}" name="widpageno"/>
       </rich:dragSupport>
       <h:panelGrid columns="5" style="width:100%;" rowClasses="header_row"
       columnClasses="standardTable_ColumnTopLeft, headerToogleTable, headerToogleTable,headerToogleTable,headerToogleTable">
       <h:outputText value="#{wid.title}" style="vertical-align:center;"/>
       <h:graphicImage id="idSetting" style="border-width:0px;vertical-align:middle;" value="/images/widgets/wid_setting.png">
       <rich:componentControl attachTo="idSetting" event="onclick" for="menu_#{wid.widgetUserNo}" operation="show" />
       </h:graphicImage>
      
       <t:graphicImage id="idCollapse_#{wid.widgetUserNo}" style="border-width:0px;vertical-align:center;"
       value="/images/widgets/wid_collapse.png" forceId="true"
       onclick="hideDiv_#{wid.widgetUserNo}();" />
      
       <t:graphicImage id="idShow_#{wid.widgetUserNo}" style="border-width:0px;vertical-align:middle;"
       value="/images/widgets/wid_appear.png" forceId="true"
       onclick="showDiv_#{wid.widgetUserNo}();" />
      
       <h:graphicImage id="idClose" style="border-width:0px;vertical-align:middle;"
       value="/images/widgets/wid_close.png">
       <a4j:support event="onclick" action="#{WidgetPageFactory.removeWidget}" onsubmit="if (!confirm('Are you sure you want to delete this widget?')) return false;" reRender="tabWidgetContainer">
       <a4j:actionparam name="widnumber" value="#{wid.widgetUserNo}" assignTo="#{WidgetPageFactory.contextWidgetNo}" />
       </a4j:support>
       </h:graphicImage>
       </h:panelGrid>
       </h:form>
       </f:facet>
      
       <!-- Widget Report Data -->
       <a4j:region rendered="#{wid.report.reportType.reportTypeNo == 2}">
       <rich:panel bodyClass="container-body" style="width:96%;overflow:auto;" id="pan_wid">
       <c:forEach items="#{wid.report.rciTableList}" var="tbl">
       <a:rciRenderTable table="#{tbl}" id="Tbl" />
       </c:forEach>
       </rich:panel>
       </a4j:region>
      
       <!-- Widget Report Data -->
       <a4j:region rendered="#{wid.report.reportType.reportTypeNo == 3}">
       <rich:panel bodyClass="container-body" style="width:96%;" id="pan_wid_list">
       <h:outputText value="This is a list..." />
       </rich:panel>
       </a4j:region>
      
       </rich:panel>
      
       <rich:effect name="hideDiv_#{wid.widgetUserNo}" for="pan_wid" type="BlindUp" params="duration:0.5"/>
       <rich:effect name="showDiv_#{wid.widgetUserNo}" for="pan_wid" type="Appear" params="duration:0.5" />
      
       <!-- Polling mechanic -->
       <a4j:region rendered="#{wid.report.reportType.reportTypeNo == 2}">
       <h:form>
       <a4j:poll id="poll_#{wid.widgetUserNo}" interval="10000" action="#{WidgetPageFactory.pollWidgetReport}" eventsQueue="widgetPollQueue"
       enabled="true" reRender="pan_wid" limitToList="true" status="myportalStatus">
       <a4j:actionparam name="widno" value="#{wid.widgetUserNo}" assignTo="#{WidgetPageFactory.contextWidgetNo}" />
       </a4j:poll>
       </h:form>
       </a4j:region>
      
      
      </f:subview>
      </ui:composition>