Oracle Apex: refresh item on another item change

筅森魡賤 提交于 2020-07-10 06:59:04

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/62634193/oracle-apex-refresh-item-on-another-item-change

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!