Application Builder includes a built-in wizard for generating a tree. Trees use jsTree, a JavaScript-based, cross browser tree component that features theme support, optional keyboard navigation, and optional state saving. You can create a Tree from a query that specifies a hierarchical relationship by identifying an ID and parent ID column in a table or view. The tree query utilizes a START WITH .. CONNECT BY
clause to generate the hierarchical query.
Tip:
The creation of jsTree regions is only possible on pages using a Desktop user interface.To create a tree using a wizard:
On the Workspace home page, click the Application Builder icon.
Select an application.
Click Create Page and click Next.
For Page Type, select Tree.
For Page Attributes, specify the following:
Page Number - Specify the page on which the tree should be created.
Page Name - If the tree will be created on a new page, enter the page name.
Region Template - Select a region template for the tree region.
Region Name - Enter a name for the region to contain the tree.
Breadcrumb - Select whether you want to use a breadcrumb navigation control on your page, and which breadcrumb navigation control you want to use. If you select Breadcrumb, enter the following:
Entry Name - Enter a name for the breadcrumb entry.
Select Parent Entry - Select a parent entry.
Click Next.
For Tab, specify whether the page should have tabs and click Next.
For Tree Templates, select a tree template and click Next.
For Table/View Owner and Name, select the table or view owner and name on which to base the tree and click Next.
For Query, select the columns to include in the tree:
ID - Select the column to use as the ID.
Parent ID - Select the column to use as the parent ID.
Node Text - Select the text to appear on the tree nodes.
Start With - Select the column to be used to specify the root of the hierarchical tree query.
Start Tree - Choose how to start your query. Options include:
Based on Existing Item - Select an existing application or page item.
Based on a SQL Query - Enter a SQL query that returns a single row or single column.
Based on a Static Value - Enter a static value.
Value is NULL
.
Click Next.
For Where and Order by, specify the following:
Where Clause - Enter an optional WHERE
clause.
Order Siblings By - Select the columns by which siblings are ordered.
Click Next.
For Tree Attributes, specify the following:
Include Buttons - Select the buttons to include.
Selected Node Page Item - Can be used to hold the selected node value. If you select an application item, you can use this item to save the tree state, by holding the last selected node of the tree.
Tooltip - Displays a tooltip when the mouse hovers over a leaf node. Options include:
Static Assignment - Specifies a static value to be used as the tooltip text. Substitution strings can be used in the static text, to incorporate information from the SQL query in the tooltip text. The following substitution strings can be used:
#VALUE#
- refers to the value of ID column.
#TITLE#
- refers to the value of Node Text column
#LINK#
- refers to the value of Link option
Database Column - Select the column to use as the tooltip text.
Link Option:
Existing Application Item - Makes the leaf node text a link. If you select this option, you must specify a page to link to and an existing application item to link leaf node text.
This option only appears if you select the Existing Application Item link option.
Nothing
Click Next.
Confirm your selections and click Finish.
By default, a tree does not have focus and node links are activated with a single click action. This section describes how developers can customize a tree by editing tree attributes.
Developers can customize a tree by editing attributes on the Tree Attributes page.
To access the Tree Attributes page:
Navigate to the appropriate Page Definition. See "Accessing the Page Definition".
Access the Tree Attributes page:
Tree view - Right-click the Region name and select Edit Tree.
Component View - Under Regions, click the Tree link next to the name of the tree region you want to edit.
The Tree Attributes page appears and is divided into the following sections:
Display Settings enable you control a tree's appearance and functionality. Use these settings to define a tree template, tooltip, a page item to hold the last selected node value for saving tree state, determine whether the tree has focus on page load, and what action activates node links on a tree.
Query enables you to edit the SQL query underlying the tree. The query must be in the following format:
SELECT status, level, name, icon, id, tooltip, link FROM ... WHERE ... START WITH... CONNECT BY PRIOR id = pid ORDER SIBLINGS BY ...
To learn more about a specific attribute, click the item label.
When help is available, the cursor changes to an arrow and question mark when you pass the cursor over an item. See "About Field-Level Help".
Click Apply Changes.
Previous releases of Oracle Application Express supported the creation of trees as Shared Components. Although existing trees are still supported, Oracle Application Express no longer supports the creation of trees as Shared Components.
Oracle Application Express now supports the generation of a jsTree tree region. jsTree is a JavaScript based, cross browser tree component. It is packaged as a jQuery plug-in. To learn more, see "Creating Trees".
Once you create a tree as a Shared Component, you can edit it on the Trees page.
To edit a tree created as a Shared Component:
Navigate to the Trees page:
Navigate to the Workspace home page.
Click the Application Builder icon.
Select an application.
On the Application home page, click Shared Components.
Under Navigation, click Trees.
The Trees page appears.
You can change the appearance of the page by using the Search bar at the top of the page. See "Customizing Interactive Reports".
Select a tree.
The Edit Tree page appears.
Edit the appropriate attributes.
To learn more about a specific item on a page, click the item label. See "About Field-Level Help".
Click Apply Changes.
The Edit Tree page is divided into the following sections: Name, Query, Before and After, Static Node Templates, Dynamic Templates, Node Text Templates, and Link Templates.
You can access these sections by scrolling down the page, or by clicking a navigation button at the top of the page. When you select a button at the top of the page, the selected section appears and all other sections are temporarily hidden. To view all sections of the page, click Show All.
You can view the Trees Utilization and Tree History reports by clicking the appropriate tab at the top of the Trees page.
To view tree reports:
Navigate to the Trees page:
Navigate to the Workspace home page.
Click the Application Builder icon.
Select an application.
On the Application home page, click Shared Components.
Under Navigation, click Trees.
Click the appropriate tab:
Utilization
History
You can change the appearance of the page by using the Search bar at the top of the page. See "Customizing Interactive Reports".
To learn more, see the sections that follow.
Note:
The Utilization and History buttons only appear after you have created a tree.Click Utilization on the Trees page to access the Tree Utilization report. This report displays all trees included in the current application. To edit a tree, select the tree name.
Click History on the Trees page to view changes to trees by developer and date.