Hierarchical tree in forms 10g
dear member.
i am a beginner. and want to know about that how to make hierarchical form
i am using developer suit 10g.
thanks
mustafa
lahore,pakistan
Mustafa,
the way u have marked the node_id and parent_node_id in the two tables, it is done at form level. or what... this is a little confusing to me, i have to apply that ht form at other schema.Yes, I create Record Group that populates the HT in the When-New-Form-Instance (WNFI) trigger. You can populate an HT from just about anywhere, but I use the WNFI to ensure the tree is populated when the form loads.
To add a "Grandchild" node to your tree, you simply need to modify the WNFI trigger and add a Loop for these nodes. Using your data as an example, the code in the WNFI would look something like this (not tested):
DECLARE
CURSOR c_comp IS
SELEC T compcode, name
FRO M company;
CURSOR c_div (p_comp NUMBER) IS
SELEC T div_id, div_name, dept_id
FRO M s_div
WHER E compcode = p_comp;
CURSOR c_dept (IS
SELEC T dept_id, dept_name
FRO M s_dept
WHER E dept_id = p_dept;
n_level NUMBER := 1;
n_row NUMBER := 1;
rg_id RECORDGROUP;
node Ftree.Node;
BEGIN
Tree_Control.v_item_name := 'MY_TREE_DATA.MY_TREE';
rg_id := Tree_Control.Create_RG;
<<parent>>
FOR r_comp IN c_comp LOOP
-- Add Parent Company
Tree_Control.ADD_RG_ROW(rg_id, ftree.collapsed_node, n_row,
n_level, r_comp.name, null, r_comp.compcode);
n_row := n_row + 1;
n_level := n_level + 1;
-- Add any child Department records
<<child>>
FOR r_div IN c_div(r_comp.compcode) LOOP
Tree_Control.ADD_RG_ROW(rg_id, ftree.collapsed_node, n_row,
n_level, r_div.div_name, null, r_div.div_id);
n_row := n_row+1;
-- Now, add any Grandchildren
<<grandchild>>
FOR r_dept IN c_dept(r_div.dept_id) LOOP
Tree_Control.ADD_RG_ROW(rg_id, ftree.collapsed_node, n_row,
n_level, r_dept.dept_name, null, r_dept.dept_id);
END LOOP grandchild;
END LOOP child;
END LOOP parent;
ftree.Add_Tree_Data(Tree_Control.v_item_name, ftree.ROOT_NODE,
ftree.PARENT_OFFSET, ftree.LAST_CHILD,
ftree.RECORD_GROUD, rg_id);
END;You will still need to modify the Create_RG function in the Tree_Control package to support the above changes, but this code sample should get you started.
Craig...
Similar Messages
-
How to call forms using Hierarchical Tree in Forms 10g?
I know how to call forms from menu that attached to a top form.
I would like to call forms using Hierarchical Tree. Does any one know how where I can find some instructions on using Hierarcical Tree to call other forms? Any discussion is welcome. Thanks.Thanks to Francois.
The exampe with clear instructions and I can build tree that calls forms now.
I add a OPEN_FORM statement in WHEN-TREE-NODE-ACTIVATED trigger
Declare
LN$I Pls_integer ;
Begin
:Ctrl.Node_Activated := Ftree.Get_Tree_Node_Property('BL_TREE.MENU', :SYSTEM.TRIGGER_NODE, Ftree.NODE_VALUE) ;
If :Ctrl.Node_Activated IS NOT NULL Then
Set_Alert_Property( 'AL_CALL_FORM', ALERT_MESSAGE_TEXT, 'Calling module : ' || :Ctrl.Node_Activated ) ;
LN$I := Show_Alert( 'AL_CALL_FORM' ) ;
open_form(:Ctrl.Node_Activated);
End if ;
End ;
Or call physical form path by:
open_form('c:\tree\'||:Ctrl.Node_Activated ||'.fmx');
I enter the VALUE of MENU as the Form fmx name and it works very well.
Thanks so much. -
Using hierarchical tree in developer 10g
Hi all
how can we use hierarchical tree in developer 10g any white paper will be helpfull
thanksHello
<p>Here is a first sample<br>You could probably find others on this forum or by Googling<p>
Francois -
Hi,
I have a hierarchal tree table that I want to represent using forms (insert and update data in the tree table).
Are there any LINKS or documentation that can help me with my little project :-)
Thanks,
Marc.The help file has a fairly detailed description of how to manipulate the tree control.
Provided you have a table that can do this I would do "connect by prior" and "start with" SQL statement and use the pseudo column called "level" to determine when to create a new sub tree and when to end it. -
Creating a Hierarchical Tree in Forma 6i
Hi Gurus,
We are using forms 6i and oracle 9i. In oracle forms i have one control block and another control block. When we click on one column repname ,the other control block displays the
corresponding info for the sales rep name. eg. Lets say i pick John the salesrep in the other
control block it displays its code,geography region etc.
I want to create a hierarchical tree in the other block where it is displaying the salesrep info.
So i want when i click on the sales rep name(the other control block measure)
then it should the code,geography region etc in the form of hierarchical tree in the other control
block. If the sales rep name is not clicked then the control block having the salesrep info should be hidden.
I would appreciate your help.
Thanks,
PSOplace your treeitem in the layout. The treeitem has to the only item in the block and property "Single record" has to be true.
To populate your tree with data you can either
- use a query to populate a treeitem have a look at this thread Tree Menu
- use the Ftree.Add_Tree_Node built-in and program your own logic. -
in my oracle forms application i'm working with hierarchical
trees; every time the tree displays all the nodes are expanded,
but i want all of them to be collapsed, i tried to set the
properties of the tree with ftree.collapsed_node, but i only got
an error message that i didn't select any node.
Can somebody help me?
nullDear Friend,
Try this piece of code this will solve your problem
tree_item:=find_item('your tree item');
find_node:=ftree.find_tree_node(tree_item,'your_Node_name',
ftree.find_next,ftree.node_label,
ftree.root_node,ftree.root_node);
ftree.SET_TREE_NODE_PROPERTY
(tree_item,find_node,ftree.node_state,ftree.collapsed_node);
do the neccessary changes and apply
bye
Vishnu Vadla
null -
URGENT *** Hierarchical Tree in Forms 9i *** URGENT
Hello everybody,
for my company I need to build a hierarchical tree item, that will display static data over three levels. Let's say: departments, employees and employee projects.
How do I fill the Item?
When do I fill the Item?
Where do I fill the Item?
What are the elements of the SQL query, that fills the hierarchical tree?
Any help will be appreciated
[email protected]Note:210663.1 helped a bit.
I used the database column as the third element in the select part and put NULL as the fifth element. Then it worked.
Now I am looking for the way to add the employees, when the user selects / activates a department node. -
Problem creating a hierarchical tree in forms builder[issue with the query]
Hi all,
I have 2 tables.
box (box_id, box_name)
item(item_id, item_name, box_id)
In a box there are several items.
I want to create a hierachical tree to display items that are present in each box.
LIKE:
|---BOX1
| |----ITEM 1
| |----ITEM 2
|
|---BOX2
| |----ITEM 1
| |----ITEM 2
Currently i am trying this query:
SELECT -1 state, box_name, 'icon' icon, box_id val
from box b, item i;
I don't know what value to put for level, i don't know how to code the 'connect by prior' part.
Could you please advise me?
Michaël.
PS. Then i will eventually use this query in forms builder.Hi MichaelR
i get the FRM - 47321 error in forms builder ..
Hence In order to populate a tree, the Select order must retrieve 5 columns:
STATUS, LEVEL, LABEL, ICON, VALUE u should notice this orders in ur Query this will solve the error and pls notice that the...
My advice is to use the On Line help in ur forms builder to help u in this ...
Initial state : number
Node tree depth : number
Label for the node : varchar2
Icon for the node : varchar2
Data : varchar2This should be in WHEN-NEW-FORM-INSTANCE-trigger in order to populate ur tree...
another thing why don't u think of building ur tree as i did here in the following example...Pls have a look here ....
Hope this helps...
Regards,
Amatu Allah. -
Hi,
This is the first thread am posting. I searched ur discussions for "How to show the hierarchical tree in forms 10g with different colours and in different fonts weigth for different nodes". But i found nothing.
Hopefully looking forward for your replies.You should use a less specific search string if you don't find anything first time but in this case it won't have helped you.
You can set an icon for each node in the tree, which might be an acceptable alternative to writing lots of java.
The icon can be set as a property
http://www.oracle.com/webapps/online-help/forms/10g/topics/f1_help/builts/set_tree_node_property_built_in.html?tp=true
or it can be built into the select statement that creates the tree (if your tree is query-driven). -
I would like to Know concept of Hierarchical Tree of forms 6i. What query should be written in the record group to populate the tree and how to implement hierarchical tree to make the form act like Windows Explorer .
Thank You.Read the documentation. Here is a sample query to load the record group.
PROCEDURE prc_populate_record_group
IS
CURSOR g IS
SELECT groupnum,
groupnm
FROM merch_group
ORDER BY groupnm;
CURSOR c (l_groupnum NUMBER) IS
SELECT categorynum,
categorynm
FROM merch_group_category
WHERE groupnum = l_groupnum
ORDER BY categorynm;
i NUMBER;
l_rg_id RECORDGROUP;
l_init_state GROUPCOLUMN;
l_level GROUPCOLUMN;
l_label GROUPCOLUMN;
l_icon GROUPCOLUMN;
l_value GROUPCOLUMN;
l_node ftree.node;
l_next_node ftree.node;
l_tree_item ITEM;
BEGIN
l_rg_id := FIND_GROUP('PRC_GROUP_CAT');
IF NOT ID_NULL(l_rg_id)
THEN
DELETE_GROUP(l_rg_id);
END IF;
l_rg_id := CREATE_GROUP('PRC_GROUP_CAT');
l_init_state := ADD_GROUP_COLUMN(l_rg_id, 'init_state', NUMBER_COLUMN);
l_level := ADD_GROUP_COLUMN(l_rg_id, 'level', NUMBER_COLUMN);
l_label := ADD_GROUP_COLUMN(l_rg_id, 'label', CHAR_COLUMN, 40);
l_icon := ADD_GROUP_COLUMN(l_rg_id, 'icon', CHAR_COLUMN, 20);
l_value := ADD_GROUP_COLUMN(l_rg_id, 'value', CHAR_COLUMN, 40);
i := 1;
FOR g_rec IN g
LOOP
ADD_GROUP_ROW (l_rg_id, i);
SET_GROUP_NUMBER_CELL(l_init_state, i, -1);
SET_GROUP_NUMBER_CELL(l_level, i, 1);
SET_GROUP_CHAR_CELL(l_label, i, g_rec.groupnm| |' - '| |g_rec.groupnum);
SET_GROUP_CHAR_CELL(l_icon, i, NULL);
SET_GROUP_CHAR_CELL(l_value, i, g_rec.groupnum);
i := i + 1;
FOR c_rec IN c (g_rec.groupnum)
LOOP
ADD_GROUP_ROW (l_rg_id, i);
SET_GROUP_NUMBER_CELL(l_init_state, i, -1);
SET_GROUP_NUMBER_CELL(l_level, i, 3);
SET_GROUP_CHAR_CELL(l_label, i, c_rec.categorynm| |' - '| |c_rec.categorynum);
SET_GROUP_CHAR_CELL(l_icon, i, NULL);
SET_GROUP_CHAR_CELL(l_value, i, c_rec.categorynum);
i := i + 1;
END LOOP;
END LOOP;
--Find the tree
l_tree_item := find_item('CONTROL.TREE4');
-- Assign record group to item causing the data to display
ftree.set_tree_property(l_tree_item, ftree.record_group, l_rg_id);
-- Find the root node of the tree
l_node := ftree.find_tree_node(l_tree_item, '');
END;
null -
Finding proper help on Hierarchical Trees
Have spent a couple of hours trying to navigate the sprawling website of oracle.com with the purpose finding and then downloading the appropriate help file. I downloaded
Oracle9i Developer Suite Release 2 Documentation Library
from
http://www.oracle.com/technology/documentation/ids.html
Its about 130Mb, installed it, but could i find comprehensive documentation on using Forms 9i (in particular Hierarchical Trees) no, but everything else it seemed yes. The original doc that pre-installed with the 9i DS 'online help' is reasonably helpful but like some others on this forum I could not find proper help on how to use Hierarchical Trees all i could find was few descriptive portions of text and believe me i have looked.
Others have said they found examples of Hierarchical Trees usage i can only assume they are using 10g. So this is a desperate plea to you. Can you point me to an online resource that deals with Hierarchical Trees in Forms 9i (intro, usage, examples, etc). If you can i would deeply appreciate it.
Mr Frustrated :)Hi,
You have a lot of sample With the Forms Help.
If you search in the index with "htree."
The command hierarchical tree complete list appear.
L. -
Dear Sir,
I need to know whether I can use hierarchical trees in Forms 6.0. If yes, please send me the instruction to do.
And I need to know Client-Server architecture Application deployment.
Thanks in Advance.This forum is for feedback about OTN services and content. Please post your question in the Oracle Forms forum:
Forms -
Connect by prior working in sql but not in forms 10g hierarchical tree
Hello Friends,
I have the following connect by prior example which is working in sql command prompt but not in Forms 10g hierarchical tree item type. Can you please let me know why ?
configuration: Forms 10g patchset 10.1.2.0.2 and oracle 11g database on windows 7
SQL> SELECT 1 InitialState,
2 level Depth,
3 labeller NodeLabel,
4 NULL NodeIcon,
5 to_char(reportno) NodeValue
6 FROM reports where formname = 'billinin.fmx' or reportno > 9999
7 start with reportno > 9999
8 CONNECT BY PRIOR reportno = labelno
9 /
INITIALSTATE DEPTH NODELABEL N NODEVALUE
1 1 FIRST 10000
1 2 report1 UD Label 1
1 2 report2 UD Label 2
1 2 report3 UD Label 3
1 1 SECOND 10001
1 1 THIRD 10002
If I write this command in forms hierarchical tree, then it is working, why not the above code ?
SQL> SELECT 1 InitialState,
2 level Depth,
3 labeller NodeLabel,
4 NULL NodeIcon,
5 to_char(reportno) NodeValue
6 FROM reports
7 start with reportno > 9999
8 CONNECT BY PRIOR reportno = labelnoThanks Room,
This command worked ! I will put the sample working code here. It will help you to filter the records in a tree in sql command prompt as well as in forms hierarchical tree 10g.
SELECT 1 InitialState,
level Depth,
labeller NodeLabel,
NULL NodeIcon,
to_char(reportno) NodeValue
FROM reports
start with reportno > 9999
CONNECT BY PRIOR reportno = labelno
AND FORMNAME = :reports.testitem -
Hierarchical tree in web forms 10g - form freezing
I have an application with an hierarchical tree on one of the forms - the application worked fine as client/server back in forms 6 but now that it is web enabled in 10g there are problems with the tree causing the form to freeze, then the entire application has to be closed. It doesn't seem to matter if you are selecting a node or creating a new node both have caused the form to freeze. It doesn't happen all of the time but it seems that the longer the application has been in use the more it starts to freeze. Any ideas? Is there a known problem with trees in web forms? Thanks
JoanneAt the root of my tree is a patient (I work in the health care industry) and then for that patient there are clinic visits, surgeries, etc (there are 16 nodes at this level). and under each of these are dates when the visits occured (there can be an unlimited number of nodes at this level). This is some of my code for populating the tree:
if :GLOBAL.patient_seq is not null then
-- turn the tree on
set_item_property('tree_block.tree_item', ENABLED, PROPERTY_TRUE);
set_item_property('tree_block.tree_item', NAVIGABLE, PROPERTY_TRUE);
lv_tree_id := find_item('TREE_BLOCK.TREE_ITEM');
--refresh the tree back to it's original state from the database
Ftree.Set_Tree_Property(lv_tree_id,
Ftree.RECORD_GROUP,
FIND_GROUP('TREE_GROUP'));
-- create the clinic visits branch
wcchn_tree_items_pkg.get_visits(lv_visit_table, :global.patient_seq);
for lv_counter in 1.. lv_visit_table.count loop
lv_site := wcchn_locations_pkg.get_location_code(lv_visit_table(lv_counter).site);
create_visit_node( lv_visit_table(lv_counter).visit_date || ' - ' || lv_site,
lv_tree_id,
lv_visit_table(lv_counter).seq_nr);
end loop;
Below is the procedure referred to in the above segment of code:
PROCEDURE CREATE_VISIT_NODE (pi_date IN VARCHAR2, pi_tree_id IN ITEM, pi_seq IN NUMBER) IS
lv_return_value NUMBER;
lv_node_value varchar2(100);
lv_search_node FTREE.node;
BEGIN
lv_search_node:=FTREE.Find_Tree_Node(pi_tree_id, 'CLINIC VISITS', FTREE.FIND_NEXT, FTREE.NODE_LABEL, FTREE.ROOT_NODE, FTREE.ROOT_NODE);
lv_node_value:='G' || to_char(pi_seq);
if :GLOBAL.ACTION_INDICATOR = 'INSERT' then
lv_return_value:=FTREE.Add_Tree_Node(pi_tree_id, lv_search_node, FTREE.PARENT_OFFSET, 1, FTREE.LEAF_NODE, pi_date, NULL, lv_node_value);
else
lv_return_value:=FTREE.Add_Tree_Node(pi_tree_id, lv_search_node, FTREE.PARENT_OFFSET, FTREE.LAST_CHILD, FTREE.LEAF_NODE, pi_date, NULL, lv_node_value);
end if;
FTREE.Set_Tree_Node_Property(pi_tree_id, lv_search_node, FTREE.NODE_STATE, FTREE.EXPANDED_NODE);
END; -
Hierarchical tree not showing up while running the form
Hi Gurus,
I have a problem while running forms in 10g AS.
The hierarchical tree control is showing up when I run the form in my local development (win xp) system. But, when I run the same form through my 10g Application server(linux), the hierarchical tree control is not showing up.
Can anyone suggest some solutions ?
Thanks in advance.
Sundar KHi Andreas,
Thanks for the reply.
The form shows a blank square-box, instead hiearchical tree. I can see other controls like text-box, LOV, command button on the same form.
The java console shows,
Downloading http://test.abits.com:7778/forms/java/frmall_jinit.jar to JAR cache
Downloading http://test.abits.com:7778/forms/java/f60tree.jar to JAR cache
proxyHost=null
proxyPort=0
connectMode=HTTP, native.
Forms Applet version is : 10.1.2.0
The problem persist, even though I change the appsweb.cfg file to use frmall.jar instead of frmall_jinit.jar.
I'm using 10g application server (iAS 10.1.2.0.2).
Kindly advise. Thanks in advance.
Sundar K
Maybe you are looking for
-
How to hibernate Windows 7 ?
Running Win 7 in dual boot with XP sp3 on my desktop. In my city Electricity Supply is inconsistent so I simply hibernate my xp & switch off the ups before leaving. In Win 7 I have to shut it down everytime I leave for fear that electricity may go ou
-
And i Use Windows 7
-
i have 3 stuck pixels on my screen. Can i use my warranty for this? what is the policy of Apple about the stuck pixels? Thanks
-
Exchanging photos between mac air and iPod touch
I have recently switched to using mac. I want to find out how to transfer pic from ipod touch to mac air and from air to ipod touch without using the itune sync. Also, before i used the sync. in itune to transfer pics from mac to ipod touch before a
-
set colsep , heading off echo off feedback off linesize 5000 spool data_dictionary.csv select a.table_name, a.column_name, a.column_id, a.data_type, a.data_length, a.data_precision, a.data_scale, a.nullable, b.comments from user_tab_columns a, user_c