Databases Reference
In-Depth Information
At this point the base of the plug-in has been created. Before continuing to build out the plug-in,
let's do a walkthrough of the execution function. First, the function header is defined. Note that the
signature of the function matches what is expected for a Dynamic Action render function.
FUNCTION save value render (
p dynamic action IN APEX PLUGIN.T DYNAMIC ACTION,
p plugin IN APEX PLUGIN.T PLUGIN
)
RETURN APEX PLUGIN.T DYNAMIC ACTION RENDER RESULT
Next, local variables are declared. The majority of this plug-in's logic is in JavaScript. As a result,
only the return variable needs to be declared.
IS
l result APEX PLUGIN.T DYNAMIC ACTION RENDER RESULT;
The following lines begin the execution section of the function. If the application is running in
debug mode then a call to APEX PLUGIN UTIL.DEBUG DYNAMIC ACTION is made to log debug information.
BEGIN
IF apex application.g debug
THEN
apex plugin util.debug dynamic action(
p plugin => p plugin,
p dynamic action => p dynamic action
);
END IF;
Much of the code for this plug-in will be stored in a JavaScript file which will be stored as part of the
plug-in. The following lines of code will make that file available when the page loads.
apex javascript.add library(
p name => 'com pluggen save value on cascade',
p directory => p plugin.file prefix,
p version => NULL
);
In addition to the JavaScript included above, a little bit of JavaScript needs to be added to the page
and called when the page loads so that it can initialize the jQuery UI widget.
apex javascript.add onload code(
p code => 'apex.jQuery(document).save value on casdade();'
);
The following lines of code register an anonymous JavaScript function with framework. The
function will be invoked automatically based on the driver configured in the dynamic action. The
function checks to see if the event that triggered it was the load event of the page. If so, the initItem
Search WWH ::




Custom Search