2 Replies Latest reply on Jun 16, 2011 1:37 PM by Pramod Chavan

    modalPanel + hideModalPanel

    sv kap Newbie

      Hi.

       

      I have a problem with the JSF 2 implementation of RichFaces (CR1). I have  modal dialog with a form. The form is submitted through a a4j:commandButton. I have oncomplete="javascript:Richfaces.hideModalPanel('pnlPop');". The problem is that even when the form validation fails the modal dialog is closed. With jsf 1.2 and version 3.3.2 the dialog was not closed on errors. Am I doing something wrong?

        • 1. Re: modalPanel + hideModalPanel
          Ilya Shaikovsky Master

          if you really using only

          oncomplete="javascript:Richfaces.hideModalPanel('pnlPop');"

          it should be cosed even if there were errors.

           

          If you want to prevent closure you should use something like used at rf-demo:

           

          <a4j:commandButton value="Store"
               action="#{dataTableScrollerBean.store}"
               reRender="make, model, price"
                oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('editPanel')}.hide();" />
          • 2. Re: modalPanel + hideModalPanel
            Pramod Chavan Newbie

            Hi IIya,

             

            I tried your solution but is still closing the modal dialog.

             

            Let me explain what I have done,

            I am using RichFaces 3.3.3 and JSF2 in my app.

             

            In modal dialog I have input field(marked as required), when i click on <a4j:commandButton> submit button, even though I have

            empty text fields the modal dialog is getting closed, which should not be the case. The above solution you mentioned is not working.

             

            Please advise me if I am missing something!

             

            --Pramod