5 Replies Latest reply on Sep 17, 2008 3:32 PM by Daniel Ray

    rich:modalPanel doesn't updated

    Konstantin Kozak Newbie

      i have next code:

      <a4j:commandButton value="make service"
       onclick="Richfaces.showModalPanel('createService',{width:325, height:400})"/>
      
      <rich:modalPanel id="createService" onshow="renderService()">
       <a4j:jsFunction name="renderService" reRender="createService"
       action="#{biller_service.cleanBillerFields}"/>
      
      .... different input fields
      
      </rich:modalPanel>
      
      


      ModalPanel saves all data which are entered into input fields. Even if I press cancel and close panel without sending any data. How make that before every showing of modalPanel it get data from backing bean?

      i tried keepVisualState = "false", but it doesn't help

        • 1. Re: rich:modalPanel doesn't updated
          Sergey Smirnov Master

          In your case:
          a) modal Panel must have its own h:form
          b) modal Panel must not be inside the other h:form

          • 2. Re: rich:modalPanel doesn't updated
            Konstantin Kozak Newbie

            This modal panel has it's own h:form. And it not it other h:form.

            All my buttons inside form works, all works, service is created threw it, but... Modal Panel saves it's own state after hiding. And I Want that panel get data from backing bean before every showing. Or how to implement creating new modal form before showing?

            • 3. Re: rich:modalPanel doesn't updated
              Ilya Shaikovsky Master

              use reREnder on commandLink pointed to the content of the modal panel which is need to be updated. And use JS call not on onclick but on oncomplete. Then you can remove jsFunction.

              modal panel isn't get anything from server after first time initalize except it was reRendered via external controls..

              • 4. Re: rich:modalPanel doesn't updated
                Daniel Ray Newbie

                Running in to the same issue. I'm using 3.1.1 and have tried it with 3.1.6.

                The data in the bean is reset, but I am unable to rerender the content of the modalPanel. What did I miss? I have tried this with rerender as newAddressModalPanel and newAddressForm to no avail. Here's the test code.

                <a4j:commandLink action="#{addressHandler.showNewAddressModalPanel}" reRender="newAddressDiv"
                 oncomplete="Richfaces.showModalPanel('newAddressModalPanel')"
                 value="Add" />
                
                
                
                <rich:modalPanel id="newAddressModalPanel" height="250" width="600"
                 minHeight="250" minWidth="500" keepVisualState="false">
                
                 <f:facet name="header">
                 <t:outputText value="New Address" />
                 </f:facet>
                
                 <a4j:form id="newAddressForm" ajaxSubmit="true">
                 <a4j:outputPanel id="newAddressPanel" ajaxRendered="true">
                 <t:div id="newAddressDiv" forceId="true">
                
                 ... several input fields
                
                 </t:div>
                 </a4j:outputPanel>
                 </a4j:form>
                </rich:modalPanel>
                
                


                • 5. Re: rich:modalPanel doesn't updated
                  Daniel Ray Newbie

                  Found the problem. It had nothing to do with the modalPanel (suprise). My close button had immediate="true". Removing this attribute fixed my issue.