2 Replies Latest reply on Sep 18, 2007 10:21 AM by starwoodvo

    rich:toggleControl javax.faces.FacesException: Parent panel

      <div style="-rave-layout: grid;" xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:rich="http://richfaces.ajax4jsf.org/rich"
      xmlns:webuijsf="http://www.sun.com/web/ui">
      <f:subview id="AccountHeaderPanelF">
      <h:panelGrid binding="#{AccountHeaderPanelF.ahdrPanel}" columns="1" id="ahdrPanel" border="0" cellpadding="0" cellspacing="0" styleClass="shrcsAHdrPanel" >
      <h:panelGrid binding="#{AccountHeaderPanelF.ahdrTitlePanel}" id="ahdrTitlePanel" styleClass="shrcsAHdrTitlePanel">
      <h:outputText binding="#{AccountHeaderPanelF.ahdrTitleLabel}" id="ahdrTitleLabel" style="" value="Primary Member"/>
      </h:panelGrid>
      <rich:togglePanel binding="#{AccountHeaderPanelF.ahdrTogglePanel}" id="ahdrTogglePanel" switchType="client" initialState="closedState" stateOrder="closedState,openState">
      <f:facet name="closedState">
      <h:panelGrid id="ahdrClosedStatePanel" styleClass="ahdrStatePanel">
      <f:facet name="header">
      <h:panelGrid bgcolor="#efefef" columns="5" id="ahdrSmryPanelClosed" styleClass="shrcsAHdrSmryPanel" width="864">
      <h:outputText value="CLOSED"/>
      <rich:toggleControl id="toggleControl_openState" for="form1:ahdrTogglePanel" >
      <h:graphicImage url="resources/ig_menuBlueDown.gif" style="border-width: 0px;" />
      </rich:toggleControl>
      </h:panelGrid>
      </f:facet>
      </h:panelGrid>
      </f:facet>

      <f:facet name="openState">
      <h:panelGrid id="ahdrOpenedStatePanel" styleClass="ahdrStatePanel">
      <f:facet name="header">
      <h:panelGrid bgcolor="#efefef" columns="5" id="ahdrSmryPanelOpened" styleClass="shrcsAHdrSmryPanel" width="864">
      <h:graphicImage id="ahdrSmryPanelImageOpened" value="resources/sharcs-member-details-18.png"/>
      <h:outputText value="OPENED"/>
      <rich:toggleControl id="toggleControl_closeState" for="form1:ahdrTogglePanel" >
      <h:graphicImage value="resources/ig_menuBlueUp.gif" style="border-width: 0px;" />
      </rich:toggleControl>
      </h:panelGrid>
      </f:facet>

      <h:panelGrid id="ahdrOpenedContentPanel" columns="1" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
      <h:panelGrid border="0" cellpadding="0" cellspacing="0" bgcolor="#efefef" columns="1" id="ahdrContentPanel" styleClass="shrcsAHdrContentPanel" width="864">
      <h:panelGrid columns="4" id="ahdrDetailPanel" border="0" cellpadding="0" cellspacing="0" styleClass="shrcsAHdrDetailPanel">
      <h:outputText value="SOME STUFF"/>

      </h:panelGrid>
      </h:panelGrid>
      </h:panelGrid>
      </h:panelGrid>
      </f:facet>
      </rich:togglePanel>
      </h:panelGrid>
      </f:subview>


      I then use this page fragment in other pages via

      <!-- ACCOUNT HEADER -->

      <jsp:directive.include file="AccountHeaderPanelF.jspf"/>


      This toggle panel works fine if it is not in an f:subview ?

      But the toggleControl can not find the parent.

        • 1. Re: rich:toggleControl javax.faces.FacesException: Parent pa
          ilya_shaikovsky

          sorry but could you pelase at first simplify you code and make it readable by code tags usage.

          • 2. Re: rich:toggleControl javax.faces.FacesException: Parent pa

            Not sure if I can simplify it more than this.

            <div style="-rave-layout: grid;" xmlns:f="http://java.sun.com/jsf/core"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:rich="http://richfaces.ajax4jsf.org/rich"
             xmlns:webuijsf="http://www.sun.com/web/ui">
             <f:subview id="HeaderPanelF">
             <h:panelGrid>
             <h:panelGrid>
             <h:outputText value="Title"/>
             </h:panelGrid>
             <rich:togglePanel id="ahdrTogglePanel"
             switchType="client"
             initialState="closedState"
             stateOrder="closedState,openState">
             <f:facet name="closedState">
             <h:panelGrid>
             <f:facet name="header">
             <h:panelGrid>
             <h:outputText value="CLOSED"/>
             <rich:toggleControl id="toggleControl_openState"
             for="form1:ahdrTogglePanel" >
             <h:graphicImage url="resources/down.gif" />
             </rich:toggleControl>
             </h:panelGrid>
             </f:facet>
             </h:panelGrid>
             </f:facet>
            
             <f:facet name="openState">
             <h:panelGrid>
             <f:facet name="header">
             <h:panelGrid>
             <h:outputText value="OPENED"/>
             <rich:toggleControl id="toggleControl_closeState"
             for="form1:ahdrTogglePanel" >
             <h:graphicImage value="resources/up.gif"/>
             </rich:toggleControl>
             </h:panelGrid>
             </f:facet>
            
             <h:panelGrid>
             <h:panelGrid>
             <h:panelGrid>
             <h:outputText value="SOME STUFF"/>
             </h:panelGrid>
             </h:panelGrid>
             </h:panelGrid>
             </h:panelGrid>
             </f:facet>
             </rich:togglePanel>
             </h:panelGrid>
             </f:subview>
            
            
            I then use this page fragment in other pages via
            
            
            <jsp:directive.include file="HeaderPanelF.jspf"/>
            
            
            This toggle panel works fine if it is not in an f:subview ?
            
            But the toggleControl can not find the parent.