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!

Interactive Grid JavaScript question ( "setSelectedRecords" )

Rick-PickMay 24 2022

I'm using APEX 20.1.2.
I need to refresh one or more records in an IG after visiting a modal page which, when closed, returns an item which identifies the records to be refreshed. I'm trying to do this by first selecting the records in JavaScript and then using the "selection-refresh" action to refresh them.
The following example works with hardcoded record ids and does exactly what I want:
apex.region( "attendees" ).call( "setSelectedRecords", ["29786558","29786559"] );
apex.region( "attendees" ).call( "getActions" ).invoke( "selection-refresh" );
Of course, I can't hard code the ids, so I'm using a PL/SQL DA to populate a hidden item with comma-separated record ids, with quotes, as in the above array. In the JavaScript, I have got:
var recIds = $v("P1_RETURNED_REC_IDS").split( "," );
This should, and does, create an array, recIds, containing the quoted and comma-separated ids, but then
apex.region( "attendees" ).call( "setSelectedRecords", recIds );
doesn't select the records. I have tried many things, but haven't come up with the answer.
Thanks

Comments
Post Details
Added on May 24 2022
1 comment
1,000 views