2 Replies Latest reply on Aug 28, 2007 12:15 PM by Tim

    js error with togglecontrol in mode client

    liumin hu Master

       

      <rich:togglePanel id="panel"
      
       initialState="panelB" switchType="client"
      
       stateOrder="panelA,panelB,panelC">
      
       <f:facet name="panelA">
      
       panelA
      
       </f:facet>
      
       <f:facet name="panelB">
      
       panelB
      
       </f:facet>
      
       <f:facet name="panelC">
      
       panelC
      
       </f:facet>
      
      </rich:togglePanel>
      
      <rich:toggleControl for="panel" value="Switch"/>
      <rich:toggleControl for="panel" value="panelA " switchToState="panelA" />
      <rich:toggleControl for="panel" value=" panelB" switchToState="panelB" />
      <rich:toggleControl for="panel" value=" panelC " switchToState="panelC" />
      


      the first togglecontrol works, when i click on the others, i got a js error.
      $(element) has no properties


        • 2. Re: js error with togglecontrol in mode client
          Tim Newbie

          Please reopen the JIRA ticket. It didn't get fixed on 3.1.0 RC3. I post comment there.
          I still see problem in 3.1.0RC3. There are 2 problems:
          1/ if stateOrder is not specified, it displays nothing.
          2/ if switchToState is defined, click on link will hide everything.

          <ui:define name="sidebar">
          <h:panelGroup>
          <rich:toggleControl for="application:panel1" value="Show first" switchToState="first"/><br/>
          <rich:toggleControl for="application:panel1" value="Show second" switchToState="second"/><br/>
          <rich:toggleControl for="application:panel1" value="Show third" switchToState="third"/><br/>
          </h:panelGroup>
          </ui:define>
          
          <ui:define name="body">
          <h:form id="application">
           <h:messages globalOnly="true" styleClass="message"/>
          
          <rich:togglePanel id="panel1" switchType="client" initialState="first" stateOrder="first,second,third">
          
           <f:facet name="first">
           <rich:panel>
          
           <f:facet name="header">First!</f:facet>
           First Panel
           </rich:panel>
           </f:facet>
          
           <f:facet name="second">
           <rich:panel>
           <f:facet name="header">Second!</f:facet>
           Second panel
           </rich:panel>
           </f:facet>
          
           <f:facet name="third">
           <rich:panel>
           <f:facet name="header">Third!</f:facet>
           Third panel
           </rich:panel>
           </f:facet>
          
          </rich:togglePanel>
          </h:form>