0 Replies Latest reply on Jun 17, 2008 7:24 AM by leandro godoy

    Problems with modal Panel

    leandro godoy Apprentice

      How to close a modal if there is no error messages on inside it? Because I have a screen that has multiple applications only when I ModalPanel the display, and has error messages on the hour to save it closes anyway, see my code :

      
      
       <rich:modalPanel id="loadCliente" autosized="true" top="10" left="100">
       <f:facet name="header">
       <h:outputLabel value="#{msg.cadastrarcliente}"/>
       </f:facet>
       <f:facet name="controls">
       <h:graphicImage value="/images/BOTOES/cancel.png" width="20" height="20"styleClass="imagem"
       style="cursor:pointer" onclick="Richfaces.hideModalPanel('loadCliente')" />
       </f:facet>
       <center>
       <c:import url="/view/cliente/modal.jsp"></c:import>
       </center>
      </rich:modalPanel>
      
      
      
      
      <a4j:region renderRegionOnly="true">
      <rich:modalPanel id="loadForma" autosized="true" >
       <f:facet name="header">
       <h:outputLabel value="#{msg.produto}"/>
       </f:facet>
       <f:facet name="controls">
       <h:graphicImage value="/images/BOTOES/cancel.png" width="20" height="20"styleClass="imagem"
       style="cursor:pointer" onclick="Richfaces.hideModalPanel('loadProduto')" />
       </f:facet>
       <center>
       <c:import url="/view/forma/modal.jsp"></c:import>
       </center>
      </rich:modalPanel>
      </a4j:region>
      
      <script type="text/javascript">
       function windowcloseCliente(){
       if (document.getElementById('erroCliente')==null){
       javascript:Richfaces.hideModalPanel('loadCliente');
       };
      
       };
      
       function windowcloseForma(){
       if (document.getElementById('formaModal:erroForma')==null){
       javascript:Richfaces.hideModalPanel('loadForma');
       };
      
       };
      
      
       function windowcloseCidade(){
       if (document.getElementById('erroCidade')==null){
       javascript:Richfaces.hideModalPanel('loadCidade');
       };
      
       };
      
       function windowcloseEstado(){
       if (document.getElementById('erroEstado')==null){
       javascript:Richfaces.hideModalPanel('loadEstado');
       };
      
       };
      
      



      This is a ModalPanel for display messages from home:


      <rich:modalPanel id="error" autosized="true"
       showWhenRendered="#{facesContext.maximumSeverity !=null}">
       <f:facet name="header">
       <h:outputText value="#{msg.erros}"></h:outputText>
       </f:facet>
       <f:facet name="controls">
       <h:graphicImage value="/images/BOTOES/cancel.png" width="20"
       height="20" styleClass="imagem" style="cursor:pointer"
       onclick="Richfaces.hideModalPanel('error')" />
       </f:facet>
       <table class="blank" style="font-size: 10pt; white-space: nowrap">
       <nobr> <rich:messages showDetail="true" showSummary="true">
       <f:facet name="errorMarker">
       <h:graphicImage value="/images/requirid.png" width="20" height="20"
       styleClass="imagem" />
       </f:facet>
       <f:facet name="warnMarker">
       <h:graphicImage value="/images/info.png" width="20" height="20"
       styleClass="imagem" />
       </f:facet>
       <f:facet name="infoMarker">
       <h:graphicImage value="/images/accept.png" width="20" height="20"
       styleClass="imagem" />
       </f:facet>
       </rich:messages> </nobr>
       </table>
       </rich:modalPanel>
      
      


      The modal panel displays messages but closed soon after, as I do not close it?
      you, hugging