Hi,
Under APEX 21.2.3, in a page, I have an ajax callback :
declare
p_emp_no number;
p_max_sal number;
begin
select count(distinct empno), max(sal)
into p_emp_no, p_max_sal
from emp
where deptno=apex_application.g_x01
fetch first row only;
apex_json.open_object;
apex_json.write('empno', p_emp_no);
apex_json.write('sal', p_max_sal);
apex_json.close_all;
exception when no_data_found then
p_emp_no := 0;
p_max_sal := 0;
end;
And I refresh a region with a dynamic action on a select list P1_DEPT. It works well.
I try ro refresh two items on a dynamic action but they are not refreshed when I select a value on P1_DEPT.
Here is the javascript code when I refresh P1_DEPT :
apex.server.process( 'Get Data',
{ pageItems:'#P1_DEPT',
x01: apex.item('P1_DEPT').getValue()
}, // Parameter to be passed to the server
{
success: function (pData) { // Success
console.log(pData);
apex.item('P1_EMP').setValue(pData.empno);
apex.item('P1_SAL').setValue(pData.sal);
},
error: function(e){
console.log("Error: ", e);
},
dataType: "json" // Response type
}
);
I don't know why the items P1_SAL and P1_DEPT are not refreshed as well as the region which is a classic report.
Best regards.