Example of Ajax Callback Function On Oracle Apex
Example of Ajax Callback Function On Oracle Apex
Application Process
GetMRP
Ajax Callback: Run this application process when requested by a page process.
declare
v_mrp number;
begin
Select mrp
into v_mrp
FROM ITM_PRICE_DECLARE
WHERE ITM_ITEM_ID = apex_application.g_x01;
htp.p(v_mrp);
exception
when others then
htp.p(SQLERRM);
end;
Dynamic Action
onchange
input[name=f12]
var
xhr2,
self = $(this.triggeringElement),
productId = self.val(),
row = self.closest('tr');
xhr = $.ajax({
url:'wwv_flow.show',
type:'post',
dataType: 'text',
traditional: true,
data: {
p_request: "APPLICATION_PROCESS=GetMRP",
p_flow_id: $v('pFlowId'),
p_flow_step_id: $v('pFlowStepId'),
p_instance: $v('pInstance'),
//p_arg_names: [ item_id ],
//p_arg_values: [ itemValue ],
x01: productId
},
success: function( resultData, textStatus, ajaxObj ){
//do stuff after fetching product price
row.find( ':input[name=f16]' ).val( resultData );
// getDiscountAmt();
},
error: function(jqXHR, textStatus, errorThrown){
alert('Error occured while retrieving AJAX data: '+textStatus+"\n"+errorThrown);
}
});
Item Custom Attribute
onChange="getlinetotal();" onFocus="getlinetotal();"
***Thanks for visiting my blog. My YouTube channel is Oracle School BD. You can visit here to see video tutorials.***
No comments