3 Replies Latest reply on Sep 11, 2011 6:38 PM by adrian wiktor

    togglePanel problem

    adrian wiktor Newbie

      hi, I have togglePanel like this one:

       

                <h:form>

                          <rich:togglePanel id="registration" switchType="ajax">

                              <rich:togglePanelItem id="register-1">

                                  <ui:include src="/views/register-1.xhtml" />

       

                              </rich:togglePanelItem>

                              <rich:togglePanelItem id="register-2" >

                                  <ui:include src="/views/register-2.xhtml" />

                              </rich:togglePanelItem>

                              <rich:togglePanelItem id="register-3" >

                                  <ui:include src="/views/register-3.xhtml" />

                              </rich:togglePanelItem>

                              <rich:togglePanelItem id="register-4" >

                                  <ui:include src="/views/register-4.xhtml" />

                              </rich:togglePanelItem>

                          </rich:togglePanel>

                      </h:form>

       

      it is in file register.xhtml. 

       

      now I have another page : bussinesOwner.xhtml where I want to add links which will redirect user for every registration step. 

      How can I achive that ?

      I tried ex.

       

      <h:commandLink value="#{msgBundle['businessOwner.options.edit']}" styleClass="item-1">

                             <rich:toggleControl for="register-1" targetItem="register-1"/>

                        </h:commandLink>

       

      but getting this error:  javax.faces.FacesException: Parent panel for control (id=j_idt156:j_idt159) has not been found.

       

      I've also tried an example code from richfaces manual :

      http://docs.jboss.org/richfaces/4.0.X/4.0.0.Milestone4/Component_Reference/en-US/html/chap-Component_Reference-Panels_and_containers.html#sect-Component_Reference-richtoggleControl-Specifying_the_next_state

       

      when I copied and pasted this code snipet into blank form.  I have the same error.  Does someone know how to solved this?

        • 1. Re: togglePanel problem
          iabughosh Master

          hi Adrian,

          could you try this :

          <rich:togglePanel id="registration" switchType="ajax">

                                  <rich:togglePanelItem id="register-1"

                                                                   name="register-1">

                                      <ui:include src="/views/register-1.xhtml" />

           

                                  </rich:togglePanelItem

          </rich:togglePanel>

           

          and your button

          <h:commandLink value="#{msgBundle['businessOwner.options.edit']}" styleClass="item-1">

                                 <rich:toggleControl targetPanel="registration" targetItem="register-1"/>

                            </h:commandLink>

           

          if this is not working please post your full xhtml page.

           

          regards.

          • 2. Re: togglePanel problem
            adrian wiktor Newbie

            hi this works but only if commandLinks are outside togglePanel  on the same page. 

            I need to access certain steps of togglePanel from another page. Is it doable ? or I just need to create 4 different pages ? 

             

            my register.xhtml looks like:

             

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

             

             

            <ui:composition xmlns="http://www.w3.org/1999/xhtml"

               xmlns:ui="http://java.sun.com/jsf/facelets"

               xmlns:rich="http://richfaces.org/rich"

               xmlns:h="http://java.sun.com/jsf/html"

               xmlns:f="http://java.sun.com/jsf/core"

               template="/views/layouts/master-layout.xhtml">

               

               

              

               

                <ui:define name="header">

                    <ui:include src="/views/header.xhtml">

                        <ui:param name="selected" value="register" />

                    </ui:include>

                </ui:define>

             

               

                <ui:define name="body">

               

                <script type="text/javascript" src="js/register-page-script.js"></script>

               

                    <div class="register-page">

                            <h:form id="registrationForm">

                                <rich:togglePanel id="registration" switchType="ajax">

                                    <rich:togglePanelItem id="register-1" name="register-1">

                                        <ui:include src="/views/register-1.xhtml" />

                                    </rich:togglePanelItem>

                                    <rich:togglePanelItem id="register-2" name="register-2">

                                        <ui:include src="/views/register-2.xhtml" />

                                    </rich:togglePanelItem>

                                    <rich:togglePanelItem id="register-3" name="register-3">

                                        <ui:include src="/views/register-3.xhtml" />

                                    </rich:togglePanelItem>

                                    <rich:togglePanelItem id="register-4" name="register-4">

                                        <ui:include src="/views/register-4.xhtml" />

                                    </rich:togglePanelItem>

                                </rich:togglePanel>

                            </h:form>

                              

                    </div>   

                </ui:define>

               

                <ui:define name="footer">

                    <ui:include src="/views/footer.xhtml"/>

                </ui:define>

               

               

            </ui:composition>

             

             

            page from which I would like to access certain steps from registration page:

             

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

            <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"

                xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"

                xmlns:rich="http://richfaces.org/rich"

                xmlns:c="http://java.sun.com/jsp/jstl/core">

             

             

            <div class="owner-page">

               

                <div class="container_12">

                    <div class="grid_10 push_1">

                        <p class="links">

                       

                       

                        <h:form>

                       

                            <h:commandLink value="#{msgBundle['businessOwner.options.edit']}" styleClass="item-1">

                                   <rich:toggleControl targetPanel="registration" targetItem="register-1"/>

                              </h:commandLink>

                              <h:commandLink value="#{msgBundle['businessOwner.options.editSchool']}" styleClass="item-2">

                                   <rich:toggleControl targetPanel="registration" targetItem="register-2"/>

                              </h:commandLink>

                              <h:commandLink value="#{msgBundle['businessOwner.options.editCourses']}" styleClass="item-3">

                                   <rich:toggleControl targetPanel="registration" targetItem="register-3"/>

                              </h:commandLink>

                              <h:commandLink value="#{msgBundle['businessOwner.options.editCoupons']}" styleClass="item-3">

                                   <rich:toggleControl targetPanel="registration" targetItem="register-4"/>

                              </h:commandLink>

                              

                         </h:form>

                           

                                <h:link styleClass="item-1" value="#{msgBundle['businessOwner.options.edit']}" outcome="register"/>

                              

                        </p>

                       

                        <h2>

                            <h:outputText value="#{msgBundle['businessOwner.panel.report']}"/>

                        </h2>

                       

                        <h:form>

                            //page content

                        </h:form>

                       

                        <h2>

                            <h:outputText value="#{msgBundle['businessOwner.panel.reportHistory']}" />

                        </h2>

                        <h:form>

                          //other irrelevant page content

                        </h:form>

                    </div>

                    <div class="grid_3">

                    </div>

                    <div class="clear"></div>

                </div>

            </div>

             

             

            </ui:composition>

            • 3. Re: togglePanel problem
              adrian wiktor Newbie

              anybody, is it possible to achive this scenario?  I really do not want to create 4 seperate pages.