1 Reply Latest reply on May 6, 2008 2:53 PM by Julian Hoyos Franco

    Problem using facelets and PanelMenu

    Julian Hoyos Franco Newbie

      Hi.

      I'm using richfaces and facelets. I need load a page in the tag <ui:insert name="contenido"> </ui:insert>, but when I do this, it reload all page, and the panelMenu doesn't keep the state, it close. Excuse by my english.

      "index.jspx"
      <?xml version="1.0" encoding="ISO-8859-1" ?>
      <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
      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:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j" version="2.0">


      .col1 {
      width: 30%;
      }

      .col2 {
      width: 70%;
      }


      <h:panelGrid columns="1" style="width:100%" border="1" cellspacing="1">

      <ui:insert name="encabezado">
      <rich:panel header="Example" style="width:100%">
      <h:outputText value="Test" />
      </rich:panel>
      </ui:insert>
      <h:panelGrid columns="2" style="width:100%" border="1" columnClasses="col1, col2" cellspacing="1">
      <ui:insert name="menu">

      </ui:insert>
      <ui:insert name="contenido">

      </ui:insert>
      </h:panelGrid>
      </h:panelGrid>
      </jsp:root>



      "menu.jspx"
      <?xml version="1.0" encoding="ISO-8859-1" ?>
      <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
      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:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j" version="2.0">

      <ui:composition template="/index/index.jspx">
      <ui:define name="menu">
      <rich:panelMenu expandSingle="true" iconExpandedGroup="disc" iconCollapsedGroup="disc" iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right" iconCollapsedTopGroup="chevronDown" mode="ajax">
      <rich:panelMenuGroup label="CONSULTAS">
      <rich:panelMenuGroup label="MEDICINA PREPAGADA">
      <rich:panelMenuGroup label="Ingresos y Retiros">
      <rich:panelMenuItem label="Ingresos" action="ingresosPrepa">

      </rich:panelMenuItem>
      <rich:panelMenuItem label="Retiros">
      </rich:panelMenuItem>
      <rich:panelMenuItem label="Resumen movimientos">
      </rich:panelMenuItem>
      </rich:panelMenuGroup>
      <rich:panelMenuGroup label="Contratos colectivos">
      <rich:panelMenuItem label="Información del contrato">
      </rich:panelMenuItem>
      <rich:panelMenuItem label="Último estado de cuenta">
      </rich:panelMenuItem>
      <rich:panelMenuItem label="Pagos realizados">
      </rich:panelMenuItem>
      </rich:panelMenuGroup>
      </rich:panelMenuGroup>
      </rich:panelMenuGroup>
      </rich:panelMenu>
      </ui:define>
      </ui:composition>
      </jsp:root>


      otherPage.jspx
      <?xml version="1.0" encoding="ISO-8859-1" ?>
      <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
      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:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j" version="2.0">

      <ui:composition template="/menu/menu.jspx">
      <ui:define name="contenido">
      <h:outputText value="Yees" />
      </ui:define>
      </ui:composition>
      </jsp:root>