Home:ALL Converter>Oracle APEX, substitution string not working for APEX Item (Select List from Query)

Oracle APEX, substitution string not working for APEX Item (Select List from Query)

Ask Time:2019-10-16T21:03:39         Author:Philipp

Json Formatter

I created an interactive report, which gets populated by Apex Items (Textfield, Select List, etc.), in order to use the report as a dynamic form.

Specifically I'm using the SELECT_LIST_FROM_QUERY function to create a dynamic select list.

When I want to populate the report with data dynamically, I need to be able to adress the different items uniquely, to set their values.

Now the Oracle Documentation for Apex Items suggests the following syntax for SELECT_LISTs:

SELECT empno "Employee #", ename "Name", APEX_ITEM.SELECT_LIST( p_idx => 3, p_value => deptno, p_list_values => 'ACCOUNTING;10,RESEARCH;20,SALES;30,OPERATIONS;40', p_attributes => 'style="color:red;"', p_show_null => 'YES', p_null_value => NULL, p_null_text => '-Select-', p_item_id => 'f03_#ROWNUM#', p_item_label => 'Label for f03_#ROWNUM#', p_show_extra => 'YES') "Department" FROM emp;

The important attributes for what I need, are "p_item_id" and "p_item_label".

For those, the documentation says:

• An HTML ID attribute is generated for each row, where #ROWNUM# is substituted for the current row rownum (p_item_id parameter). (So an ID of 'f03_4' is generated for row 4.)

• A HTML label element is generated for each row (p_item_label parameter).

This should be the same for SELECT_LIST_FROM_QUERY but just to be sure, I tested it with both and neither works.

The Apex Item itself is created fine, but the HTML Tags of the Items do not include the required ROWNUM.

Instead of showing up as id="f03_4" as the documentation would suggest, the #ROWNUM# keyword is not substituted for the current row number and simply shows up as <select name="f03" style="color:red;" id="f03_#ROWNUM#"> for the provided example above.

Did i miss anything? Why does it not work the way it was described? We are working with APEX 19.1 and the API for this APEX_ITEM functionality is basicaly the same since Apex 5, so I dont think there was a change.

Any Ideas would be appreciated!

Author:Philipp,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/58414016/oracle-apex-substitution-string-not-working-for-apex-item-select-list-from-que
yy