18.11.3 Creating Dynamic Lists
A Dynamic List is based on a SQL query or a PL/SQL function executed at runtime.
- About the Process of Creating a Dynamic List
- Understanding Dynamic List Syntax
- Creating a Dynamic List from Scratch
Parent topic: Creating Lists
18.11.3.1 About the Process of Creating a Dynamic List
A dynamic list enables you to create a List component based on items from a SQL query or a PL/SQL function returning a SQL query. These dynamic lists can then be rendered on a page using any List Template from your theme.
The process of creating a dynamic list involves the following steps:
-
Step 2: Specify whether to create the list from scratch or by copying an existing list.
-
Step 3: If creating a list from scratch, you are prompted to select a list type. Select Dynamic.
-
Step 4: Enter a SQL query or a PL/SQL function returning a SQL query.
-
Step 5: Add the list to a page by creating a List region.
See Also:
Parent topic: Creating Dynamic Lists
18.11.3.2 Understanding Dynamic List Syntax
You create a dynamic list using a SQL query or a function returning a SQL Query.
Syntax for a SQL query:
SELECT level, labelValue label, [targetValue] target, [is_current] is_current_list_entry, [imageValue] image, [imageAttributeValue] image_attribute, [imageAltValue] image_alt_attribute, [attribute1] attribute1, [attribute2] attribute2, [attribute3] attribute3, [attribute4] attribute4, [attribute5] attribute5, [attribute6] attribute6, [attribute7] attribute7, [attribute8] attribute8, [attribute9] attribute9, [attribute10] attribute10 FROM ... WHERE ... ORDER BY ...
Syntax for a function returning a SQL query:
RETURN 'SELECT level, labelValue label,'|| ' [targetValue] target,'|| ' [is_current] is_current_list_entry,'|| ' [imageValue] image,'|| ' [imageAttributeValue] image_attribute, '|| ' [imageAltValue] image_alt_attribute,'|| ' [attribute1] attribute1,'|| ' [attribute2] attribute2,'|| ' [attribute3] attribute3,'|| ' [attribute4] attribute4,'|| ' [attribute5] attribute5,'|| ' [attribute6] attribute6,'|| ' [attribute7] attribute7,'|| ' [attribute8] attribute8,'|| ' [attribute9] attribute9,'|| ' [attribute10] attribute10'|| 'FROM ...'|| 'WHERE ...'|| 'ORDER BY ...';
Where:
-
level
andlabelvalue
are required. -
level
- For hierarchical lists, thelevel
parameter should be supplied. For non-hierarchical lists, this parameter can be set toNULL
. -
labelvalue
- Text to appear as list entry. -
targetvalue
- Target URL to branch to when list entry is selected. -
is_current
- Controls the behavior of the list entry. Values include:-
NULL
- Currency of target is based upon Target URL. -
'YES'
- List entry is always current. -
'NO
' - List entry is not current.
-
-
imagevalue
- The name of image to be display on the list entry -
imageattributevalue
- Attributes of the image, such as the width or height -
imagealtvalue
- Value for ImageALT
tag, required for accessibility purposes in templates where the user must click the image. -
attribute1
to10
: These attributes tie in with the existing ten User Attributes exposed on the Static List Entry page.
Parent topic: Creating Dynamic Lists
18.11.3.3 Creating a Dynamic List from Scratch
To create a dynamic list:
- Access the Create/Edit Lists Wizard:
- On the Workspace home page, click the App Builder icon.
- Select an application.
- On the Application home page, click Shared Components.
- Under Navigation, click Lists.
- Click Create.
- Click From Scratch and click Next.
- For Name and Type:
- Name - Enter a numeric or alphanumeric name for the list.
- Type - Select Dynamic.
- Build Option - If applicable, select a build option for this component. Build options are predefined settings that determine whether components within an application are enabled.
- Click Next.
- For Query or Static Values:
- For Create List, specify whether to create a list region:
See Also:
Parent topic: Creating Dynamic Lists