With the dynamic action "execute PL/SQL code" you can run server side code without submitting the whole page.
You can't use this dynamic action when the values you want to submit is a tabular form.
You can also run PL/SQL code using the javascript function apex.server.process.
This function has 3 parameters:
- The name of the ondemand process you want to run.
- A data object. This are the values that get submitted.
- A options object. This are the options of jQuery.ajax function.
This is what the documentation says about the data object
Object which can optionally be used to send additional values to be sent with the AJAX request. The special attribute pageItems which can be of type jQuery selector, jQuery or DOM object or array of item names identifies the page items which are included in the URL. You can also set additional parameters that the wwv_flow.show procedure provides (for example you can set the scalar parameters x01 - x10 and the arrays f01 - f20)
For us the mention "the arrays f01 - f20" is important. These arrays submit the tabular form and correspond with the apex.application.g_fXX arrays.
Submitting values of a tabular is done with
var lData ={
f01 : get_value_array('f01'),
f02 : get_value_array('f02'),
f03 : get_value_array('f03')};
apex.server.process('return_full_name'
,lData
,{success:function(pData){ alert(pData);},
dataType:'text'
}
);
function get_value_array(pColumnName) {
var l_values =[];
apex.jQuery('[name="'+pColumnName+'"]').each(
function(){
var l_value;
l_value = apex.item(this.id).getValue();
l_values.push(l_value);
}
);
return l_values
}
for i in 1 .. apex_application.g_f01.count
loop
htp.p(apex_application.g_f01(i)
||' has as last name '
||apex_application.g_f02(i)
||' and the emailadress '
||apex_application.g_f03(i)
);
end loop;