1 Reply Latest reply on May 7, 2008 3:12 PM by guarf

    Menu from demo: problem to rerender

    guarf

      The menu isnt rendered when the page apear first time, when i Login... i try to reRender the menu but it fails :( it only show the panelBarItem ("usermanagement") but not the childs inside a4j:repeat

      When I refresh the browser the panelBarItem show fine with the childs... what could be wrong ?

      sorry my bad english (i speak spanish)

      thx in advance

      <html 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">
      <ui:composition>
      <a4j:outputPanel id="output" >
       <rich:panel styleClass="panel_menu" id="panelMenu" rendered="${Login.loggedIn}" >
       <rich:panelBar selectedPanel="#{componentNavigator.currentComponent.group}" width="100%" height="605px" >
       <rich:panelBarItem id="userManagement" label="User Management" >
       <a4j:repeat var="component" value="#{componentNavigator.userManagement}" ajaxKeys="#{ajaxKeys}">
       <tr class="#{component.current?'active':'unactive'}" onmouseover="this.className='active'" onmouseout="this.className='#{component.current?'active':'unactive'}'">
       <td class="ico"><h:graphicImage value="#{component.iconImage}" width="16" height="16" alt="" border="0" id="image"/></td>
       <td class="text" width="100%">
       <h:outputLink style="display:block;height:20px" value="#{component.contextRelativeLocation}" id="text">
       <span style="display:block;padding-top:3px;text-decoration : none; color : #000000;">
       #{component.name}
       </span>
       <f:param value="#{component.id}" name="c"/>
       </h:outputLink>
       </td>
       </tr>
       </a4j:repeat>
       </rich:panelBarItem>
       </rich:panelBar>
       </rich:panel>
      </a4j:outputPanel>
      </ui:composition>
      </html>


      <a4j:commandButton id="submit" action="#{Login.login}" value="#{msg.logintitle}" reRender="output"/>


        • 1. Re: Menu from demo: problem to rerender
          guarf

          I have a working solution in IE but it has a bug with Firefox and Opera :(

          An exception occurred
          java.lang.IllegalArgumentException: FacesEvent of class javax.faces.event.ActionEvent not supported by UIInput


          <a4j:outputPanel id="outputPanelMenu" >
           <rich:panel styleClass="panel_menu" id="panelMenu" rendered="${Login.loggedIn}" >
          
           <rich:panelMenu
           selectedChild="${componentNavigator.currentItem}"
           width="100%"
           height="300px"
           mode="ajax"
           expandSingle="true"
           expandMode="ajax"
           iconExpandedGroup="disc" iconCollapsedGroup="disc"
           iconExpandedTopGroup="triangleUp" iconGroupTopPosition="right"
           iconCollapsedTopGroup="triangleDown" iconCollapsedTopPosition="right" >
          
           <rich:panelMenuGroup id="groupUserManagement" expandMode="ajax" label="User Management" expanded="${componentNavigator.currentUserManagement}">
           <ui:include src="/templates/include/components-group.xhtml">
           <ui:param name="components" value="#{componentNavigator.userManagement}" />
           </ui:include>
           </rich:panelMenuGroup>
          
           </rich:panelMenu>
           </rich:panel>
           </a4j:outputPanel>


          this is the components-group.xhtml

          <html 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:c="http://java.sun.com/jstl/core">
          <ui:composition>
           <c:forEach items="#{components}" var="component">
           <rich:panelMenuItem icon="#{component.iconImage}" name="#{component.id}" action="${componentNavigator.currentComponentByMenu}" reRender="formBody">
           <span style="display:block;padding-top:0px;text-decoration : none; color : #000000;">
           #{component.name}
           </span>
           <f:param value="#{component.id}" name="currentComponentByMenu"/>
           </rich:panelMenuItem>
           </c:forEach>
          </ui:composition>
          </html>