2 Replies Latest reply on Mar 30, 2009 7:40 AM by Eugene Kisly

    rich:panelMenu and a4j:include

    Eugene Kisly Newbie

       

      <rich:panelMenuItem status="menuLoading" id="reportsIndividualItem"
       styleClass="menuContentBg" icon="theme/images/buttons/next.gif"
       label="#{bundle.getreportindividual}"
       rendered="#{rolesManager.rightIdsByPrincipal['5'] != null}"
       reRender="includePage"
       actionListener="#{commonBean.goToNewPage}">
       <f:attribute name="newLink" value="/getReportIndividual.jsp"/>
       </rich:panelMenuItem>
      
       <rich:panelMenuItem status="menuLoading" id="getreportjuridical"
       styleClass="menuContentBg" icon="theme/images/buttons/next.gif"
       label="#{bundle.getreportjuridical}"
       rendered="#{rolesManager.rightIdsByPrincipal['6'] != null}"
       reRender="includePage"
       actionListener="#{commonBean.goToNewPage}">
       <f:attribute name="newLink" value="/getReportJuridical.jsp"/>
       </rich:panelMenuItem>
      
       <rich:panelMenuItem status="menuLoading" id="unloadstatistic" label="#{bundle.unloadstatistic}"
       styleClass="menuContentBg" icon="theme/images/buttons/next.gif"
       rendered="#{rolesManager.rightIdsByPrincipal['7'] != null }"
       reRender="includePage" actionListener="#{commonBean.goToNewPage}">
       <f:attribute name="newLink" value="/inquiriesStatistic.jsp"/>
       </rich:panelMenuItem>
      
       <rich:panelMenuItem status="menuLoading" id="roleauditjournal" label="#{bundle.roleauditjournal}"
       styleClass="menuContentBg" icon="theme/images/buttons/next.gif"
       rendered="#{rolesManager.rightIdsByPrincipal['11'] != null}"
       reRender="includePage" actionListener="#{commonBean.goToNewPage}">
       <f:attribute name="newLink" value="/auditRoles.jsp"/>
       </rich:panelMenuItem>
      
       <rich:panelMenuItem status="menuLoading" id="rightsjournal" label="#{bundle.rightsaudit}"
       styleClass="menuContentBg" icon="theme/images/buttons/next.gif"
       rendered="#{rolesManager.rightIdsByPrincipal['19'] != null}"
       reRender="includePage" actionListener="#{commonBean.goToNewPage}">
       <f:attribute name="newLink" value="/auditRights.jsp"/>
       </rich:panelMenuItem>
      
       <rich:panelMenuItem status="menuLoading" id="uploadjournal" label="#{bundle.uploadjournal}"
       styleClass="menuContentBg" icon="theme/images/buttons/next.gif"
       rendered="#{rolesManager.rightIdsByPrincipal['14'] != null}"
       reRender="includePage" actionListener="#{commonBean.goToNewPage}">
       <f:attribute name="newLink" value="/auditUpload.jsp"/>
       </rich:panelMenuItem>
      
       <rich:panelMenuItem status="menuLoading" id="stopList" label="#{bundle.stoplist}"
       styleClass="menuContentBg" icon="theme/images/buttons/next.gif"
       rendered="#{rolesManager.rightIdsByPrincipal['14'] != null}"
       reRender="includePage" actionListener="#{commonBean.goToNewPage}">
       <f:attribute name="newLink" value="/stopList.jsp"/>
       </rich:panelMenuItem>
      
       <rich:panelMenuItem status="menuLoading" id="requestjournal" label="#{bundle.requestjournal}"
       styleClass="menuContentBg" icon="theme/images/buttons/next.gif"
       rendered="#{rolesManager.rightIdsByPrincipal['12'] != null}"
       reRender="includePage"
       actionListener="#{commonBean.goToNewPage}">
       <f:attribute name="newLink" value="/auditReqests.jsp"/>
       </rich:panelMenuItem>
      
       <rich:panelMenuItem status="menuLoading" id="authentications" label="#{bundle.connectionjournal}"
       styleClass="menuContentBg" icon="theme/images/buttons/next.gif"
       reRender="includePage"
       rendered="#{rolesManager.rightIdsByPrincipal['15'] != null}"
       actionListener="#{commonBean.goToNewPage}">
       <f:attribute name="newLink" value="/auditAuthentications.jsp"/>
       </rich:panelMenuItem>
      
       <rich:panelMenuItem status="menuLoading" id="preferencesjournal"
       styleClass="menuContentBg" icon="theme/images/buttons/next.gif"
       label="#{bundle.preferencesjournal}"
       rendered="#{rolesManager.rightIdsByPrincipal['16'] != null}"
       reRender="includePage"
       actionListener="#{commonBean.goToNewPage}">
       <f:attribute name="newLink" value="/auditSystemProperties.jsp"/>
       </rich:panelMenuItem>
      
       <rich:panelMenuItem status="menuLoading" id="usersessions" label="#{bundle.usersessions}"
       styleClass="menuContentBg" icon="theme/images/buttons/next.gif"
       reRender="includePage"
       rendered="#{rolesManager.rightIdsByPrincipal['17'] != null}"
       actionListener="#{commonBean.goToNewPage}">
       <f:attribute name="newLink" value="/auditSessions.jsp"/>
       </rich:panelMenuItem>
      
       <rich:panelMenuItem status="menuLoading" id="systemsettings" label="#{bundle.systemsettings}"
       styleClass="menuContentBg" icon="theme/images/buttons/next.gif"
       reRender="includePage"
       rendered="#{rolesManager.rightIdsByPrincipal['10'] != null}"
       actionListener="#{commonBean.goToNewPage}">
       <f:attribute name="newLink" value="/systemProperties.jsp"/>
       </rich:panelMenuItem>
      
       <rich:panelMenuItem status="menuLoading" id="rolesldap" label="#{bundle.ldaproles}"
       styleClass="menuContentBg" icon="theme/images/buttons/next.gif"
       reRender="includePage"
       rendered="#{rolesManager.rightIdsByPrincipal['8'] != null}"
       actionListener="#{commonBean.goToNewPage}">
       <f:attribute name="newLink" value="/rolesLdap.jsp"/>
       </rich:panelMenuItem>
      
       <rich:panelMenuItem status="menuLoading" id="rolesright"
       styleClass="menuContentBg" style="border:0" icon="theme/images/buttons/next.gif"
       label="#{bundle.managingaccessrights}"
       rendered="#{rolesManager.rightIdsByPrincipal['9'] != null}"
       reRender="includePage"
       actionListener="#{commonBean.goToNewPage}">
       <f:attribute name="newLink" value="/rolesRights.jsp"/>
       </rich:panelMenuItem>
      
       </rich:panelMenu>
      
      
       <a4j:status forceId="true" id="menuLoading" onstart="disableMenu();" onstop="enableMenu();">
       <f:facet name="start">
       <h:panelGrid columns="4" columnClasses="loading" width="150px" style="padding-left:25px;">
       <h:panelGroup style="text-align:center; width:100px">
       <h:outputText value="Loading. . ."></h:outputText>
       </h:panelGroup>
       </h:panelGrid>
       </f:facet>
      
       </a4j:status>
      
       </a4j:form>
       </h:panelGroup>
      
      
       <h:panelGroup>
       <a4j:include id="includePage" viewId="#{commonBean.currentPage}"/>
       </h:panelGroup>
      
      


      
      public class CommonBean {
      
       private static final Logger logger = Logger.getLogger(CommonBean.class);
      
      
      
      
       public void goToNewPage(ActionEvent event) {
       this.currentPage = event.getComponent().getAttributes().get("newLink").toString();
       logger.debug("*************goToNewPage********************" + this.currentPage);
       }
      
       public String getCurrentPage() {
       logger.debug("****************getCurrentPage*****************" + this.currentPage);
       return currentPage;
       }
      
       public void setCurrentPage(String currentPage) {
       this.currentPage = currentPage;
       }
      
      
      }


      Problem:
      a4j:include displays more than one page when i click fast at different menu items.

      please help me to solve it