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!

how to set page item value using Dynamic Action

SmithJohn45Dec 28 2021 — edited Dec 28 2021

want to set page item (P14_RO_ID) from IG Column (TEST_ID) value using dynamic action on Click event, used below code but it is showing error in Console window. link to guide from where i got this:
Oracle APEX JavaScript - Get Column Value (0 Bytes)Code on Action = Execute JavaScript Code: (tried remarked code and getting same error)

var selectedRoid = "";
//model = this.data.model;
//selectedRoid = model.getValue( this.data.selectedRecords[0], "TEST_ID");
selectedRoid = this.data.model.getValue( this.data.selectedRecords[0], "TEST_ID");
$s("P4_RO_ID", selectedRoid);

Error shows in Console window:
Uncaught TypeError: Cannot read properties of undefined (reading 'model')
  at Object.javascriptFunction (new-11-testig:678)
  at Object.da.doAction (desktop_all.min.js:22)
  at Object.da.doActions (desktop_all.min.js:22)
  at HTMLButtonElement.<anonymous> (desktop_all.min.js:22)
  at Function.each (desktop_all.min.js:2)
  at S.fn.init.each (desktop_all.min.js:2)
  at Object.da.actions (desktop_all.min.js:22)
  at HTMLButtonElement.<anonymous> (desktop_all.min.js:22)
  at HTMLDocument.dispatch (desktop_all.min.js:2)
  at HTMLDocument.v.handle (desktop_all.min.js:2)
desktop_all.min.js?v=21.2.0:5 Dynamic Action Fired: null (NATIVE_SET_VALUE) Object
please help is there anything i missed or something with version (i am using 21.2). how to resolve / set page item value on click event?
regards

This post has been answered by Hamza Al-abbasi on Dec 28 2021
Jump to Answer
Comments
Post Details
Added on Dec 28 2021
8 comments
4,886 views