Home > Building an Application > Understanding Page-Level Items > Creating Page-Level Items
Previous |
Next |
You can create page-level items by running the Create Item Wizard
Topics:
You create a page-level item by running the Create Item Wizard from the Page Definition.
To create a page-level item:
Navigate to the appropriate Page Definition. See "Accessing a Page Definition".
If necessary, create an HTML region. See "Understanding Regions".
Under Items, click the Create icon.
Select an item type. See "About Item Types".
Follow the on-screen instructions.
To learn more about a specific field, click the field label.
When help is available, the item label changes to red when you pass your cursor over it, and the cursor changes to an arrow and question mark. See "About Field-Level Help".
When specifying an item name, remember the following rules. Item names must:
Be unique within an application
Not have quotation marks
Begin with a letter or a number, and subsequent characters can be letters, numbers, or underscore characters
Be case-insensitive
Should not exceed 30 characters
Cannot contain letters outside the base ASCII character set
When you create an item, you specify an item type. Once you create an item, these types appear on the Display As list on the Edit Page Item page. Table: Available Item Types describes available item types.
Available Item Types
Item Type | Description |
---|---|
Displayed using a list of values. A list of values is required for items displayed as check boxes. The value corresponding to a checked box is returned in a single colon-delimited string. The following example demonstrates how to create a single check box that returns SELECT NULL display_text, 'YES' return_value FROM DUAL; This example includes the additional text Click to select. SELECT 'Click to select' display_text, 'YES' return_value FROM DUAL; See Also: "APEX_UTIL" in Oracle Application Express API Reference for information about breaking up returned values |
|
Displays a text field with a Calendar icon next to it. When clicked, this icon displays a small calendar where the user can select a date and a time (optional). If the format you need is not included in the Display As list, select Date Picker (use application format mask) or Date Picker (use item format mask). The latter uses the value from the Format Mask field in the Source section of the Edit Page Item page. |
|
Available Display As Text subtypes include:
|
|
Displays a text field with a Browse... button. The Browse button enables the user to locate a file on a local file system and upload it. Oracle Application Express provides a table for these files to be uploaded to and an API to retrieve the files. See Also: "Securing File Uploads" |
|
Renders an HTML hidden form element. Session state can be assigned and referenced just like a text field. |
|
Renders an HTML hidden form element. Session state can be assigned and referenced just like a text field. For maximum security use Hidden and Protected instead of Hidden unless your page has client-side behavior, for example, JavaScript that alters the item value after the page is rendered by Oracle Application Express. |
|
Based on a list of values. This item enables you to manage a list of items by selecting and adding to a list. The list of values display as a popup. |
|
Renders as a multiselect HTML form element. When submitted, selected values are returned in a single colon-delimited string. You can break up the values using the See Also: "Working with a Multiple Select List Item" and "APEX_UTIL" in Oracle Application Express API Reference |
|
Renders as an HTML password form element. Available password types include:
The Password and Password (submits when Enter pressed) save the password in a database table when the page is submitted. Use these password item types only when the password is needed in session state for use by other pages during the session. Password (does not save state) and Password (submits when Enter pressed, does not save state) do not save the password in a database table. Use these password item types when the submitted password value is used only by after-submit page processing on the same page and is never needed again during the session. If you must reference and retrieve the value of a password in your application then you set the Store value encrypted in session state attribute to Yes. To learn more, see "About Session State and Security". |
|
Renders as a text field with an icon. When the user clicks the icon, a popup window appears with one of these, depending on the popup selection you make:
With the exception of the color picker, you control popup lists of values through templates. You can only specify one popup list of values (LOV) template for each application. A popup LOV is a good choice for lists of values that are too large to return on a single page. There are two types of Popup LOVs: one that fetches a set of rows when the window pops up and one that does not. Available popup LOVs include:
Popup LOVs must be based on a query that selects two columns with different column aliases. For example: SELECT ename name, empno id FROM emp If one of the columns is an expression, remember to use an alias. For example: SELECT ename||' '||job display_value, empno FROM emp |
|
Renders as an HTML radio group form element, based on a list of values. Choose Radiogroup with Submit to have the page submitted when the radio button is selected. The following example displays employee names ( SELECT ename, empno FROM emp |
|
Displays using a list of values. A list of values is required for items displayed as a select list. Select lists are rendered using the HTML form element The following example would return employee names ( SELECT ename display_text, empno return_value FROM emp Oracle Application Express provides additional enhancements to a standard HTML select list:
Note: Long select lists can cause errors. If you have a long select list that generates an error, try using a Popup List of Values instead. |
|
Renders as a multiple select list that includes two boxes containing lists. The left list displays a source list of values. Users use the shuttle control icons and buttons to select list items and move them from the left (source) list to the right (destination) list. Each shuttle has five controls:
The right destination list includes the sort controls Move to top, Move up, Move down, and Move to bottom. Note: In order to create this item type, you must define a list of values. See "Creating a Static List of Values", "Creating Lists of Values", and "Working with a Multiple Select List Item". |
|
Displays as an HTML text field containing a maximum of 30,000 bytes of text. You control the maximum length and display width by editing the Height and Width item attribute. Available Text display options include:
|
|
Renders as an HTML text area. There is no maximum length for an item displayed as a text area. You control the height and width by editing the Height and Width item attribute. Additional available Text Area Display As options include:
|
|
Forces the close of an HTML table using the Note that a Stop and Start Table item only displays its label. You can prevent the label from displaying at all by setting it to null. To do this, you simply remove the default label. |
To create multiple items simultaneously:
Navigate to the appropriate Page Definition. See "Accessing a Page Definition".
If necessary, create an HTML region. See "Understanding Regions".
Under Items, click the Create icon.
The Create Item wizard appears.
At the bottom of the page, click the Create multiple Items Using Tabular Form link.
On the Create Multiple Items page, specify the following:
Create Item(s) in Region - Select the region to contain the items.
Item Template - Select an item template.
For each item, enter the Sequence, Name, Label, Type and specify whether the item should be cached.
Click Create Multiple Items.
To create multiple items using the Drag and Drop Layout page:
Navigate to the appropriate Page Definition. See "Accessing a Page Definition".
If necessary, create an HTML region. See "Understanding Regions".
Under Items, click the Create icon.
The Create Item wizard appears.
At the bottom of the page, click the Create multiple Items Using Drag and Drop Layout link.
The Drag and Drop Layout page appears.
Select an item from the palette on the left side of the page and drag it to the appropriate position on the page.
Edit the item attributes at the of the page.
Display Name - Enter an item name. Use this name retrieve the value of the item. Item names longer than 30 characters cannot be referenced using bind variable syntax.
Label - Enter the label for this item. You may include HTML, JavaScript, and shortcuts. You can also use the substitution string #CURRENT_ITEM_NAME#
to obtain the name of the item associated with this label.
Display Type - Select a display type (if applicable). See "About Item Types".
To edit an existing item, edit the Item Name and Label fields, or select a new Display Type at the top of the page.
Click Next.
Optionally, edit the each item's Name and Label.
Click Apply Changes.
One way to create a static list of values is to edit an item's List of Values definition. Note that this type of list of values is not reusable. As a best practice, create a list of values as a shared component whenever possible.
To create a static list of values:
Navigate to the appropriate Page Definition. See "Accessing a Page Definition".
Under Items, select the item name.
The Edit Page Item page appears.
Under Name, specify how the item will be rendered. Make a selection from the Display As list.
Under List of Values, create a static list of values:
From Named LOV, select Select Named LOV.
In List of values definition, enter a definition using the following syntax:
STATIC[2]:Display Value[;Return Value],Display Value[;Return Value]
Where:
The first keyword may be STATIC
or STATIC2
.
STATIC
results in the values being sorted alphabetically by display value. STATIC2
results in the values being displayed in the order they are entered in the list.
A semicolon separates the display value from the return value in each entry.
Return Value
is optional. If a Return Value
is not included, the return value is the same as the display value.
To learn more, see item Help. To view help for a specific item on a page, click the item label.
When help is available, the item label changes to red when you pass your cursor over it and the cursor changes to an arrow and question mark. See "About Field-Level Help".
Click Apply Changes.
The examples that follow demonstrate syntax for three different static LOVs.
In this example, the list of values has four values (Cow, Dog, Cat, and Lion) that display in alphabetical order. The return value of each entry equals the display value.
STATIC:Cow,Dog,Cat,Lion
In this example, the list of values has ten values that display in the order listed in the definition. The return value of each entry equals the display value.
STATIC2:10,15,20,25,50,100,200,500,1000,10000