Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Set value after refreshing a radio group

Eslam_ElbyalyJul 20 2023 — edited Jul 20 2023

Hi. I am on APEX 21.1.

I have a popUp Lov “P1_SEARCH_RADIO that selects ename, id from scott.emp table. And a Radio Group “P1_RADIO” with…

select ename, id from emp where id = :P1_SEARCH_RADIO

I need to filter the radio using the popUp lov then set the radio value with the search value. for example, when user selects “Scott” from the popUp Lov, the radio should refresh and retrieve only “Scott” and set it as checked.

When a value gets checked in the radio, there's a classic report gets refreshed. – That's another issue but I wanted to let you know.

I set :P1_SEARCH_RADIO as a cascading parent lov for the radio group. Then created a dynamic action to get the value of the popUp lov(the searched value) and set the radio group using it. That's the code…

$s("P1_RADIO", $v("P1_SEARCH_RADIO"));

  • The result is that the radio gets refreshed but the value does not get set.

I believe the problem is that the code does not run in sync but still searching for a way to solve the problem. I tried using the code of setting the value in a callback fuction that's called from another function of the code of refreshing the radio. But the result is the same.

This's how I used the callback approach.

I defined two functions in “Function and global variables” page attribute.

function refreshRadio(myCallback){apex.item("P1_RADIO").refresh();
myCallback();}
function setV(){$s("P1_RADIO", $v("P1_SEARCH_RADIO") );}

Then I called “refreshRadio(setV)” function through the Change dynamic action of the popUp Lov, after setting the radio group's “cascading parent lov” to “null” so that “items to submit” attribute gets displayed and set “items to submit” to “P1_SEARCH_RADIO”.

Shouldn't the callback function solve the problem? Shouldn't the callback function run after the refresh? Or am I getting the job of the callback functions wrong?

Comments
Post Details
Added on Jul 20 2023
10 comments
622 views