18.7 Creating Lists

This section explains how to add shared collection of links (or list) to a database application. You add a list to a page by creating a region and specifying the region type as List. You control the appearance of a list through list templates.

See Also:

s

18.7.1 About Creating Lists

Oracle Application Express supports two types of lists:

  • Static Lists - When you create a static list you define a list entry label and a target (either a page or URL). You can add list entries when you create the list (creating from scratch), by copying existing entries, or by adding the list entries. You can control when list entries display by defining display conditions.

  • Dynamic Lists - Dynamic lists are based on a SQL query or a PL/SQL function executed at runtime. A dynamic list enables you to dynamically create styled list items that support mobile frameworks such as jQuery Mobile.

The list definition displays a specific type of page item, such as progress bars, sidebar, bullet navigation list, or navigation menu. You can control how a list displays through templates.

18.7.2 About Navigation Menus

Older themes provide navigation support through the creation of tabs. Newer themes, such as Universal Theme - 42, provide navigation support through the creation of navigation menus. If the theme you are using supports navigation menus, you can create navigation menus automatically when running the Create Application Wizard. The Sample Database Application incudes a navigation menu that displays in a sidebar.

Description of sample_home.png follows
Description of the illustration ''sample_home.png''

Navigation menus support the creation of hierarchical sub-menus. You can render a navigation menus either at the top of the page as tabs or as a side bar (as shown in the previous example). Navigation menus displaying as a side bar are responsive. Based on the available space, the navigation bar displays a full menu or collapses to a narrow icon bar. Side navigation menus are controlled ay the theme and user interface level.

You can select an alternative list template or change the position of a navigation menu by editing User Interface Details. You can configure the available navigation menu list templates by editing the theme.

About Switching from Tabs to Navigation Menus

Developers can switch from a theme using tabs to a theme using navigation menus if the existing application used one level of tabs was used. If an existing applications uses two levels of tabs, you must convert it to one level before changing the theme.

18.7.3 Creating Static Lists

This section explains about to create a static list.

18.7.3.1 About the Process of Creating a Static List

The process of creating a static list involves the following steps:

  • Step 1: Create the list by running the Create List Wizard.

  • Step 2: Specify whether to create the list from scratch or by copying an existing list.

    You can add list entries by either creating them from scratch or by coping entries from an existing list. If you copy an entire list, you also copy all of its list entries.

  • Step 3: If creating a list from scratch, you are prompted to select a list type. Select Static.

    Each list element has a display condition, which enables you to control when it displays. You can define a list element to be either current or non-current for a specific page.

  • Step 4: Add the list to a page by creating a List region.

How you perform these steps is a personal preference. You can perform the first three steps when you run the Create List Wizard. Alternatively, you can perform these steps one at a time.

18.7.3.2 Creating a Static List from Scratch

To create a list from scratch:

  1. Access the Create/Edit Lists Wizard:

    1. On the Workspace home page, click the Application Builder icon.

    2. Select an application.

    3. On the Application home page, click Shared Components.

    4. Under Navigation, click Lists.

    5. Click Create.

  2. For Source, select From Scratch and click Next.

  3. For Name and Type:

    1. Name - Enter a numeric or alphanumeric name for the list.

    2. Type - Select Static.

    3. 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.

    4. Click Next.

  4. For Define List Entries, specify the following:

    1. List Entry Label - Enter a numeric or alphanumeric name for the list.

    2. Target Page ID or custom URL - Select a target page or enter a custom URL.

    3. Click Next.

  5. For Confirm, specify the following:

    1. Create List Regions - Select whether to create a list region. Options include:

      • Do not create list region(s)

      • Create list region on current page

      • Create list region for each target page

    2. Region Position - If creating a new region, select the region position.

    3. Region Template - If creating a new region, select a region template.

    4. List Template - Select the list template to use to control the appearance of your list.

    5. Click Create List.

18.7.3.3 About Adding Entries and Sublists to a Static List

Once you create a list, you must add entries to it. You can add list entries when creating a list from scratch, copying a list entry from within a list, or copying existing entries from one list to another.

You can also create hierarchical lists that contain sublists. To create a hierarchical list, you must:

  • Select a list template that supports hierarchical lists. To determine which list templates support hierarchical lists, look for templates having the naming convention "with Sublist."

  • Select a Parent List Item when you create each list entry.

18.7.3.4 Adding Entries or Sublists from Scratch

To add an entry or sublist from scratch:

  1. Navigate to the Lists page:

    1. On the Workspace home page, click the Application Builder icon.

    2. Select an application.

    3. On the Application home page, click Shared Components.

    4. Under Navigation, select Lists.

      The Lists page appears.

  2. Select a list.

    The List Details page appears.

  3. Click Create List Entry.

  4. Under Entry:

    1. Parent List Entry - If applicable, select the parent for this list entry. Use this attribute if you are creating a hierarchical list that contains a sublist.

      Note this attribute does not appear if you are creating the parent list entry.

    2. Sequence - Indicate the order in which list the list entry appears. The sequence determines the order of evaluation.

    3. Image - Identify the file name for the image used to display this list entry. List templates control this attribute.

    4. Attributes - Identify the image attributes (such as width="12" height="12") for the list element image.

      Use the #LIST_LABEL# substitution string to reference the list label text. This substitution string enables the title image attribute to be automatically set based on the value of the list label text. For example:

      title="#LIST_LABEL#"
      
    5. Alt Attribute - Identify the image alt attribute for the list element image.

      Use the #LIST_LABEL# substitution string to reference the list label text. This substitution string enables the Alt attribute to be automatically set based on the value of the list label text. For example:

      ...alt="#LIST_LABEL#"...
      
    6. List Entry Label - Enter the label text for this link.

  5. Specify a target type. Options include: URL or Page in this Application.

    If the target location is a URL, specify the following:

    1. Target Type - Select URL.

    2. URL Target - Enter a URL. For example:

      http://www.yahoo.com
      

    If the target location is a page:

    1. Target Type - Select Page in this Application.

    2. Page - Specify the target page number.

      Other options include:

      • reset pagination for this page - Select this option to have the page to return to the first set of data meeting a user's new query.

      • Printer Friendly - This option displays the target page using the application's Printer Friendly template. Printer friendly templates optimize a page for printing. "Editing Themes" and "Optimizing a Page for Printing."

    3. Request - Enter text to set the built-in application item REQUEST. This is also the item that is set with the name of a button that was clicked.

    4. Clear Cache - Specify the page numbers on which to clear cache.

      To learn more about an attribute, see field-level Help. See "Viewing Field-Level Help."

    5. To set session state (that is, give a listed item a value):

      • Set these items - Enter a comma-delimited list of item names for which you would like to set session state.

      • With these values - Enter a comma-delimited list of values for the items specified in the previous step.

        You can specify static values or substitution syntax (for example, &APP_ITEM_NAME.). Note that item values passed to f?p= in the URL cannot contain a colon. Additionally, item values cannot contain commas unless you enclose the entire value in backslashes (for example, \1234,56\).

  6. Under Current List Entry:

    1. List Entry Current for Pages Type - Specify when this list entry should be current based on the page type.

      List items can be current or non-current. Current list items use the current template; non-current list items use the non-current list item template. The actual condition and templates are defined in subsequent attributes.

    2. List Entry Current for Condition - Displays conditionally. Based on the selection above, define a condition to evaluate. When this condition is true, then the list item becomes current.

      To learn more about an attribute, see field-level Help. See "Viewing Field-Level Help."

  7. Under Conditions, specify the appropriate information to make the list entry conditional.

  8. Under Authorization, you can specify an authorization scheme.

    This authorization scheme must evaluate to TRUE in order for this component to be rendered or otherwise processed.

  9. Under Configuration, select a build option for this component.

    Build options are predefined settings that determine whether components within an application are enabled.

  10. Under Click Counting, specify if you want the list entries to be included in the click count.

    If this is a link to an external page, such as www.google.com, you can count clicks. For more information, see "COUNT_CLICK Procedure" in Oracle Application Express API Reference.

  11. To specify additional attributes, use the User Defined Attributes section. For example, the following adds a tabindex and accesskey.

    tabindex="15" accesskey="D"
    
  12. When you are finished defining list attributes, click Create or Create and Create Another.

18.7.3.5 Copying Static List Entries Between Lists

You can copy static list entries from one list to another.

To copy list entries between lists:

  1. Navigate to the Lists page.

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. On the Application home page, click Shared Components.

    5. Under Navigation, click Lists.

      The Lists page appears.

  2. Select the list to copy.

  3. On the Tasks list, click Copy List Entries from one List to Another.

  4. From Copy List Entries, select the list to copy to and click Next.

  5. Click Copy List Entries.

18.7.3.6 Reparenting Static List Entries

Use the Reparent List Entries page to manage list entry hierarchy.

To reparent list entries:

  1. Navigate to the Lists page.

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. On the Application home page, click Shared Components.

    5. Under Navigation, click Lists.

      The Lists page appears.

  2. Select the list.

  3. From the Tasks list, click Reparent List Entries within this List.

  4. Use Start With to restrict your view to a subset of hierarchy. Make a selection and click Go.

  5. From Reparent To, select a new parent.

  6. Select the entries to move.

  7. Click Reparent Checked Entries.

18.7.3.7 Managing Orphaned Static List Entries

An orphaned list entry is a list entry which has a parent, but the parent is no longer a member of the current list. When a list entry becomes orphaned, remove the parent entry.

To manage orphaned list entries:

  1. Navigate to the Lists page.

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. On the Application home page, click Shared Components.

    5. Under Navigation, click Lists.

      The Lists page appears.

  2. Select the list.

  3. From the Tasks list, click Manage Orphaned List Entries.

  4. Select the entries to remove.

  5. Click Clear Parent Entries.

18.7.3.8 Resequencing Static List Entries

You can resequence list entries in increments of 10 on the Clean Up page.

To clean up list entries:

  1. Navigate to the Lists page.

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. On the Application home page, click Shared Components.

    5. Under Navigation, click Lists.

      The Lists page appears.

  2. Select the list.

  3. From the Tasks list, click Clean Up List Entries.

  4. Click Clean Up.

18.7.4 Creating Dynamic Lists

This section explains about to create a dynamic list.

18.7.4.1 About the Process of Creating a Dynamic List

A dynamic list enables you to dynamically create styled list items that support mobile frameworks such as jQuery Mobile. Dynamic lists are based on a SQL query or a PL/SQL function returning a SQL query.

The process of creating a dynamic list involves the following steps:

  • Step 1: Create the list by running the Create List Wizard.

  • 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.

18.7.4.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 and labelvalue are required.

  • level - For hierarchical lists, the level parameter should be supplied. For non-hierarchical lists, this parameter can be set to NULL.

  • 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 Image ALT tag, required for accessibility purposes in templates where the user must click the image.

  • attribute1 to 10: These attributes tie in with the existing ten User Attributes exposed on the Static List Entry page.

18.7.4.3 Creating a Dynamic List from Scratch

To create a dynamic list:

  1. Access the Create/Edit Lists Wizard:

    1. On the Workspace home page, click the Application Builder icon.

    2. Select an application.

    3. On the Application home page, click Shared Components.

    4. Under Navigation, click Lists.

    5. Click Create.

  2. Click From Scratch and click Next.

  3. For Name and Type:

    1. Name - Enter a numeric or alphanumeric name for the list.

    2. Type - Select Dynamic.

    3. 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.

    4. Click Next.

  4. For Query or Static Values:

    1. Query Source Type - Select SQL Query or Function Returning SQL Query.

    2. Query - Enter a SQL query or function returning a SQL query. To view SQL Query examples, expand the Examples region.

    3. Build Query - Click Build Query to use a wizard to build a query on the table or view you select. Follow the on-screen instructions.

    4. Click Next.

  5. For Create List, specify whether to create a list region:

    1. If you select Create list region on current page, the following attribute display:

      • Region Position - If creating a new region, select the region position.

      • Region Template - If creating a new region, select a region template.

      • List Template - If creating a new region, select a list template.

    2. Region Position - If creating a new region, select the region position.

    3. Region Template - If creating a new region, select a region template.

    4. Click Create.

18.7.5 Copying a List

This section discusses how to copy a list. You can copy a list from another application or from a list in the existing application.

18.7.5.1 Copying a List from the Current Application

You can copy list entries from one list to another.

To copy list entries between lists:

  1. Navigate to the Lists page.

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. On the Application home page, click Shared Components.

    5. Under Navigation, click Lists.

      The Lists page appears.

  2. Select the list to copy.

  3. On the Tasks list, click Copy List.

  4. On Copy List, select List in this application and click Next.

  5. For Identify List:

    1. Copy List - Select the list to be copied.

    2. New List Name - Enter a new name for the copied list.

    3. Click Copy.

18.7.5.2 Copying a List Between Applications

You can copy a list from the current application or from another application.

To copy a list:

  1. Navigate to the Lists page.

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. On the Application home page, click Shared Components.

    5. Under Navigation, click Lists.

      The Lists page appears.

  2. Select the list to copy.

  3. On the Tasks list, click Copy List.

  4. On Copy List, select List in another application and click Next.

  5. For Identify List:

    1. Copy From Application - Select the application from which you want to copy a list.

    2. Copy List - Select the list you are copying.

    3. New List Name - Enter a name for the new list.

    4. Click Copy.

18.7.6 Adding a List to a Page

Once you create a list and list entries, the next step is to add it to a page by creating a region and specifying the region type as List.

To add a list to a page:

  1. Navigate to the appropriate page. See "Viewing a Page in Component View".

  2. Under Regions, click the Create icon.

    The Create Region Wizard appears.

  3. For Region, select List as the region type and click Next.

  4. For Display Attributes:

    1. Title - Enter a title for the region. This title displays if the region template you choose displays the region title.

    2. Region Template - Choose a template to control the look of the region.

    3. Parent Region - Defines the parent region to which the new region belongs.

    4. Display Point - Identify a display point for this region.

    5. Sequence - Specify the sequence for this component. The sequence determines the order of evaluation.

    6. Click Next.

  5. For Source:

    1. List - Select the list you want to add.

    2. List Template - Choose a template to control the look of the list. t

    3. Click Next.

  6. For Conditional Display:

    1. Condition Type - Select a condition type from the list that must be met in order for this component to be rendered processed. See "Understanding Conditional Rendering and Processing."

    2. Authorization Scheme - Optionally select an authorization scheme which must evaluate to TRUE in order for this component to be rendered or otherwise processed. See "Providing Security Through Authorization."

    3. Click Create Region.

Repeat these procedures for each page where you would like to add a list.

See Also:

"Creating a New Template" and "List Templates" for information about altering list display

18.7.7 Editing List Attributes

Once you create a list, you can edit it on the Lists page.

To edit a list:

  1. Navigate to the Lists page.

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. On the Application home page, click Shared Components.

    5. Under Navigation, click Lists.

      The Lists page appears.

  2. Select a list.

    The List Details page appears.

  3. To change the list name or build options, click the Edit List button.

  4. To change the list name or build options:

    1. Click the Edit List button.

    2. Edit the appropriate attributes.

    3. Click Apply Changes.

  5. To edit the list sequence, link text, target, or current status for all list entries, click Grid Edit.

    1. To edit the list sequence, link text, target, or current status for all list entries, click Grid Edit.

    2. Edit the appropriate attributes.

    3. Click Apply Changes.

18.7.8 Accessing List Reports

You can view the Unused, Conditional Entries, Utilization, and History reports by clicking the appropriate tab at the top of the Lists page. Note that these reports only display after you create a list.

To view list reports:

  1. Navigate to the Lists page.

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. On the Application home page, click Shared Components.

    5. Under Navigation, click Lists.

      The Lists page appears.

  2. Click the appropriate tab:

    • Unused - Click the Unused tab to identify lists that are not used in the current application.

    • Conditional Entries - Click the Conditional Entries tab to view conditional lists.

    • Utilization - Click the List Utilization tab to access the Utilization report. This report displays all lists included in the current application. From the report, you can:

      • Edit list entries by selecting the list name.

      • View the pages on which the list appears by clicking the number in the Pages column.

      • View the template used with the list by expanding List Template Utilization and then clicking the name to view or edit the list template.

    • History - Click the History tab to view changes to list definitions and list entries by developer and date.