Hello,
In APEX 5.1, item type plugins must implement a render and AJAX procedure in order to be used in an Interactive Grid column. I have tried to transform the (deprecated) plugin functions into procedures, but I'm having an issue with the AJAX procedure.
I'm not sure whether I have implemented the procedures correctly. The help text for the render procedure says the following:
Item Type Plug-in Render Procedures must implement the following interface:
procedure <name of procedure> (
p_item in apex_plugin.t_item,
p_plugin in apex_plugin.t_plugin,
p_param in apex_plugin.t_item_render_param,
p_result in out nocopy apex_plugin.t_item_render_result )
According to the APEX documentation, the APEX_PLUGIN.T_ITEM and APEX_PLUGIN.T_ITEM_RENDER_RESULT types do not exist. Another remark: the APEX_PLUGIN.T_ITEM_RENDER_PARAM type is undocumented.
Anyway, I ended up using the following interface:
procedure render(
p_item in apex_plugin.t_page_item,
p_plugin in apex_plugin.t_plugin,
p_param in apex_plugin.t_item_render_param,
p_result in out nocopy apex_plugin.t_page_item_render_result
)
The help text in APEX for the AJAX procedure also includes unexisting parameters.
Item Type Plug-in Ajax Procedures must implement the following interface:
procedure <name of procedure> (
p_item in apex_plugin.t_item,
p_plugin in apex_plugin.t_plugin,
p_param in apex_plugin.t_item_ajax_param,
p_result in out nocopy apex_plugin.t_item_ajax_result )
I ended up implementing the following interface.
procedure ajax(
p_item in apex_plugin.t_page_item,
p_plugin in apex_plugin.t_plugin,
p_param in apex_plugin.t_item_ajax_param,
p_result in out nocopy apex_plugin.t_page_item_ajax_result
)
There seems to be a problem with this implementation. When I enable lazy loading for a Select2 page item, it executes the AJAX procedure in the background, but this is the JSON response I get back:
Error in PLSQL code raised during plug-in processing.
ORA-06550: line 776, column 1:
PLS-00306: wrong number or types of arguments in call to 'RENDER'
ORA-06550: line 776, column 1:
PLS-00306: wrong number or types of arguments in call to 'RENDER'
ORA-06550: line 776, column 1:
PL/SQL: Statement ignored
It executes the render procedure instead of the AJAX procedure. The procedure parameters seem to be the problem, but I have no idea how to fix this. Can somebody help me out?
Thanks,
Nick