Search code examples
eventsrefreshoracle-apexonchangeitems

Oracle Apex: refresh item on another item change


I'm trying to refresh a Shuttle Item whenever a Select List item is modified.

What I've done so far:

I have an item P1_MY_LIST which is a list of value. And I have a P1_MY_SHUTTLE which is populated by this query :

SELECT a, b FROM my_table WHERE col1 = :P1_MY_LIST;

Then I created a Change event on P1_MY_LIST which contain a TRUE Event set to Refresh the P1_MY_SHUTTLE item.

Yet, nothing happens when I select something in my P1_MY_LIST .

Anyone knows what I'm doing wrong ?


Solution

  • For refreshing a shuttle based on a selected value in a select list, you're better off using the legacy "Cascading List of Values" attribute.

    In your case: On page item P1_MY_SHUTTLE, set "Cascading List Of Value" > "Parent Item" to P1_MY_LIST. That should do it.

    If for some reason that does not work in your case you can do a dynamic action but there is caveat. There is no option to submit the selected value to the server so your select list will not use the newly selected P1_MY_LIST. As a result it looks as if it is not refreshing, but actually it is.You can work around that by

    • adding a true action before your refresh action.
    • Action: "Execute PL/SQL Code"
    • PL/SQL Code "NULL;" (you don't need to do anything)
    • Items to submit "P1_MY_LIST".

    That will ensure that P1_MY_LIST gets picked up when the query is executed again and it will show the correct values in your shuttle.