3 Replies Latest reply on Jan 10, 2011 12:32 PM by mark lewis

    a4j:included rich:panelMenu not reRendering

    mark lewis Newbie



      I have a top level  xhtml JSF page (3.3.2.SR1) which has in it another a4j:include'd xhtml JSF (controls) page with a tabMenu.  One of the tabs a4j:includes a further page. This last page has a panelMenu.


      In the top level page is a commandButton which, when hit, reRenders a load of elements.


      I've noticed that when I hit the commandButton a second (and successive) time, the panelMenu is not reRendering properly - it seems to try and amalgate both sets of elements into one.  I want to refresh it but when the commandButton gets pressed.


      I tried to include the id of the panelMenu in the commandButton reRender attribute, and as expected the first time the button is hit I get a warning as the panelMenu id is not known at that time - this is fine for me.  But when I hit it again, there's no warning and I expected it to be reRendered and it is was not - it's still amalgamating both the old elements and the new.


      I have my panelMenu mode set to ajax.  I dont want to use server as this refreshes the whole page and I'm trying to create a webapp which works on 1 page rather than uses a series.


      How can I get just my (buried) panelMenu updated when a commandButton above it in the node tree is pressed?


      For reference, here is some of the code:


      Top level button:



      <rich:toolBarGroup location="left">
                              <a4j:region id="rb">
                                  <a4j:form name="nodeSelectForm">
                                      <h:panelGrid columns="5">
                                          <h:outputText style="text-align: center" value="Node Select " />
                                          <h:selectOneMenu id="nodes" value="#{MyBacking.chosenNode}">
                                              <f:selectItems value="#{MyBacking.nodes}" />
                                          <a4j:commandButton value="Retrieve" styleClass="ctrlBtn"
                                              image="/img/btnRetrieve26.png" />




      <rich:panel id="contentBox">
                          <h:panelGroup layout="block" id="contentPanel">
                                  <a4j:include viewId="#{MyBacking.viewId}">
                                      <f:param name="targetIdParam" value="content" />


      MyBacking.viewId returns the xhtml page with this in:


      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
          <a4j:region id="nodeConfig">
              <h:panelGrid columns="1">
                  <rich:tabPanel switchType="ajax" rendered="true">
                      <rich:tab styleClass="tab" label="Node Logs">
                          <a4j:include viewId="nodeConfigNodeLogs.xhtml"/>


      And in my nodeConfigNodeLogs.xhtml:



              <a4j:region id="logs">
                  <h:panelGrid columns="2">
                          <a4j:region id="lpr">
                              <rich:panelMenu mode="ajax" id="lp">
                                  <c:forEach items="#{MyBacking.panelNodes}" var="map">
                                      <rich:panelMenuGroup label="#{map.value.shortLogName}">
                                          <c:forEach items="#{map.value.logs}" var="log">
                                              <rich:panelMenuItem label="#{log.key}"
                                                  action="#{MyBacking.updateCurrent}" reRender="sysMsg">
                                                  <f:param name="current" value="#{log.value}" />




      Any help massively appreciated.