'Oracle Apex - refresh all subregions with one refresh in dynamic action
I am working with APEX 19.2.0.00.18. I have a page with a static region with 4 chart subregions, plus a radio button that allows the user to select which series (total, mean, median) to display in the charts. I have a dynamic action set up to refresh charts when the radio button value is changed. This dynamic action consists of:
- execute null PL/SQL code to submit the radio button value
- refresh chart subregion 1
- refresh chart subregion 2
- refresh chart subregion 3
- refresh chart subregion 4
Is there any way to simplify this to refresh all 4 chart subregions with a single refresh? I have multiple static regions like this (i.e., containing multiple chart subregions) on this page, so reloading the entire page is not an ideal option.
Solution 1:[1]
Scott's answer is pretty much correct, but if you decide to use the newer apex.region JS API, you have to use it with a region static id. So just give the regions you want to refresh a static id and then use the API like this (e.g. in a Execute JavaScript Dynamic Action):
apex.region('MY_STATIC_ID1').refresh();
apex.region('MY_STATIC_ID2').refresh();
apex.region('MY_STATIC_ID3').refresh();
Solution 2:[2]
Answer previously here https://stackoverflow.com/a/58126513/527513
Can be applied a number of ways, but you're using the JS API refresh any region with a given selector, in this case the refreshme class
$('.refreshme').trigger('apexrefresh');
The API offering has changed over time, apex.region being the newer method.
apex.region( "static_id1" );
apex.region( "static_id2" );
As Daniel noted, these need to be supplied as static IDs, not a given selector. I should have realised this since the example was absent the # of the static ID.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Daniel Hochleitner |
| Solution 2 |
