Skip to content

Instantly share code, notes, and snippets.

@phartenfeller
Created August 3, 2023 08:38
Show Gist options
  • Save phartenfeller/81b9c3e742d517de1fde834beb789843 to your computer and use it in GitHub Desktop.
Save phartenfeller/81b9c3e742d517de1fde834beb789843 to your computer and use it in GitHub Desktop.
Oracle APEX Dynamic Action Plug-In PL/SQL example
function render_da(
p_dynamic_action apex_plugin.t_dynamic_action
, p_plugin apex_plugin.t_plugin
)
return apex_plugin.t_dynamic_action_render_result
as
l_return apex_plugin.t_dynamic_action_render_result;
l_action p_dynamic_action.attribute_01%type := p_dynamic_action.attribute_01;
l_storage_id p_dynamic_action.attribute_02%type := p_dynamic_action.attribute_02;
l_storage_version p_dynamic_action.attribute_03%type := p_dynamic_action.attribute_03;
l_pk_item p_dynamic_action.attribute_04%type := p_dynamic_action.attribute_04;
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;
l_return.javascript_function := 'function() { ' ||
'window.hartenfeller_dev.plugins.offline_form_utils.run({'||
apex_javascript.add_attribute( p_name => 'action', p_value => l_action ) ||
apex_javascript.add_attribute( p_name => 'storageId', p_value => l_storage_id ) ||
apex_javascript.add_attribute( p_name => 'storageVersion', p_value => l_storage_version ) ||
apex_javascript.add_attribute( p_name => 'pkPageItem', p_value => l_pk_item ) ||
apex_javascript.add_attribute( p_name => 'regionId', p_value => p_plugin.attribute_01 ) ||
'}) }';
apex_debug.message('render: offline_form_utils.run');
return l_return;
end render_da;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment