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 to Page Item from Ajax process

sk-aaludraApr 18 2020 — edited Apr 22 2020

I'm trying to upload document from APEX page to S3 bucket and I'm successful with the help of plugin from https://www.apexutil.com/ords/prod/f?p=700:200:1349309139567:::::

The plugin demonstrate retrieve the upload result and inserting to table as explained below.

Create new dynamic action;

Choose Upload Success [FM Component];

Choose "Execute JavaScript Code" action;

Inside the "Code" textarea define code:

apex.server.process("my_ajax_process", {

  x01: this.browserEvent.originalEvent.detail.serverId,

  x02: this.browserEvent.originalEvent.detail.file.name,

  x03: this.browserEvent.originalEvent.detail.file.body.size,

  x04: this.browserEvent.originalEvent.detail.file.body.type

}, {

  success: function() {

    console.log("success");

  },

and retrieve the x0 values in Ajax process and inserting to table.

Create Ajax Process, name: "my_ajax_process"

Define PL/SQL code:

declare

  l_server_id varchar2(4000) := apex_application.g_x01;

  l_name varchar2(4000) := apex_application.g_x02;

  l_size number := apex_application.g_x03;

  l_type varchar2(4000) := apex_application.g_x04;

begin

  insert into MY_TABLE (MT_SERVER_ID, MT_NAME, MT_SIZE, MT_TYPE)

  values (l_server_id, l_name, l_size, l_type);

  owa_util.status_line(nstatus => 204, creason => 'No Content');

end;

However I need to capture the X0 values in the Ajax process and assign to Form pages items, as I have to store the output along with other form fields and store into my table. I have tried and however its not getting updated. Any help much appreciated

declare

  l_server_id varchar2(4000) := apex_application.g_x01;

  l_name varchar2(4000) := apex_application.g_x02;

  l_size number := apex_application.g_x03;

  l_type varchar2(4000) := apex_application.g_x04;

begin

  :P12_DOCUMENTURL := l_server_id;

  :P12_DOCUMENTTYPE := l_type;

  :P12_DOCSIZE := l_size;

  owa_util.status_line(nstatus => 204, creason => 'No Content');

end;

This post has been answered by jariola on Apr 19 2020
Jump to Answer
Comments
Post Details
Added on Apr 18 2020
14 comments
3,762 views