Skip to Main Content
Feature Request FR-1725
Product Area Application Builder
Status ROADMAP

71 Voters

Make base page refresh handling easier on modal dialogue close

sharad.kalyani Internal
· Aug 19 2021

Idea Summary
It is bit cumbersome to refresh the base page when modal pop up is closed. Have to do some coding which may not be reliable

Use Case
> Changes in modal page need to reflect base page on close. End users get confused if their operation on modal page went thru or not.

Preferred Solution (Optional)
> A dynamic action, process or simple check box on modal page

This is currently on the roadmap for a future release of Oracle APEX.

Comments

Comments

  • ashok lokhande OP 3.9 years ago

    Much Needed….

  • john.snyders APEX Team OP 3.9 years ago

    Making refresh of regions when a dialog closes more declarative is a good idea but it must be declared on the “call” to the dialog (or on the regions to refresh) and not on the modal page.

  • gabriel.diaz.arias OP 3.8 years ago

    Yes, also include in this the fact that is difficult to refresh the parent page when you use the upper right X button, as it is detected as a cancel event, not a close event, and then you have to do some “hacking” to emit the event to the parent page iframe.

  • ino.laurensse OP 3.7 years ago

    For this to work if the parent is a form, the form region should also support Refresh Region. See also:

    https://apexapps.oracle.com/pls/apex/apex_pm/r/ideas/details?idea=FR-2117

  • chris.shannon OP 3.7 years ago

    Yes please. Such a common requirement.

  • plattbehrens-2 OP 3.7 years ago

    Definitely a good suggestion

  • fac586 OP 3.6 years ago

    What exactly is considered complicated about Dialog Closed dynamic actions?

  • jayson hanes Admin OP 3.6 years ago

    Sharad can you outline a more complete suggestion of what you'd like to see happen here? A demo application on apex.oracle.com showing a page and functionality where you'd like to see it made easier  (to achieve) would be helpful.

  • sharad.kalyani OP 3.4 years ago

    Use Case: Consider a simple application to record payment information at a clinic or store. Customers can pay the total amount in multiple modes. I.e. Cash, Card or Digital payment. E.g. $200 paid like $100 Cash and $100 with a Card. So a model page is designed to capture Payments as shown in screenshot.

    The expectation is to refresh the base page as soon as submit button is pressed on the model page so that the main page shows the total money paid by the customer. Becomes an issue if the operator forgets to refresh the main page before capturing the next mode of payment

    Many such use cases will become smooth with this feature.

    A lot of effort needs to implement this currently. A simple page process or any other method to enable base page refresh on button action on the modal page will help. 

  • fac586 OP 3.4 years ago

    The expectation is to refresh the base page as soon as submit button is pressed on the model page so that the main page shows the total money paid by the customer. Becomes an issue if the operator forgets to refresh the main page before capturing the next mode of payment

    A lot of effort needs to implement this currently. A simple page process or any other method to enable base page refresh on button action on the modal page will help.

    This can be achieved now using a Close Dialog process on the modal page, and a Dialog Closed dynamic action with Set Value (Total Payment item) and Refresh (payments report) steps. That is not “a lot of effort” in my opinion, and it is difficult to see how it could be made any simpler or automated given the infinite number of potential actions that could be triggered on closing a dialog page.

    Supporting Refresh actions on Form regions (FR-2117) and non-cascading LOV page items (e.g. those based on a SQL Query source) would be welcome, but since these would be useful in many ways they are not dependent on enhancement of dialog closure.

  • sharad.kalyani OP 3.4 years ago

    We did try these options but had tough time. its not consistant or robust enough. Especially when processes have to act across pages. Will be happy to see if you can suggest robust and simple solution in current version with minimal coding or external plug-ins.

  • fac586 OP 3.4 years ago

    We did try these options but had tough time. its not consistant or robust enough.

    You'll have to explain those issues in detail.

    Especially when processes have to act across pages.

    That sounds like a design issue as the standard APEX processing model definitely doesn't involve "processes acting across pages".

    Suggest you start a thread in APEX Discussions to discuss this.

  • patrick wolf Admin OP 2.6 years ago

    As an alternative, instead of using the Close Dialog process in the modal dialog, someone can also delete it and use a regular Branch to navigate to the same/different page which would re-render that specified page.

  • fac586 OP 2.6 years ago

    As an alternative, instead of using the Close Dialog process in the modal dialog, someone can also delete it and use a regular Branch to navigate to the same/different page which would re-render that specified page.

    I think that would only muddy the waters regarding modal dialog pages and branches.

    I'm still not seeing anything indicating that improvements are required here. The OP has not revealed why they had a “tough time”—I certainly see no need for any coding or external plug-ins in the use case described.

    That said, 50 people have voted for this, so there is some kind of perceived need. It would be helpful if they contributed further use cases.

  • gabriel.diaz.arias OP 2.6 years ago

    Modal dialogs could refresh all refreshable regions or items in the parent page automatically on cancel/close by default, and only refresh specific ones when requested for avoiding unneeded network requests if developer wants to optimize it specificakly. Similar behaviour would be nice when the user leaves the web browser window, and returns after several time.

  • jkerr2 OP 2.6 years ago

    the two cases where I find limiting refresh to a region or causing a refresh are: 1.) Return from modal dialog to an Interactive Grid on the calling page and refresh the IG, and 2.) when user clicks the X to cancel the dialog and try to capture that to likewise refresh the Interactive Grid on the calling page.

  • paulo künzel OP 2.3 years ago

    This issue seems a bit odd, please correct me if I'm wrong, but would the DA that fires when the dialog closes do that? 

    I'm not a big fan of branches (not saying I don't use them) when I need only a partial refresh on the base page and I use that Dynamic Action quite often without any issues.

  • gabriel.diaz.arias OP 2.3 years ago

    In latest versions of apex there is a new on closed or cancelled event, so for my team it is more than enough.

  • tdoberman OP 2.3 years ago

    @gabriel.diaz.arias yes the "or cancel" option is complementary to what was missing.

  • gabriel.diaz.arias OP 2.3 years ago

    It would be nice having a declarative  way to refresh all refreshable regions or items at once without needing to specify them one by one. As the idea mentions, having a checkbox “partial parent page refesh" in the “close modal dialog” process would be enough. This is quite a common and repetitive pattern that can be improved. If apex ends dealing with an SPA model it would have to deal with things like this.

  • fac586 OP 2.3 years ago

    It would be nice having a declarative  way to refresh all refreshable regions or items at once without needing to specify them one by one.

    It's easy to do this already. Add a class name to the relevant components and use it as a jQuery selector in the Refresh DA.

  • tdoberman OP 2.3 years ago

    @fac586 I guess we all want it to be low-code? The class may not be a big code, but you can forget when adding a new region after 5 years....

  • gabriel.diaz.arias OP 2.3 years ago

    Yes, you can assign an id and do it by a jQuery selector. But again, kind of repetitive for a very common pattern. You just want to refresh all the info on the previous page without having to specify everything one by one.

  • paulo künzel OP 2.3 years ago

    Hello everyone

    Just remembering that we can add an action to button called “dialog closed” that works low code and can be applied to any component in the page, even custom html components. Which yes, are a bit trickier to do the binding, but that is because they are custom components and as such are not encapsulated in the low code functionalities

    It seems like something simple, but I believe that it is not and we probably need to better define some additional things

    We could have a section dedicated to refresh an item, but the refresh action is part of the “action” block and has more attributes within it. So what should be carried over?

    Will the refresh happen after all dialog close actions? I use a lot the “set value" based on the dialog return which then refresh a region, but I had cases where we first refresh the default values then set with the overriden ones. 

    Does this refresh have a condition or should it always update when the modal closes? I'm thinking about reports with bigger queries.

    I hope this points help to initiate a more clear view of what the community wants and I encourage people to reply, add and correct me if necessary.

  • dave.merrill OP 2.1 years ago

    In our case, the modal dialog is used to create, edit, or delete a record (including persisting that transaction). The parent page displays some of this data by querying the database (rather than by passing it from dialog to parent). So after that data has mutated, the parent page needs to requery the database.

    The developer should be able to identify page elements to be refreshed upon closure of a modal dialog. Optimally, the refresh should occur only when the user has persisted a change (saving a Create, Update or Delete) in that dialog.

    In the case where the element that opens the dialog is a Button, it seems like a reasonable location to capture the “refresh target upon edit via dialog” information is in the Button Behavior section, below the other controls therein.

  • sharad7 OP 4 months ago

    Can some expert give me step by step ‘robust’ solution? I did see a video https://youtu.be/0j6kINDbgpA But did not  worked for me. This is such a basic requirement.

  • jayson hanes Admin OP 4 months ago

    @sharad7 are you sure you are placing the dynamic action on the PARENT page? not the modal page – and what Chip's video shows is indeed, “robust”

  • sharad7 OP 4 months ago

    Yes. On parent page. I am  using 24.2 Universal Theme. You can also try. I never found  any solution with Dynamic Actions ‘robust’ .

  • lee.burgess OP 4 months ago

    @sharad7 You have to ensure you apply the dialog closed DA on the triggering element. In the video the link comes from the edit button in the region, so he uses the DA on region. If the dialog is opened from a button, then you need to apply the DA to the button. Never had any issues with this.

  • sharad7 OP 4 months ago

    Dear Lee, jayson, I tried this but still does not work. See attached screeshot of set up. Is this browser dependent? I am using safari. I have a video, but not able to upload it.

  • sharad7 OP 4 months ago

    Add response opens a model page#9 which closed on CREATE,SAVE,DELETE

  • sharad7 OP 4 months ago

    Tried following but still not working:

    1. Used Chorome
    2. In modal page passed LEAD_ID (foreign key) as ‘Items to return’ and disabled success message
    3. Tried Dialogue Template as ‘Drawer’

    That is why I say , I need a ‘Robust’ solution.

  • sharad7 OP 4 months ago

    Lee, Jayson, I am so excited to see experts like you taking out time  to comment on my long pending issue. Appreciate if you can keep up the tempo  and provide a viable solution.

  • lee.burgess OP 4 months ago

    Can you share the close dialog process from the modal

  • sharad7 OP 4 months ago

    Screenshot of close dialog process of the modal page

  • lee.burgess OP 4 months ago

    What does the Add_response button do - does it link directly to the modal or does it submit and then branch to the modal? 

    There is a ‘catch all solution’ which I wouldn't really recommend but if you are struggling to get it working this will work I'm sure:

    Create a dialog closed that fires on this expression (it might be 'document' instead of window but think both will work). Set the true action to refresh your relevant region(s).

  • sharad7 OP 4 months ago

    Did not work. Added ‘window’  DA in base Page. Instead of refresh, its clearing entire region. This should have one the first features released with Modal Page. This feature is in Roadmap, I guess lets wait.

  • john.snyders APEX Team OP 4 months ago (edited 4 months ago)

    This is not Oracle Forums - which is where these types of discussions should take place

  • sharad7 OP 4 months ago

    John, I didn’t get what you want to say. If Oracle APEX is pitched as an enterprise application modernisation tool , especially for Oracle Forms replacement, then this capability should have been taken care of long back. This  is pending for more than 4 years.

  • fac586 OP 4 months ago

    John, I didn’t get what you want to say. If Oracle APEX is pitched as an enterprise application modernisation tool , especially for Oracle Forms replacement, then this capability should have been taken care of long back. This  is pending for more than 4 years.

    As indicated by the link, he meant “Oracle Forums”, which is the location that should be used for questions and general discussion about APEX. The APEX Ideas site is not the place for this.

    The dynamic action does not work because you are trying to refresh a static content region, which does not support this functionality.

    This is covered in the documentation:

    The native components that support this are Interactive Reports, Classic Reports, Charts, List View and all item types with cascading LOV support. Plug-ins might support this event as well.

    and online help:

    Refresh

    Refresh the data content of an item or region component such as Template Reports, Interactive Reports, or Interactive Grids or cascading LOV items. Not all regions and items support refresh.

  • sharad7 OP 4 months ago

    fac586, Thanks for the clarification. I am just trying to implement workaround given by you 3.6 years ago. And this  is not a general APEX discussion, I am talking about specific idea in FR-1725. Looking for a workaround till the roadmap is implemented.  I am not a developer but a low code business user. 

    Thanks for pointing me the documentation, was not aware that page close refresh works only on specific component types. As a low code user, I prefer to try on the product rather than reading the documentation. BTW I did try with Classic report and IR but still facing issues. Anyways, looks like this is not the forum where I should look for a solution/workaround but expect some random comments from experts.

  • john.snyders APEX Team OP 4 months ago

    Sorry for the confusion. Yes I simply meant that this discussion should take place on the forum.  The Ideas app is for ideas. Questions about how to implement things, even workarounds, are best discussed on the Oracle Forum for APEX. On the forum more people can help out and more people will benefit by seeing the solutions that others explain. On occasion people have tried to be helpful in the Ideas app by pointing to alternative solutions or workarounds and that's cool, but it really isn't the best place for longer discussions about app implementation.