poll with rerender problem
byoudan May 11, 2007 8:16 PMI have several tabs on a jsf/facelets page that I want to use the a4j:poll function to refresh the contents of the tab when data is updated in the application. The problem I am having is that the contents of the tabs are not being rendered until the first interval is reached. My problem started when I tied the enabled flag on the a4j:poll to a boolean variable on my action class. If I hard code enabled="true" the contents of the tab are rendered when the page loads. The problem is that I want to use a variable so I can toggle the enabled flag. Am I correct in trying to use the enabled flag to toggle the a4j:poll from rerendering? What is the difference between hard coding enabled="true" and setting it to a boolean variable with a value of true? (I also tried changing the boolean variable to a String with a value of "true" and no luck)
Thanks in advance.
<f:view id="projectSummary"> <div id="tabView1"> <div class="aTab"> <h:form id="projectInformationForm"> <h:panelGroup id="projectInformationTab"> <table class="internal" border="1" cellspacing="1" cellpadding="1"> <tr> <td bgcolor="#004D81"><font color="#CCECFF"><b>Project Name</b></font></td> <td>#{projectInformation.projectName}</td> </tr> <tr> <td bgcolor="#004D81"><font color="#CCECFF"><b>Project Code</b></font></td> <td>#{projectInformation.projectCode}</td> </tr> <tr> <td bgcolor="#004D81"><font color="#CCECFF"><b>Project Status</b></font></td> <td>#{projectInformation.projectStatus} - #{projectInformation.projectStatusDate}</td> </tr> </table> </h:panelGroup> <a:poll id="projectInformationRefresh" enabled="#{projectAction.refreshProjectInformation}" action="#{projectAction.refreshProjectInformationTab(false)}" reRender="projectInformationTab" interval="60000"/> </h:form> </div> <div class="aTab"> <h:form id="phaseStatusesForm"> <h:dataTable id="phaseStatuses" value="#{phaseStatuses}" var="phase" headerClass="header" columnClasses="borderSolidBlack" styleClass="borderSolidBlack"> <h:column> <f:facet name="header"> <h:outputText value="Process" /> </f:facet> <h:outputLink value="#" onclick="showTab('tabView2',#{phase.phaseNumber});"> <font color="#000099">#{phase.phaseName}</font> </h:outputLink> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Status" /> </f:facet> <h:outputText value="#{phase.phaseStatus}" /> </h:column> </h:dataTable> <a:poll id="phaseStatusesRefresh" enabled="#{projectAction.refreshPhaseStatus}" action="#{projectAction.refreshPhaseStatusTab(false)}" reRender="phaseStatuses" interval="60000"/> </h:form> </div> </div>