5 Replies Latest reply on Aug 20, 2007 8:15 AM by akira_ag

    modalPanel in 3.1.0RC2.

      Hi!
      I migrate to 3.1.0 RC2 from 3.0.1, and bump to another problem.
      RichFaces.hideModalPanel is not work in "oncomplete" field for a4j:commandButton. :(
      Can someone to help?

        • 1. Re: modalPanel in 3.1.0RC2.
          ilya_shaikovsky

          a4j:commandButton value="close via ajax" oncomplete="javascript:Richfaces.hideModalPanel('_panel')"


          works fine. check please you JS calling syntax.

          • 2. Re: modalPanel in 3.1.0RC2.

             

            "ilya_shaikovsky" wrote:
            a4j:commandButton value="close via ajax" oncomplete="javascript:Richfaces.hideModalPanel('_panel')"


            works fine. check please you JS calling syntax.


            Hi! Thanks for fast reply.
            I'd try to understand this problem, and seem to found the following behavior.
            If you add for jour a4j:commandButton reRender attribute, and point this to your form with modalPanel, this problems occurs:

             <h:form id="TestForm">
             <a href="javascript: Richfaces.showModalPanel('testDialog',{width:450, top:200});">Show me my panel</a>
             <rich:modalPanel id="testDialog"
             minHeight="150"
             minWidth="300"
             height="140"
             width="300"
             resizeable="false"
             zindex="2000">
             <f:facet name="header">
             <h:outputText value="Are you sure?" />
             </f:facet>
             <a4j:commandButton id="testButton"
             action="#{MyBean.myAction}"
             value="MyAction"
             style="width: 100px;" styleClass="button"
             reRender="TestForm, testButton"
             onclick="this.disabled=true;"
             oncomplete="Richfaces.hideModalPanel('testDialog');">
             </a4j:commandButton>
             </rich:modalPanel>
             </h:form>
            


            • 3. Re: modalPanel in 3.1.0RC2.
              ilya_shaikovsky

              At first - it isn't good to reRender form elements. And even worst thing - to reRender the control that called Ajax function. And you've forgot that the form should be inside but not outside modal panel.

              Please explore the guide and live demo from the beggining.

              • 4. Re: modalPanel in 3.1.0RC2.

                 

                "ilya_shaikovsky" wrote:
                At first - it isn't good to reRender form elements. And even worst thing - to reRender the control that called Ajax function.


                Why not? I think rerendering the form elements haven't any problems. It's needed in someways.


                And you've forgot that the form should be inside but not outside modal panel.
                Please explore the guide and live demo from the beggining.


                I provide only small example for this behavior, and my a real application did have many form controls/elements and modal panel within a page.
                A splitting h:form to a few inconveniently, if uses an including inner-pages (over jsp:directive include).
                It's worked for 3.0.1 version.
                But I think that will able to change rerendering the form elements to the ajax renderable areas.
                Thanks!


                • 5. Re: modalPanel in 3.1.0RC2.

                  I changed the reRender point from h:form to new a4j:outputPanel. All is correct working now. Thanks!