3 Replies Latest reply on Nov 6, 2008 5:47 AM by choesang tenzin

    Problem with modalPanel wizard

    Pedro Ribeiro Newbie

      Hi! I've started studying RichFaces a couple of weeks ago, so I'm not really good at it yet. I was hoping if some of you could help me with this question.

      I'm trying to build a wizard, like in the examples, but using modelPanel. This wizard has three different pages, and is called from inside a dataTable, used to edit user's accounts.

      The first time I run it is everything nice, but on the second time, the modelpanel shows the last page. And I expected that it would show the first, in order to start over the process of editing an account.

      I searched some solutions for this problem here, but I found it difficult to understand and I couldn't reproduce it here (maybe couse I'm a newbie =/). I would really be thankful if someone could help me.

      Here is a piece of my code:

      - modelPanel call

      <a4j:commandLink action="#{accountController.setAccountRow}" id="delete" oncomplete="javascript:Richfaces.showModalPanel('deletepanel')" reRender="deleteForm">
       <h:graphicImage id="imagedel"

      - modelPanel code

      <rich:modalPanel id="editpanel" height="546" width="450" headerClass="title" style="border: 1; border-color:#888888">
       <f:facet name="header">
       <h:panelGroup styleClass="title">
       <h:graphicImage value="images/window_title_create_user.gif" styleClass="img"/>
       <f:facet name="controls">
       <h:panelGroup styleClass="close">
       <h:graphicImage value="images/window_button_close.gif" styleClass="close" id="hideedit" />
       <rich:componentControl for="editpanel" attachTo="hideedit" operation="hide" event="onclick" />
       <h:form id="editForm">
       <a4j:include viewId="/edit_acc_data.jsp"/>

      Please, tell me if i didn't make myself clear. Thank you all =]


        • 1. Re: Problem with modalPanel wizard
          choesang tenzin Newbie

          I am facing exactly the same problem. It would be great, if somebody could give a hint on where the mistake could be.


          • 2. Re: Problem with modalPanel wizard
            Nick Belaevski Master


            Try to

            1. Bind viewId to model bean property:

            <a4j:include viewId="#{bean.property}"/>

            2. Reset bean.property to initial value by command link action activation.

            • 3. Re: Problem with modalPanel wizard
              choesang tenzin Newbie

              Hi Nick, Thanks alot for your help. It worked beautifully. I am posting my code here for those who are interested.


              <h:outputLink value="#" onclick="Richfaces.showModalPanel('mpWizard');">showWizard</h:outputLink>
              <rich:modalPanel id="mpWizard" width="600" height="300" zindex="2000"
               resizeable="false" moveable="true">
               <f:facet name="header">Titel des Popups</f:facet>
               <f:facet name="controls">
               <h:graphicImage value="/images/close.png"
               onclick="Richfaces.hideModalPanel('mpWizard')" />
               <h:panelGroup id="wizardPanelGroup">
               <a4j:include viewId="#{wizardBean.viewId}" />


               <h:outputText value="Go to the step 2"/>
               <a4j:commandButton value="next" action="gonext" reRender="wizardPanelGroup"/>


               <h:outputText value="Close window"/>
               <h:commandButton type="button" value="Close" onclick="Richfaces.hideModalPanel('mpWizard')"/>


              public class WizardBean {
               private String viewId="/wizard/step1.xhtml";
               * @return the viewId
               public String getViewId() {
               return viewId;
               * @param viewId the viewId to set
               public void setViewId(String viewId) {
               this.viewId = viewId;