Important:Support for G_Fnn arrays is legacy and will be removed in a future release. Oracle recommends using interactive grids instead.
APEX_APPLICATION.G_Fnn arrays (where nn ranges from
50) are used with
APEX_ITEM functions to enable the dynamic generation of HTML form elements to an APEX page (such as
APEX_ITEM.SELECT_LIST). On Page Submit, the item values are sent to the server and provided as the
APEX_APPLICATION.G_Fnn in an
APEX_ITEM context. For other contexts (such as plain array processing for PL/SQL code) use the
APEX_T_VARCHAR2 type and the procedures and functions within the
Note:When working with
APEX_UTILare deprecated. Use
Referencing G_Fnn Arrays
The following example uses
APEX_ITEM to manually create a tabular form on the
EMP table. Note that the
comm columns use the
APEX_ITEM.TEXT function to generate an HTML text field for each row. Note also that each item in the query is passed a unique
p_idx parameter to ensure that each column is stored in its own array.
- On a new page, add a classic report with a SQL Query such as the following example:
SELECT empno, APEX_ITEM.HIDDEN(1,empno)|| APEX_ITEM.TEXT(2,ename) ename, APEX_ITEM.TEXT(3,job) job, mgr, APEX_ITEM.DATE_POPUP(4,rownum,hiredate,'dd-mon-yyyy') hiredate, APEX_ITEM.TEXT(5,sal) sal, APEX_ITEM.TEXT(6,comm) comm, deptno FROM emp ORDER BY 1
- Disable "Escape Special Characters" for all report columns (under the Security property in Page Designer).
- Add a Submit button to the page.
- Run the application.
Referencing Values Within an On Submit Process
You can reference the values posted by the tabular form using the PL/SQL variable
APEX_APPLICATION.G_F50. Because this element is an array, you can reference values directly. For example, the following code block collects all employee names as a text block and stores it as the value of the
:P3_G_F01_CONTENTS := ''; for i IN 1..APEX_APPLICATION.G_F01.COUNT LOOP :P3_G_F01_CONTENTS := :P3_G_F01_CONTENTS || 'element '||I||' has a value of '||APEX_APPLICATION.G_F02(i) || chr(10); END LOOP;
Note that check boxes displayed using
APEX_ITEM.CHECKBOX only contain values in the
APEX_APPLICATION arrays for those rows which are checked. Unlike other items (
DATE_POPUP) which can contain an entry in the corresponding
APEX_APPLICATION array for every row submitted, a check box only has an entry in the
APEX_APPLICATION array if it is selected.