3 Replies Latest reply on Jun 5, 2008 7:55 AM by leandro godoy

    Rich:modalPanel not arrow Bean

    leandro godoy Apprentice

      Hello good afternoon to all, I have the following modalPanel, so that when I press the button it does not save arrow of the properties that were entered in <h:inputText> because it? Follows my code:
      my modalPanel

      
      <rich:modalPanel id="parcelas" width="350" height="100" autosized="true" >
       <f:facet name="header">
       <h:panelGroup>
       <h:outputText value="#{msg.baixarparcela}"></h:outputText>
       </h:panelGroup>
       </f:facet>
       <f:facet name="controls">
       <h:panelGroup>
       <h:graphicImage value="/images/BOTOES/cancel.png"
       style="cursor:pointer" id="hidelink" />
       <rich:componentControl for="parcelas" attachTo="hidelink"
       operation="hide" event="onclick" />
       </h:panelGroup>
       </f:facet>
       <rich:panel id="areaModal" style="width:360px" >
       <center> <h:panelGrid columns="2" width="350">
       <h:outputText value="#{msg.codigo}"></h:outputText>
       <h:inputText value="#{contasreceber.contasreceber.contasreceberid}"
       id="idcr" disabled="true"></h:inputText>
       <h:outputText value="#{msg.valor}"></h:outputText>
       <h:inputText value="#{contasreceber.contasreceber.valor}" id="idv" disabled="true"></h:inputText>
       <h:outputText value="#{msg.valorpago}"></h:outputText>
       <h:inputText value="#{contasreceber.contasreceber.valorpago}" id="valorpg" >
       </h:inputText>
       <h:outputText value="#{msg.datavencimento}"></h:outputText>
       <rich:calendar value="#{contasreceber.contasreceber.datavencimento}" id="datavenc"
       datePattern="dd/MM/yyyy" style=" width : 160px;" disabled="true">
       </rich:calendar>
       <h:outputText value="#{msg.datapagamento}"></h:outputText>
       <rich:calendar value="#{contasreceber.contasreceber.datapagamento}" id="datapag"
       datePattern="dd/MM/yyyy" style=" width : 160px;" >
       </rich:calendar>
       <h:outputText value="#{msg.numerocheque}"></h:outputText>
       <h:inputText value="#{contasreceber.contasreceber.numerocheque}" id="ncheque" ></h:inputText>
       </h:panelGrid> </center> <center>
       <a4j:commandButton action="#{contasreceber.create}" value="#{msg.salvar}"
       oncomplete="javascript:Richfaces.hideModalPanel('frm2:parcelas')" reRender="tbreceber">
       </a4j:commandButton>
       <a4j:commandButton value="#{msg.cancelar}" immediate="true"
       oncomplete="javascript:Richfaces.hideModalPanel('frm2:parcelas')">
       </a4j:commandButton>
       </center>
      
      
       </rich:panel>
       </rich:modalPanel>
      </a4j:form>
      


      see I call to give the modal double click on a line of the table see code:
      <rich:dataTable
       onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
       onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
       cellpadding="0" cellspacing="0" rows="15" width="700" border="0"
       var="cr" value="#{contasreceber.model}" id="tbreceber" style=" width : 736px;" >
       <a4j:support event="onRowDblClick" action="#{contasreceber.editModalPanel}"
       reRender="areaModal" oncomplete="javascript:Richfaces.showModalPanel('frm2:parcelas')" >
       <f:setPropertyActionListener target="#{contasreceber.id}" value="#{cr.contasreceberid}" />
       </a4j:support>
      

      All this working correctly, the only button that does not save arrow figures in the bean, which can be?
      you, hugging.

        • 1. Re: Rich:modalPanel not arrow Bean
          leandro godoy Apprentice

          Have resolved by placing the tag (<a4j:form>) within the modalPanel, but now I'm having a problem saving the button, because it has not been there error messages, and even if there is not he closes the modalPanel, how can resolve this?
          see the code:

          <rich:modalPanel id="parcelas" width="350" height="100" autosized="true" >
           <f:facet name="header">
           <h:panelGroup>
           <h:outputText value="#{msg.baixarparcela}"></h:outputText>
           </h:panelGroup>
           </f:facet>
           <f:facet name="controls">
           <h:panelGroup>
           <h:graphicImage value="/images/BOTOES/cancel.png"
           style="cursor:pointer" id="hidelink" />
           <rich:componentControl for="parcelas" attachTo="hidelink"
           operation="hide" event="onclick" />
           </h:panelGroup>
           </f:facet>
           <a4j:form id="frm2">
           <rich:panel id="areaModal" style="width:360px" >
          
           <a4j:outputPanel ajaxRendered="true">
           <rich:messages id="erro" styleClass="erro" ></rich:messages>
           </a4j:outputPanel>
          
           <center> <h:panelGrid columns="2" width="350">
           <h:outputText value="#{msg.codigo}"></h:outputText>
           <h:inputText value="#{contasreceber.contasreceber.contasreceberid}"
           id="idcr" disabled="true"></h:inputText>
           <h:outputText value="#{msg.valor}"></h:outputText>
           <h:inputText value="#{contasreceber.contasreceber.valor}" id="idv" disabled="true"></h:inputText>
           <h:outputText value="#{msg.valorpago}"></h:outputText>
           <h:inputText value="#{contasreceber.contasreceber.valorpago}" id="valorpg" required="true" >
           </h:inputText>
           <h:outputText value="#{msg.datavencimento}"></h:outputText>
           <rich:calendar value="#{contasreceber.contasreceber.datavencimento}" id="datavenc"
           datePattern="dd/MM/yyyy" style=" width : 160px;" disabled="true">
           </rich:calendar>
           <h:outputText value="#{msg.datapagamento}"></h:outputText>
           <rich:calendar value="#{contasreceber.contasreceber.datapagamento}" id="datapag" required="true"
           datePattern="dd/MM/yyyy" style=" width : 160px;" >
           </rich:calendar>
           <h:outputText value="#{msg.numerocheque}"></h:outputText>
           <h:inputText value="#{contasreceber.contasreceber.numerocheque}" id="ncheque" ></h:inputText>
           </h:panelGrid> </center> <center>
           <a4j:commandButton action="#{contasreceber.create}" value="#{msg.salvar}"
           oncomplete="windowclose();" reRender="frm:tbreceber">
           </a4j:commandButton>
           <a4j:commandButton value="#{msg.cancelar}" reRender="frm:tbreceber" immediate="true"
           oncomplete="javascript:Richfaces.hideModalPanel('parcelas')">
           </a4j:commandButton>
           </center>
          
          
           </rich:panel>
          
          .....
          <script type="text/javascript">
           //<![CDATA[
           function windowclose(){
           if (document.getElementById('frm2:erro')==null){
           Richfaces.hideModalPanel('parcelas');
           };
           };
          //]]>
          
           </script>
          
          


          hugs.

          • 2. Re: Rich:modalPanel not arrow Bean
            Sergey Smirnov Master

            1. modal panel should have its own form
            2. modal panel should not be inside the other form (nested forms are not allowed in JSF)

            P.S. do you see the close < /a4j:form > tag inside the modal panel in your code?

            • 3. Re: Rich:modalPanel not arrow Bean
              leandro godoy Apprentice

              Let me explain what I did, put the modal Panel outside a form, and put a form within the modal panel, but so understood in its previous explanation, I get the form from inside the modal panel and put the entire panel within modal a separate form, in the case in my page I have two form's the same vision, How do I get into the modal form panel on my page that in another form?
              This example above this working but by pressing the button save it saves renders the table but do not close the modal panel.
              Thank you for help, hugs.