1 Reply Latest reply on Jun 28, 2012 1:58 AM by Marc Schmucki

    Toogle Panel / ui:composite / ClassCastException

    Francisco Philip Newbie

      Hi,

      I have a problems with Toogle Panel. The problems is a ClassCastException when I use a composite tag, because the TooglePanelItem cast a parent as a AbstractTogglePanel.....

       

      any idea?



      java.lang.ClassCastException: javax.faces.component.UINamingContainer cannot be cast to org.richfaces.component.AbstractTogglePanel
           org.richfaces.component.AbstractTogglePanelItem.getParent(AbstractTogglePanelItem.java:56)
           org.richfaces.component.AbstractTogglePanelItem.getParent(AbstractTogglePanelItem.java:39)
           javax.faces.component.UIComponentBase.eraseParent(UIComponentBase.java:494)
      

      @Override

          public AbstractTogglePanel getParent() {

              return (AbstractTogglePanel) super.getParent();

          }

       

      tab-form.xhtml

       

      <h:form>

                           <my-composite:tabPanel switchType="client" id="test">

                              <my-composite:tab >

                                     fields of form

                                </my-composite:tab>

                           </my-composite:tabPanel>

       

                       </h:form>

                  </div>

       

       

      tabPanel.xhtml

       

          <composite:interface name="tabPanel">

       

              <composite:attribute name="id" required="false" type="String" />

              <composite:attribute name="switchType" required="false" type="String" default="client"/>

       

          </composite:interface>

          <composite:implementation>

              <ui:fragment>

       

                  <rich:togglePanel id="#{cc.attrs.id}" switchType="#{cc.attrs.switchType}">

                      <composite:insertChildren/>

                  </rich:togglePanel>

              </ui:fragment>

          </composite:implementation>

       

       

       

       

      tab.xhtml

       

       

          <composite:interface name="tab">

       

              <composite:attribute name="label" required="true" type="String" />

       

          </composite:interface>

              <composite:implementation>

              <rich:togglePanelItem label="#{cc.attrs.label}">

                  <composite:insertChildren/>

              </rich:togglePanelItem>

       

          </composite:implementation>