4 Replies Latest reply on Nov 13, 2011 4:43 AM by Christian Peter

    form inside popup dialog

    mani v Newbie



      i need help for PopUp Dialog. I found out that Popup dialog will not support ie 6. so i have used jquery's dialog and its working fine.


      but my data in the Dialog is not submit to the server.


      my question is when i use <a4j:commandButton> inside popup its working fine but the data in the region is not submited to the server.


      all the data is coming as null.  only getter's are called not the setter .


      how to solve this problem ?

        • 1. Re: form inside popup dialog
          Akaine Harga Novice

          What's your RF version?


          1. Normally a popup element should be set on the same level as the forms are to avoid submitting problems.

          2. To make a button call for some action or/and submit some data it has to be inside a form. So the standard approach would be to have a popup element under a view level and a separate form inside the popup.


          For more detailed analisis please submit some code.


          Btw the popup or modal is working just fine in IE6.

          1 of 1 people found this helpful
          • 2. Re: form inside popup dialog
            mani v Newbie

            sorry for late reply,I am using Richfaces 4.

            • 3. Re: form inside popup dialog
              Mahesh Bonagiri Newbie

              here is the sample code to run for

              <rich:modalPanel id="newForm" resizeable="false" height="240"

                   <f:facet name="header">
                    <h:panelGroup layout="block">
                     <h:outputText value="#{msg['sds.fb.formDetails']}" />
                   <f:facet name="controls">
                     <h:graphicImage value="/images/ico_close.gif"
                      title="#{msg['sds.fb.tooltip.close']}" styleClass="hidelink"
                      id="hidelink" />
                     <rich:componentControl for="newFormDetails" attachTo="hidelink"
                      operation="hide" event="onclick" />

                   <rich:spacer height="25"></rich:spacer>
                   <a4j:form id="newForm">
                    <h:panelGrid columns="3">
                     <h:outputLabel value="#{msg['sds.fb.formname']}"
                      style="font:bold;" />
                     <h:outputLabel value=":" style="font:bold;" />
                     <h:inputText value="#{bean.formName}" maxlength="14"
                      required="true" id="formName">
                      <f:attribute name="regularExpression"
                       value="[a-zA-Z]{1}[a-zA-Z0-9_]*" />
                      <f:attribute name="errorMessageCode"
                       value="should start with capital letter and contain only numbers and letters" />
                    <h:panelGrid columns="2" style="float:right;">
                     <a4j:commandButton value="#{msg['sds.fb.save']}"
                      title="#{msg['sds.fb.save']}" styleClass="submitButton"
                      style="float:right;" action="#{bean.newForm}"></a4j:commandButton>
                     <a4j:commandButton value="#{msg['sds.fb.cancel']}"
                      title="#{msg['sds.fb.cancel']}" styleClass="submitButton"
                      style="float:right;" immediate="true"

              • 4. Re: form inside popup dialog
                Christian Peter Expert

                The jQuery UI Dialog moves the popup Html to the body of the DOM. Therefore it needs its own form inside the panel. But there are other ways to prevent this behaviour: you could attach the jQuery UI dialog back to its old parent. Then the surrounding form should work.


                Since you really want to use IE 6, you have to let the dialog be moved to the body. So you should try the approach above this post but modify it for richfaces 4.