Problems with reRender
balteo Jun 11, 2007 11:29 AMHello,
I have the following problem: I have defined a div/outputpanel which is at the top of the page as follows:
<f:view> <a4j:outputPanel id="main-panel" layout="block"> <h:form id="main-form"> <h:panelGrid columns="1" border="0" width="100%" styleClass="protideHeader" id="page-header"> <h:graphicImage value="images/calfi.gif"/> </h:panelGrid> <f:verbatim><br/><br/></f:verbatim> <jsp:include page="includes/home/input-screen.jsp"/> <f:verbatim><br/><br/><br/><br/></f:verbatim> <jsp:include page="includes/home/output-screen.jsp"/> </h:form> <a4j:log popup="true"/> </a4j:outputPanel> </f:view>
An a4j:commandButton component "reRenders" the main-panel div or I should say tries to reRender it but without success. The component that does not get rerendered is the following:
<f:subview id="tableau-sortie"> <h:panelGroup id="tableau-sortie-panel" rendered="#{! empty Protide01pManagedBean.lines}"> <rich:dataTable id="protidedatatable" value="#{Protide01pManagedBean.lines}" rows="50" var="line" styleClass="table" headerClass="th" columnClasses="td" rowClasses="tr" width="100%" binding="#{ContractManagedBean.protide01p}"> <h:column> <f:facet name="header"> <h:outputText value="Identifiant transaction"/> </f:facet> <h:outputText value="#{line.trSource}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="ISIN"/> </f:facet> <h:outputText value="#{line.isin}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Type de flux"/> </f:facet> <h:outputText value="#{line.cashFlowType}" title="#{PopulateReferenceDataManagedBean.entries['protide-reference-data']['protide-remettant-declarants-declarant-data']['pr02']['tF'][line.cashFlowType].desc}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Type de détention"/> </f:facet> <h:outputText value="#{line.holdingType}" title="#{PopulateReferenceDataManagedBean.entries['protide-reference-data']['protide-remettant-declarants-declarant-data']['pr02']['tD'][line.holdingType].desc}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Flux"/> </f:facet> <h:outputText value="#{line.cashFlow}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Maturité"/> </f:facet> <h:outputText value="#{line.maturity}" title="#{PopulateReferenceDataManagedBean.entries['protide-reference-data']['protide-remettant-declarants-declarant-data']['pr02']['ma'][line.maturity].desc}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Supprimer"/> </f:facet> <a4j:outputPanel layout="block" style="text-align:center;"> <a4j:commandButton action="#{ContractManagedBean.deleteContractAction}" reRender="main-panel" immediate="true" title="Efface moi!!!" image="images/trash.png" style="background-color: white;"/> </a4j:outputPanel> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Mettre à jour"/> </f:facet> <a4j:outputPanel layout="block" style="text-align:center;"> <a4j:commandButton action="#{ContractManagedBean.retrieveLineAction}" reRender="main-panel" immediate="true" title="Retrieve me!!!" image="images/retrieve.png" style="background-color: white;"/> </a4j:outputPanel> </h:column> </rich:dataTable> <rich:datascroller for="protidedatatable" boundaryControls="show" fastControls="hidden" stepControls="show" renderIfSinglePage="true" tableStyleClass="whiteTable" reRender="tableau-sortie-panel"> <f:facet name="first"> <h:graphicImage title="Premier" value="images/first.png" style="background-color: white;"/> </f:facet> <f:facet name="previous"> <h:graphicImage title="Précédent" value="images/previous.png" style="background-color: white;"/> </f:facet> <f:facet name="next"> <h:graphicImage title="Suivant" value="images/next.png" style="background-color: white;"/> </f:facet> <f:facet name="last"> <h:graphicImage title="Dernier" value="images/last.png" style="background-color: white;"/> </f:facet> <f:facet name="first_disabled"> <h:graphicImage value="images/first.png" style="background-color: white;"/> </f:facet> <f:facet name="previous_disabled"> <h:graphicImage value="images/previous.png" style="background-color: white;"/> </f:facet> <f:facet name="next_disabled"> <h:graphicImage value="images/next.png" style="background-color: white;"/> </f:facet> <f:facet name="last_disabled"> <h:graphicImage value="images/last.png" style="background-color: white;"/> </f:facet> </rich:datascroller> </h:panelGroup> <h:panelGroup rendered="#{empty Protide01pManagedBean.lines}"> <h:outputText value="Il n'y a pas de données dans le tableau"/> </h:panelGroup> </f:subview>
The rich:datatable DOES NOT GET RERENDERED!! even though a4j claims it does (see log output)
Here is the output from the log:
debug[17:19:49,260]: Update page by list of rendered areas from response main-panel debug[17:19:49,260]: search for elements by name 'script' in element #document debug[17:19:49,260]: getElementsByTagName found 3 debug[17:19:49,260]: <script> in response with src=/ProtideWeb/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript.jsf debug[17:19:49,260]: Such element exist in document debug[17:19:49,275]: <script> in response with src=/ProtideWeb/a4j.res/org.ajax4jsf.framework.resource.PrototypeScript.jsf debug[17:19:49,275]: Such element exist in document debug[17:19:49,275]: search for elements by name 'link' in element #document debug[17:19:49,275]: getElementsByTagName found 2 debug[17:19:49,275]: <link> in response with src=/ProtideWeb/a4j.res/css/table.xcss/DATA/eAGz-yBjAQAEPAGD.jsf debug[17:19:49,275]: Such element exist in document debug[17:19:49,275]: <link> in response with src=/ProtideWeb/a4j.res/css/datascroller.xcss/DATA/eAGz-yBjAQAEPAGD.jsf debug[17:19:49,275]: Such element exist in document debug[17:19:49,275]: Attempt to update part of page for Id: main-panel debug[17:19:49,275]: call getElementById for id= main-panel debug[17:19:49,291]: Replace content of node by replaceChild() debug[17:19:49,338]: search for elements by name 'script' in element div debug[17:19:49,338]: getElementsByTagName found 1 debug[17:19:49,338]: Scripts in updated part count : 1 debug[17:19:49,338]: Update part of page for Id: main-panel successful debug[17:19:49,338]: call getElementById for id= ajax-update-ids debug[17:19:49,338]: Hidden JSF state fields: [object HTMLSpanElement] debug[17:19:49,338]: Namespace for hidden view-state input fields is undefined debug[17:19:49,338]: search for elements by name 'input' in element span debug[17:19:49,338]: getElementsByTagName found 2 debug[17:19:49,338]: Replace value for inputs: 8 by new values: 2 debug[17:19:49,338]: Input in response: jsf_sequence debug[17:19:49,338]: Input in response: javax.faces.ViewState debug[17:19:49,338]: Found same input on page with type: hidden debug[17:19:49,338]: search for elements by name 'INPUT' in element span debug[17:19:49,338]: getElementsByTagName found 0 debug[17:19:49,338]: Replace value for inputs: 8 by new values: 0 debug[17:19:49,338]: call getElementById for id= _A4J.AJAX.focus debug[17:19:49,338]: No focus information in response debug[17:19:49,447]: Evaluate script replaced area in document: // LOG.registerPopup('L','LogWindow',800,600,LOG.ALL); // //
I can send the complete code with sources if needed.
Please help!!
Thanks in advance,
Julien.