9 Replies Latest reply on Mar 14, 2017 6:32 AM by softweblab

    Refresh after close modal dialog

    abreuretto

      APEX 5.1

       

      I have two regions with a button each (see image). Each button redirects to a modal dialog (see image). When user close dialog through the X button only the first region refresh using dynamic actions. The second region does not refresh. Both have dynamic actions.

       

      Dynamic Action (Region 1)

       

      Event: Get Focus(Close dialog dosent work)

      Selection type: Button

      Button: Add1

      Condition: No condition

       

      Action: refresh

      Selection type: Region

      Region 1

       

      Dynamic Action (Region 2)

       

      Event: Get Focus(Close dialog dosent work)

      Selection type: Button

      Button: Add2

      Condition: No condition

       

      Action: refresh

      Selection type: Region

      Region 2

       

       

       

      reload01.jpg

       

      reload02.jpg

       

      Can someone help me please?

       

      Thanks a lot!

        • 1. Re: Refresh after close modal dialog
          Zapp_Brannigan

          Hi,

           

          You could give static ids to both the regions and make the event scope dynamic instead of static and under jQuery selector in selection inside action, select both the region. and then you need only one DA.

           

          Regards,

          Zapp

          • 2. Re: Refresh after close modal dialog
            abreuretto

            Hi  Zapp

             

            I give Static IDs to boths  and I created one dynamic action like this:

             

            name: myDA

            Event: Dialog Close
            Selection Type:???????? (items, button, region, jquery selector, jsexpression)


            action: rrefresh
            Selection Type: jquery selector

            Affected Elements: #REGION1,#REGION2  (Statics Ids of regions)

             

             

            I dont know what Selection Type i must choose     (Selection Type:???????? (items, button, region, jquery selector, jsexpression)

             

             

            Can you help me please?

             

            Thanks

            • 3. Re: Refresh after close modal dialog
              Pavel_p

              Hi,

              I think just to create the second consecutive True Action that refreshes the other region should work. May I just ask why do you want to refresh regions on dialog close? Do you expect any data changes or what is the idea behind refreshing regions if nothing had changed?

              Thank you,

              Pavel

              • 4. Re: Refresh after close modal dialog
                jwellsnh

                Install and take a look at the Sample Dialog - Packaged Application.  In that example, the Event, Dialog Closed, executes Javascript where #department_report references the static id assigned to the region to be refreshed

                 

                var $ = apex.jQuery;
                if ( this.data.successMessage ) {
                    // use new API to show the success message if any that came from the dialog
                    apex.message.showPageSuccess(this.data.successMessage.text);
                }
                // Refresh the report region
                $("#department_report").trigger("apexrefresh");
                

                 

                Jeff

                • 5. Re: Refresh after close modal dialog
                  abreuretto

                  Hi  Pavel

                   

                  Yes I expect data will changed after close "X" button on Modal Dialog.

                   

                  In dynamics action I can not get the dialog close event. I tried everything and nothing worked. I can not seem to make the page refresh after close("X" button)  modal dialog.

                   

                  I read several articles and none of them worked. I need someone to help me by showing me how to refresh the main page after closing the modal dialog.

                   

                  I give Static IDs to boths  and I created one dynamic action like this:

                   

                  name: myDA

                  Event: Dialog Close
                  Selection Type:???????? (items, button, region, jquery selector, jsexpression)


                  action: rrefresh
                  Selection Type: jquery selector

                  Affected Elements: #REGION1,#REGION2  (Statics Ids of regions)

                   

                   

                  I dont know what Selection Type i must choose     (Selection Type:???????? (items, button, region, jquery selector, jsexpression)

                   

                   

                  Can you help me please?

                   

                   

                  • 6. Re: Refresh after close modal dialog
                    Pavel_p

                    Hi,

                    it looks like this how to trigger DA when user clicks a standard close window button is exactly what you are looking for.

                    Regards,

                    Pavel

                    • 7. Re: Refresh after close modal dialog
                      Zapp_Brannigan

                      Hi,

                      I read the link to trigger the custom event to close the dialog. The Idea is to bind DOM.

                       

                      To take it for a thought, hide the modal close button with css and then put another button called close so you can handle the changes easily other than refreshing even when user closes through 'X' button.Also you can then also control  the user flow.

                       

                      Regards,

                      Zapp

                      • 8. Re: Refresh after close modal dialog
                        abreuretto

                        The correct awnser is:

                         

                        put in attribute page of Modal Dialog this: open:function(event,ui){parent.$('.ui-button.ui-widget.ui-state-default.ui-corner-all.ui-button-icon-only.ui-dialog-titlebar-close').hide();}

                         

                         

                        • 9. Re: Refresh after close modal dialog
                          softweblab

                          'Pavel_p'

                          I have seen your previous solution https://apex.oracle.com/pls/apex/f?p=72834:2 (Modal dialog closed and list item auto set created value)

                          I have a same issue but i did not solve it.

                          Please explain details or give me backend access.

                           

                          Regards...

                          Firoz