Hierarchical Tree Items question, in Oracle9i forms builder ^^;
Hi,I'm kind of new to using the Hierachical Tree item in Oracle9i Forms builder. so anyway,in the book it was explaining how it's done clearly,but, what I want to do using that item is kind of different;
in the book it has the way of making it like a navigator for the items/fields/tables in the database,either by creating a view for those fields by using Select Statements or using the whole table itself.
however,what I'm trying to do is to have that tree list the names of Forms I have already created and probably the list of Reports I got,so it would sort of like a Menu and I could add a trigger to open the form/report once an item in the tree is double clicked on
here's an example of what I'm talking about :
http://i7.photobucket.com/albums/y264/_Crzy_Chck_/Htree.jpg
sorry the screen shot isn't the best ^^;
that's from a company my friend works at,they have that tree as a menu for their forms and reports,once u double click on a form name or a report,it opens up ^^;
I tried google/yahoo,I got the same info I found on the book.
Or you may want to check out this code:
PROCEDURE next_menu(
menu_in IN OUT NUMBER
, master_menu_in IN NUMBER
, master_name_in IN VARCHAR2
, context_menu_in IN VARCHAR2
, node_in IN ftree.node
, no_rows_out IN OUT BOOLEAN )
IS
CURSOR c_menu(
b_master_menu NUMBER
, b_prev_menu NUMBER
, b_context_menu gba_tpivmnu.kmenu%TYPE )
IS
SELECT p.ofnk MASTER
, m.ofnk
, m.napp || m.kfnk_sub napplus
, m.rid
, m.rid_mas
FROM gba_tpivmnu p -- parent menu
, gba_tpivmnu m -- menu
WHERE m.rid_mas = p.rid
AND m.kmenu = b_context_menu
AND (
m.rid_mas = b_master_menu
OR ( b_master_menu IS NULL
AND m.rid_mas IS NULL ) )
AND ( m.rid > b_prev_menu
OR b_prev_menu IS NULL )
ORDER BY m.rid;
r_menu c_menu%ROWTYPE;
l_prev_menu tmenu.kode%TYPE;
l_teller PLS_INTEGER := 0;
new_node ftree.node;
this_node ftree.node;
tree_itm item := FIND_ITEM( tree_item );
l_top_node_name VARCHAR2( 512 );
BEGIN
IF master_menu_in IS NOT NULL
THEN
IF node_in IS NULL
THEN
/* eerste keer, dus dit wordt de bovenste node */
l_top_node_name := master_name_in;
glob.set_current_menu( context_menu_in );
new_node :=
ftree.ADD_TREE_NODE(
tree_itm
, ftree.root_node
, ftree.parent_offset
, ftree.last_child
, ftree.expanded_node
, master_name_in
, 'favorites'
, master_menu_in );
END IF;
LOOP
r_menu.rid := NULL;
OPEN c_menu(
master_menu_in
, l_prev_menu
, context_menu_in );
FETCH c_menu
INTO r_menu;
CLOSE c_menu;
l_teller := l_teller + 1;
l_prev_menu := r_menu.rid;
EXIT WHEN r_menu.rid IS NULL;
this_node :=
ftree.ADD_TREE_NODE(
tree_itm
, NVL( node_in, new_node )
, ftree.parent_offset
, ftree.last_child
, ftree.expanded_node
, r_menu.ofnk
, NULL
, r_menu.napplus );
next_menu(
menu_in => menu_in
, master_menu_in => r_menu.rid
, master_name_in => r_menu.ofnk
, context_menu_in => context_menu_in
, node_in => this_node
, no_rows_out => no_rows_out );
END LOOP;
IF l_teller = 0
THEN
no_rows_out := TRUE;
END IF;
IF l_top_node_name IS NOT NULL
THEN
set_tree_item_top_node( l_top_node_name );
END IF;
END IF;
END next_menu;tree_item contains the name of the tree item you are using. the select statement is based on a table that is like EMP, where one EMP van be another EMP's manager. In this table a menu-option can be another menu-option's master.
this is a recursive function that keeps calling itself untill the query finds no more record.
Good Luck!
Similar Messages
-
Hierarchical tree item - how to improve performance
I'm loading hierarchical tree item with query.
Problem is that it takes very long to load all the items(300, but can be more) to the hierarchical item.
Query takes 0.5 sec., but loading it into the item with Set_Tree_Property(htree, Ftree.RECORD_GROUP
the code:
PL1 := Create_Group_From_Query('pl1', query);
v_ignore := Populate_Group(PL1); -- 0.5 sec
Ftree.Set_Tree_Property(htree, Ftree.RECORD_GROUP, PL1); -- 3 sec.
Does anyone have any idea what to do to improve tree loading?Hello,
try to play a little bit with the state-column of your query. If you only display the first hierarchy level
and set the state of the "hidden" nodes to open, I think ist is the state 1, then it works much faster.
cu
Matthias M|ller -
Question about Test Form Builder
Can someone validate my understanding?
I have an application view which has one service. The parameters for
adding a service is the service name,desc, input schema and output schema.
Now I want to test the service after deploying it.
My understanding is the TestFormBuilder.java will construct the test form
based on the
input schema i defined for the service. Is this correct?
Thanks in advance.Kishore,
TestFormBuilder.java does build the test form, but only for the DBMS adapter.
This class is an example of how you would do this for your Adapter specific
service parameters. It is too error prone to make TestFormBuilder generic
enough for all potential adapters.
Cheers,
Chris
Kishore R wrote:
Can someone validate my understanding?
I have an application view which has one service. The parameters for
adding a service is the service name,desc, input schema and output schema.
Now I want to test the service after deploying it.
My understanding is the TestFormBuilder.java will construct the test form
based on the
input schema i defined for the service. Is this correct?
Thanks in advance. -
Can anyone tell me how to manipulate Oracle9i Forms Builder JavaBeans
Hi,
I tried to include LWMenuBar java class as a javabean in a form. I found problems adding menus and menuitems in runtime to this javabean.
If someone knows how to complete this task please help me.
ByeHi,
Currently, you cannot rename the link to your fillable form to a custom name or the name of the form.
You may want to use third party url utility, such as tinyurl.com to construct an alternate URL to post on facebook comments/notes.
Thanks,
Lucia -
Newbei tries to create hierarchical tree
hi all;
I'm pretty new to the oracle forms and I'm trying to create a system similar to forum.
I have created the following table at the database;
create table tblFrmData(
frmID number(2), -- forum ID
frmNodeID number(5),
frmParentNodeID number(5), -- the NodeID of the parent branch
frmSubject varchar(100), -- the subject ( will be the label of tree)
frmBody varchar(1000), -- the body of the message (will be the data of the tree)
Now I want to create a tree depending on the data in this table
I have created the tree with dragging and droping from the toolbar at forms. The name is tree8. It is in block3.
I have also created a record group and named it as RG. The select statement used while creating the RG was
select -1, frmNodeID, frmSubject,'', frmBody from tblFrmData
after that I have modified when-new-item-instance trigger of tree8 as following
declare
htree ITEM;
begin
htree:=Find_Item('block3.htree8');
Ftree.Set_Tree_Property(htree, Ftree.RECORD_GROUP, 'rg');
end;
this trigger was compiled without error.
when I save the form and try to run it the following error is given! And I do not know how to solve it although I have readed the referances and looked at the old questions in this forum.
frm-32089: trees must be in single row, single item blocks.
hierarchical tree item TREE8
Block: BLOCK3
Form: FORM_TREE
frm-30085:Unable to adjust form for output
I'm waiting for your answers
regards
erdem seherlerJust ensure that the Hierarchical Tree you have created is the only Item present in that Data Block.
Move all other items to a new Data Block. -
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. -
Make an hierarchical Tree in oracle Forms 6i
Hi everybody,
I want to make an hierarchical tree. I work in Forms 6i
I create one non database block e.g. 'Bloc2' then
add hierarchical control item in that. e.g 'Menu'.
I create a record group named 'RG_DATA_TEST'
Before I use a table in this record_group.
I want a tree as this :
- Menu1
Menu1 option1
Menu1 option2
- Menu1 option3
Menu option3 Sub opt 3
+ Menu2
the table 'Menu_tree' is described' :
CREATE TABLE MENU_tree
ID NUMBER(5),
LABEL VARCHAR2(128 BYTE),
ICON VARCHAR2(40 BYTE),
MASTER NUMBER(5),
STATUS NUMBER(1) DEFAULT 1,
VALUE VARCHAR2(128 BYTE)
Here the data in the table :
INSERT INTO MENU_tree ( ID, LABEL, ICON, MASTER, STATUS, VALUE ) VALUES (1, 'Menu1', 'mainmenu', NULL, 1, NULL);
INSERT INTO MENU_tree ( ID, LABEL, ICON, MASTER, STATUS, VALUE ) VALUES (
2, 'Menu1 Option 1', 'optionmenu', 1, 1, 'Dialog11');
INSERT INTO MENU_tree ( ID, LABEL, ICON, MASTER, STATUS, VALUE ) VALUES ( 3, 'Menu1 Option 2', 'optionmenu', 1, 1, dialog12');
INSERT INTO MENU_tree ( ID, LABEL, ICON, MASTER, STATUS, VALUE ) VALUES (4, 'Menu1 Option 3', 'optionmenu', 1, 1, NULL);
INSERT INTO MENU_tree ( ID, LABEL, ICON, MASTER, STATUS, VALUE ) VALUES ( 5, 'Menu1 Opt 3 Sub Opt 3', 'suboptionmenu', 4, 1, 'Dialog131');
INSERT INTO MENU_tree ( ID, LABEL, ICON, MASTER, STATUS, VALUE ) VALUES ( 6, 'Menu2', 'mainmenu', NULL, -1, NULL);
INSERT INTO MENU_tree ( ID, LABEL, ICON, MASTER, STATUS, VALUE ) VALUES ( 7, 'Menu2 Option1', 'optionmenu', 6, 1,'Dialog21');
The record_group use this instruction SELECT :
SELECT STATUS, LEVEL, LABEL, ICON, VALUE
FROM MENU_tree
CONNECT BY PRIOR ID = MASTER
START WITH MASTER IS NULL
And At the trigger When_new_form_instance , i do this code :
DECLARE
htree ITEM;
V_IGNORE number;
BEGIN
HTREE := FIND_ITEM('BLOC2.MENU');
V_IGNORE := POPULATE_GROUP('RG_DATA_TEST');
FTREE.POPULATE_TREE(htree);
END;
When i run the forms, It don't give me a structure of node.
It give me only a icon with two arrows.
Where is the problem ?
Must I add code somewhere ?
Help me for your ideas.
Regards.
Edited by: 794982 on 17 sept. 2010 04:55
Edited by: 794982 on 17 sept. 2010 05:01
Edited by: 794982 on 17 sept. 2010 05:04
Edited by: 794982 on 17 sept. 2010 05:06
Edited by: 794982 on 17 sept. 2010 05:13
Edited by: 794982 on 17 sept. 2010 05:19
Edited by: 794982 on 17 sept. 2010 05:23Ok Francois Thanks for your response.
Just I pricise i work with oracle forms version 9.0.4.0.19 .
But I am putting this code in trigger When_New_form_Instance but it didn't work.
When I execute it just shows a line with two arrows but not a real tree.
Then I do a block-non based and a elemnt with type hierarticall tree and a canevas.
and i create a record_group. and in a palette property of the element i precise the canevas and the record_group
I don't khnow where is the problem ?
Any other suggestion ? please
Regards. -
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's scrollbars
Hi all,
I've created a canvas with a hierarchical tree item. It displays correctly in web envinronment, whilst, when run at runtime, it shows always the scrollbars (both vertical and horizontal) also when the hierarchical structure fits perfectly the item's size.
Do I missed something or I have to download some pacth for my Forms?
My envinronment is: WIN2000, Forms 6i 6.0.8.13.0 - Production, Oracle RDBMS 8.1.7.1.0 - Production
Thanks in advance,
MarcoNothing you can do about this, the scrollbars ar a "feature" of the control that we use on Windows. You can't switch them off.
As you note, on the web, the scrollbars come and go as required, -
Scroll Event on a hierarchical tree
Is it possible to intercept a scroll event on a hierarchical
tree item, and how much the tree has been scrolled?
many thanks in advance,
Michele Pantaleo
nullHello,
I was able to reproduce your issue fast.I was able, also to find a solution to your issue, solution that came after performing several tests.
What i found out:
--the expansion begins from root and ends with the last leaf.That is why the scroll bar stays at the bottom.
--if you click on leaf node and then click expansion(which after the while loop has the following code:
node := Ftree.Find_Tree_Node(htree, '');
Ftree.Set_Tree_Selection(htree, node, Ftree.SELECT_ON);)
it will work to achieve what you want.
Here is the full procedure for the expanded tree that lets the scroll bar at the top:
PROCEDURE explose_tree IS
node ftree.node;
htree ITEM;
state varchar2(30);
state1 varchar2(30);
BEGIN
-- Search the tree identifiant --
htree := Find_Item('block2.tree4');
-- Search the root --
node := Ftree.Find_Tree_Node(htree, '');
--Ftree.Set_Tree_Selection(htree, node, Ftree.SELECT_ON);
-- Expand all nodes --
WHILE NOT Ftree.ID_NULL(node) LOOP
state := Ftree.Get_Tree_Node_Property(htree, node, Ftree.NODE_STATE);
IF state = Ftree.COLLAPSED_NODE THEN
Ftree.Set_Tree_Node_Property(htree, node, Ftree.NODE_STATE, Ftree.EXPANDED_NODE);
elsIF state = Ftree.LEAF_NODE then --this is the key that help to solve your problem
Ftree.Set_Tree_Selection(htree, node, Ftree.SELECT_ON);
END IF;
node := Ftree.Find_Tree_Node(htree, '', ftree.find_NEXT,Ftree.NODE_LABEL,'', node);
END LOOP;
-- Now go the root --
node := Ftree.Find_Tree_Node(htree, '');
--you need to select the root, otherwise the scroll bar will be at the bottom
Ftree.Set_Tree_Selection(htree, node, Ftree.SELECT_ON);
end;
Regards,
Alex -
Hierarchical Trees: Creating and populating
How would I go about it if was to have hierarchical trees and populate them with dynamic data that changes at runtime with the occurence of an event such as clicking of a button?
I use Forms version 6.0.8.8.0.Did you read the documentation? It explains how to use hierarchical trees.
Regards,
Robin Zimmermann
Forms Product Management -
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. -
Forms Builder-hierarchical tree(expanding and collapsing nodes)
hi friends,
can anyone help me with populating my hierarchical tree form by using codes for collapsing and expanding?
for instance when_button_pressed:
tree_control.expand_all(tree_control.v_item_name); //this is for expanding all the nodes in the tree structure
well, i have an sql statement in my record group which in turn defines the structure of the hierarchical tree.
Is it possible to just use the codes 'tree_control.expand_all(tree_control.v_item_name);' like that in the when-button-pressed trigger?
Thanks for any help :)Hi
can anyone help me with populating my hierarchical tree form by using codes for collapsing and expanding?
Pls have a look here ....
Hope this helps...
Regards,
Amatu Allah. -
Hierarchical Tree Data Query/Record Group Question
I need help with Hierarchical Forms right now. I'm currently trying to implement a hierarchical tree to display the different items in different categories. I have been reading up on it for the past few days, and i do not understand a few things.
What is the difference between a data query and record group? they seem the same to me.
How does the XX = prior XXX work? i understand that this is what connects the parent to the child.
How do you determine what depth the node is? its done in the record group/data query, but how do i decide what level it is dynamically?
Thanks a lot in advance!Thanks! I am unable to create a table specifically for the tree because i am using tables that have been ported live and are in use. My question about levels is how do I know which depth the node is. For example, i have a category called Information Technology and a category item called Business Informatics. I want to know how to decide that the Category(information technology) is on level 1 and the Item(business informatics) is on level 2.
Information Technology
|_
Business Informatics
And i do know how the Connect By XX = prior XXX works in the data query/record group.
Thanks for your help!
Maybe you are looking for
-
How can i add a phone to my existing itunes account
My husband's iPhone 5C will not turn on yet I am being instructed by Apple that I must deactivate it or be charged $900 for returning it un-deactivated. It was never added to my itunes account, so I cannot deactivate it remotely unless I add it. Ho
-
Collab API: Setting properties on a task/task list
Anyone know whether it is possible to set a task/tasklist to display in the calendar programmatically? Cant see an obvious way of doing it (and we really need to!)
-
When I select a bookmark, the page opens on the left instead of in the main window?
Most bookmarked pages replace the page being displayed. But one of them keeps popping up on the left in a window which can only be expanded to about a third of the width. I need it to open in the main window rather than in the left hand column. Perha
-
Hi all, Please help! Recently installed 2 SSD drives and was told a BIOS update was required. Ran the bios flash via live update 5 and now I cannot get to post. The MB starts up then shuts down this happens continuously until I switch off via the psu
-
I installed the 1.3.1_01 JDK at D:\Apps\1.3.1, but a second copy of the hotspot jvm is installed at C:\Program Files\JavaSoft\JRE\1.3.1\bin. I can find no way to prevent the JDK install program from doing this (w2K sp2). I wouldn't care, but many pro