Previous
Previous
 
Next
Next


HIDDEN Function

This function dynamically generates hidden form items.

Syntax

APEX_ITEM.HIDDEN(
    p_idx         IN    NUMBER,
    p_value       IN    VARCHAR2 DEFAULT
    p_attributes  IN    VARCHAR2 DEFAULT NULL,
    p_item_id     IN    VARCHAR2 DEFAULT NULL,
    p_item_label  IN    VARCHAR2 DEFAULT NULL
) RETURN VARCHAR2;

Parameters

Table: HIDDEN Parameters describes the parameters available in the HIDDEN function.

HIDDEN Parameters

Parameter Description

p_idx

Number to identify the item you want to generate. The number will determine which G_FXX global is populated

See Also: "APEX_APPLICATION"

p_value

Value of the hidden input form item

p_attributes

Extra HTML parameters you want to add

p_item_id

HTML attribute ID for the <input> tag

p_item_label

Invisible label created for the item


Example

Typically, the primary key of a table is stored as a hidden column and used for subsequent update processing, for 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

The previous query could use the following page process to process the results:

BEGIN 
    FOR i IN 1..APEX_APPLICATION.G_F01.COUNT LOOP
        UPDATE emp
            SET
                ename=APEX_APPLICATION.G_F02(i),
                job=APEX_APPLICATION.G_F03(i),
                    hiredate=to_date(APEX_APPLICATION.G_F04(i),'dd-mon-yyyy'),
                    sal=APEX_APPLICATION.G_F05(i),
                    comm=APEX_APPLICATION.G_F06(i)
        WHERE empno=to_number(APEX_APPLICATION.G_F01(i));
    END LOOP;
END;

Note that the G_F01 column (which corresponds to the hidden EMPNO) is used as the key to update each row.