A script-enabled browser is required for this page to function properly.

ADD_TREE_NODE Built-in

Description

Adds a data element to a hierarchical tree item.

Syntax

FUNCTION ADD_TREE_NODE (item_name VARCHAR2,
node
FTREE.NODE,
offset_type
NUMBER,
offset
NUMBER,
state
NUMBER,
label
VARCHAR2,
icon
VARCHAR2,
value
VARCHAR2);

FUNCTION ADD_TREE_NODE (item_id ITEM,
node
FTREE.NODE,
offset_type
NUMBER,
offset
NUMBER,
state
NUMBER,
label
VARCHAR2,
icon
VARCHAR2,
value
VARCHAR2);

Built-in Type unrestricted procedure

Returns NODE

Enter Query Mode no

Parameters

item_name

Specifies the name of the object created at design time. The data type of the name is VARCHAR2 string.

Item_id

Specifies the unique ID that Oracle Forms assigns to the item when created. Use the FIND_ITEM Built-in to return the ID to an appropriately typed variable. The data type of the ID is Item.

node

Specifies a valid node. There is a special value FTREE.ROOT_NODE which can be used to define the root of the tree.

offset_type

Specifies the type of offset for the node. Possible values are:

PARENT_OFFSET

SIBLING_OFFSET

offset

Indicates the position of the new node.

If offset_type is PARENT_OFFSET, then offset can be either 1-n or LAST_CHILD.

If offset_type is SIBLING_OFFSET, then offset can be either NEXT_NODE or PREVIOUS_NODE.

state

Specifies the state of the node. Possible vaues are:

COLLAPSED_NODE

EXPANDED_NODE

LEAF_NODE

label

The displayed text for the node.

icon

The filename for the node’s icon.

value

Specifies the VARCHAR2 value of the node.

ADD_TREE_NODE Examples

/*
** Built-in: ADD_TREE_NODE
*/

-- This code copies a value from a Form item and
-- adds it to the tree as a top level node. The
-- value is set to be the same as the label.

DECLARE

htree ITEM;
top_node FTREE.NODE;
new_node FTREE.NODE;
item_value VARCHAR2(30);

BEGIN
-- Find the tree itself.

htree := Find_Item('tree_block.htree3');

-- Copy the item value to a local variable. 

item_value := :wizard_block.new_node_data; 
 

-- Add an expanded top level node to the tree 

-- with no icon. 


new_node := Ftree.Add_Tree_Node(htree,
Ftree.ROOT_NODE,
Ftree.PARENT_OFFSET,

Ftree.LAST_CHILD, 

Ftree.EXPANDED_NODE, 

item_value, 

NULL, 
item_value); 
END;