1 Reply Latest reply on Jun 6, 2007 5:54 AM by ilya_shaikovsky

    how to show pop up on pop up with modalPanel

    vh

      I have such a case that I pop up the first modalPanel to let user enter db setting, after they hit OK, I test the setting, if the test fail, I want to pop up a second modalPanel to ask them "testing failed, do you want to save?", if they say "ok", I will save it.

      questions:

      1. Can I show the second modalPanel but still make the first modalPanel visible? Now I see that the first one just disappear.

      2. How do I make the second modalPanel send the data in the first modal panel to my bean. I tried to put the 2 modalPanel into 1 form and it didn't work. If I put them into different form, how can I send all the data to my bean from the second modalPanel?

       <rich:modalPanel id="editVcMp" minHeight="280" minWidth="300"
       height="450" width="400" zindex="2000">
       <f:facet id="modalHeader" name="header">
       <h:outputText id="modalTitle" value="#{bundle.VirtualCenterSettings}" />
       </f:facet>
       <a4j:form id="editVcForm">
       <table>
       <tr>
       <td id="editVcErr">
       <a4j:outputPanel id="errPanel" ajaxRendered="true">
       <h:messages id="error" errorClass="error"></h:messages>
       </a4j:outputPanel>
       </td>
       </tr>
       <tr>
       <td>
       <rich:panel id="basicPanel">
       <table>
       <tr>
       <td><h:outputText id="svrNameLabel" value="#{bundle.ServerAddress}"/></td>
       <td><h:inputText id="svrNameField"
       onkeyup="enableOkBtn();"
       value="#{vcBean.serverName}"/>
       </td>
       </tr>
       <tr>
       <td><h:outputText id="userLabel" value="#{bundle.UserName}"/></td>
       <td><h:inputText id="userField"
       onkeyup="enableOkBtn();"
       value="#{vcBean.userName}" />
       </td>
       </tr>
       <tr>
       <td><h:outputText id="pwLabel" value="#{bundle.PasswordColon}"/></td>
       <td><h:inputSecret id="pwField" redisplay="true"
       onkeyup="enableOkBtn();"
       value="#{vcBean.password}"/>
       </td>
       </tr>
       <tr>
       <td><h:outputText id="descLabel" value="#{bundle.Description}"/></td>
       <td><h:inputText id="descField"
       onkeyup="enableOkBtn();"
       value="#{vcBean.description}" />
       </td>
       </tr>
       <tr>
       <td colspan="2" align="left">
       <h:selectBooleanCheckbox onclick="enableOkBtn();displayPort(this);"
       id="sslCheckbox"
       value="#{vcBean.useSSL}" >
       </h:selectBooleanCheckbox>
       <h:outputText value="#{bundle.useSSL}"/>
       </td>
       </tr>
       <tr>
       <td><h:outputText id="portLabel" value="#{bundle.NonSSLPort}"
       onkeyup="enableOkBtn();"
       style="#{vcBean.portStyle}"/></td>
       <td><h:inputText id="portField" value="#{vcBean.port}"
       onkeyup="enableOkBtn();"
       style="#{vcBean.portStyle}"/></td>
       </tr>
       </table>
       </rich:panel>
       </td>
       </tr>
       <tr>
       <td align="right">
       <div id="advancedLink">
       <h:outputLink value="#"
       onclick="showComponent('advancePanel', true);showComponent('advancedLink', false); showComponent('basicLink', true);return false;">
       <h:outputText value="#{bundle.Advanced}"/>
       </h:outputLink>
       </div>
       </td>
       </tr>
       <tr>
       <td>
       <rich:panel id="advancePanel" style="display:none">
       <table>
       <tr>
       <td colspan="2">
       <h:outputText value="#{bundle.vcAdvSettingDesp}"/>
       </td>
       </tr>
       <tr>
       <td><h:outputText value="#{bundle.vmAddNum}"/></td>
       <td><h:inputText value="#{vcBean.vmAddNum}"
       onkeyup="enableOkBtn();"/>
       </td>
       </tr>
       <tr>
       <td><h:outputText value="#{bundle.vmRemoveNum}"/></td>
       <td><h:inputText value="#{vcBean.vmRemoveNum}"
       onkeyup="enableOkBtn();"/>
       </td>
       </tr>
       </table>
       </rich:panel>
       </td>
       </tr>
       <tr>
       <td align="right">
       <div id="basicLink" style="display:none">
       <h:outputLink value="#" onclick="showComponent('advancePanel', false);showComponent('advancedLink', true); showComponent('basicLink', false);">
       <h:outputText value="#{bundle.Basic}"/>
       </h:outputLink>
       </div>
       </td>
       </tr>
       <tr>
       <td >
       <rich:spacer id="spacer1" height="20px" width="10px"></rich:spacer>
       </td>
       </tr>
       <tr>
       <td align="center">
       <a4j:commandButton id="ok" actionListener="#{vcBean.saveVC}"
       value="#{bundle.OK}"
       oncomplete="closeVcWindow();"
       reRender="vcTable,editVcMp,error" >
       </a4j:commandButton>
       <rich:spacer id="spacer2" height="4px" width="10px"></rich:spacer>
       <a4j:commandButton id="cancel" actionListener="#{vcBean.cancel}"
       oncomplete="Richfaces.hideModalPanel('editVcMp');"
       reRender="editVcErr,editVcMp,error"
       value="#{bundle.Cancel}">
       </a4j:commandButton>
       </td>
       </tr>
       </table>
       <h:inputHidden id="testFlag" value="#{vcBean.testFlag}"/>
       <h:inputHidden id="editVcIdHidden" value="#{vcBean.editVcId}"/>
       </a4j:form>
       </rich:modalPanel>
      
       <rich:modalPanel id="confirmVcMp" minHeight="100" minWidth="100"
       height="100" width="200" zindex="2000">
       <form>
       <table>
       <tr><td><h:outputText value="#{bundle.confirmVC}"/></td></tr>
       <tr>
       <td align="center">
       <a4j:commandButton actionListener="#{vcBean.saveVC}"
       value="#{bundle.OK}"
       onclick="document.editVcForm.submit();"
       oncomplete="Richfaces.hideModalPanel('confirmVcMp');closeWindow('editVcForm:errPanel','editVcMp');"
       reRender="vcTable,editVcMp,error" >
       </a4j:commandButton>
       <rich:spacer height="4px" width="10px"></rich:spacer>
       <a4j:commandButton action="cancelConfirm"
       onclick="Richfaces.hideModalPanel('confirmVcMp');Richfaces.showModalPanel('editVcMp'); return false;"
       value="#{bundle.Cancel}">
       </a4j:commandButton>
       </td>
       </tr>
       </table>
       </form>
       </rich:modalPanel>