35.2 DATE_POPUP Function

Use this function with forms that include date fields. The DATE_POPUP function dynamically generates a date field that has a popup calendar button.

Syntax

APEX_ITEM.DATE_POPUP (
    p_idx                       IN    NUMBER,
    p_row                       IN    NUMBER,
    p_value                     IN    VARCHAR2 DEFAULT NULL,
    p_date_format               IN    DATE DEFAULT 'DD-MON-YYYY',
    p_size                      IN    NUMBER DEFAULT 20,
    p_maxlength                 IN    NUMBER DEFAULT 2000,
    p_attributes                IN    VARCHAR2 DEFAULT NULL,
    p_item_id                   IN    VARCHAR2 DEFAULT NULL,
    p_item_label                IN    VARCHAR2 DEFAULT NULL )
    RETURN VARCHAR2;

Parameters

Parameter Description
p_idx

Number that determines which APEX_APPLICATION global variable is used.Valid range of values is 1 to 50. For example, 1 creates F01 and 2 creates F02.

p_row This parameter is deprecated. Anything specified for this value is ignored.
p_value Value of a field item.
p_date_format Valid database date format.
p_size Controls HTML tag attributes (such as disabled).
p_maxlength Determines the maximum number of enterable characters. Becomes the maxlength attribute of the <input> HTML tag.
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

The following example demonstrates how to use APEX_ITEM.DATE_POPUP to create popup calendar buttons for the hiredate column.

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') hd,
    APEX_ITEM.TEXT(5,sal) sal, 
    APEX_ITEM.TEXT(6,comm) comm,
    deptno
FROM emp
ORDER BY 1

See Also:

Oracle Database SQL Language Reference for more information about the TO_CHAR or TO_DATE functions