Ajax Callback application process and it's usage In Oracle APEX

Ajax Callback/ On-Demand : Run this application process when requested by page Process.

Preview

If you create an Ajax Callback/On-Demand process that dynamically shows the values of another item without submitting the page.

To create an application process :
  1. Navigate to the Shared Components page:
  2. Under Application Logic, select Application Processes
  3. Click on create button.

Preview

Name - Enter a name for the application process. In my Case GET_NAME
Sequence - 1
Point - Ajax Callback/ On-Demand Run this application process when requested by page Process.
Click Next Button

declare
    v_ename varchar2(100);
begin
   select 
          ename into v_ename 
   from 
          emp 
   where 
          empno = APEX_APPLICATION.g_x01;
HTP.P(v_ename);

exception when others then 
null;
end;

Preview

Create a normal page with two page item and paste below code in Function and Global Variable Declaration.

Preview

function get_name()
{
 
apex.server.process("GET_NAME",{x01: $v('P1_ID')},
{
 
dataType: 'text',
success: function(pData){$s('P1_NAME',pData);}
}
);

We can call above written function in many ways like using dynamic action or directly in custom attribute.

 onchange="get_name();"

Preview

You might like:


comments powered by Disqus