Hierarchical Tree Style navigation
Hi,
Windows xp.
Oracle 10g,
database 10g
I am using Tree style to navigate to my modules , when i navigate to specific Tree item by mouse is working fine
without any problem . but when i use keyboard key-up or key-down the node selection behavior work fine with keyboard but when i double click on current
selected node the form select wrong node.
Code on block contain when - tree -node select trigger;
</code>
V_HTree_Item Item;
V_S_Node FTree.Node;
V_S_P_Node FTree.Node;
V_S_N_Value Varchar2(32000);
V_S_P_N_Value Varchar2(50);
V_N_Of_Selected_Node Number;
Begin
V_HTree_Item := Find_Item(Pkg_1_Nvs_Oracle_ADF_HTree.V_HTree_Item_Name);
V_N_Of_Selected_Node := FTree.Get_Tree_Property(V_HTree_Item, FTree.Selection_Count);
If Nvl(V_N_Of_Selected_Node,0) != 0 Then
For J IN 1..V_N_Of_Selected_Node Loop
V_S_Node := FTree.Get_Tree_Selection(V_HTree_Item,J);
V_S_N_Value := V_S_N_Value ||','||FTree.GET_Tree_Node_Property (V_HTree_Item,V_S_Node,FTree.Node_Value);
Pkg_1_Nvs_Oracle_ADF_HTree.V_Parent_Node := FTree.Get_Tree_Node_Parent(V_HTree_Item,V_S_Node);
End Loop;
Pkg_1_Nvs_Oracle_ADF_HTree.V_Selected_Node := V_S_Node;
P_1_Enable_Disable_HTree_BTNS(1);
Pkg_1_Nvs_Oracle_ADF_HTree.V_H_Tree_Value_Selected := LTRIM(V_S_N_Value,',');
P_1_HighLight_Display_Block(V_S_N_Value);
Go_Item(Pkg_1_Nvs_Oracle_ADF_HTree.V_HTree_Item_Name);
End If;
<code/>
Regards
Edited by: kingadmin on Nov 19, 2011 10:21 PM
Edited by: kingadmin on Nov 19, 2011 10:22 PM
Edited by: kingadmin on Nov 21, 2011 7:18 PM
Edited by: kingadmin on Nov 21, 2011 7:35 PM
This is why full version numbers are important to mention. If memory serves there was a similar behaviour in 10.1.2.0.2 where the WHEN-TREE-NODE-SELECTED trigger did not fire upon Keyboard navigation and caused some weird behaviour afterwards. This problem was fixed in 10.1.2.3, so if you are not on this patchset you should apply it and retry.
cheers
Similar Messages
-
Hierarchical Tree and keyboard navigation
Does anyone know how to use Hierarchical Trees with keyboards, or to disable keyboard actions? (forms 9.0.4)
My form has a tree which does processing in a When-Tree-Node-Selected trigger to populate some blocks depending on the selected node. If the user selects nodes with the mouse then all is fine, but if they move between nodes with the keyboard then the processing for each selected node is only run the next time a node is selected with the mouse. This means the data for each node will flash up in the blocks for a split second when the mouse is next used.
I've tried Key-Up/Key-Down triggers to prevent keyboard navigation, but they don't fire. Setting Keyboard Navigable to false doesn't fix it either.
Using the When-Tree-Node-Activated trigger doesn't help. The online help says this trigger fires when the user presses Enter or double-clicks a node. I find that each node for which Enter was pressed is processed only when the user next double-clicks a node, and the node they double-click is not processed.
Tree Query:select 1, level, ename, null, null
from scott.emp
connect by prior empno = mgr
start with mgr is NULLWhen-New-Form-Instance:ftree.populate_tree('B.T');When-Tree-Node-Selected (1st and 4th lines commented out when changed to WTNA trigger):if :system.trigger_node_selected = 'TRUE' then
message(ftree.get_tree_node_property(
'B.T',:system.trigger_node,ftree.node_label));
pause;
end if;Hi James,
We have got the same problem, after searching Metalink I found that this is a known bug. See Metalink Bug no 4565623 (base bug 4509399).
Sjoerd -
How to set the control-on hierarchical tree nodes
Hi,
I have created form in which at the left it has hierarchical tree structure(BOM) and towards the right it brings up the query results for selected node.
Now, I have a button upon clicking which I navigate to the root node by issuing
"Ftree.set_Tree_selection(htree, 1, Ftree.select_on);".
But, it cannot automatically run the ' when-tree-node-selected' trigger '.
any solution???
Its really urgent.I have a customer demo on monday.
Please help me asap.
regards,
Nagadeep.Hello Nagadeep,
couldn't you just put the code from the trigger into a procedure
and run that after the navigation to the item?
Just a thought,
Bernd
The docs state that:
No programmatic action will cause the When-Tree-Node-Selected trigger to fire. Only end-user action will generate an event.
Probably due to performance reasons.
Bernd
Message was edited by:
Bernd Prechtl -
Can I use Hierarchical Tree from Forms6.0 in Forms5.0
Hello
The Oracle Custumer Support tell me that it should be possible to
use Hierarchical Trees also in Forms5.0
I look for a possibility to build a Navigator in Forms5.0
with Symbols. (look and feel like the Navigator in Forms6.0 if I
use Symbols in the Record Group).
I Description should be on
http://developer.us.oracle.com
but either i have no access to this side or
the URL is false.
Sure is that there is a description over this Problem.
And i have to get this description ;-)))
Thanks for Help
JK
nullThat is not recommended. The new code editing features do not play well with an old workspace.
Please create a new workspace and import your projects into that.
-Anirudh -
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; -
Conceptual problem: AJAX Memory tree for navigation
Hello,
I have a conceptual problem with a navigation tree.
I have to implement a AJAX memory tree for navigation purposes, which should be on page 0, so this tree is on the left side of every page.
Therefore I searches some examples and found this: http://www.oracle.com/technology/pub/articles/spendolini-tree.html
So I try to rebuild this example with my custom tables and recognised that this example is very slow. I have round about 100 nodes in the tree and my database and network connection is extremly fast(I`m sitting in a proffesional data center).
So first of all I am wondering why the tree is so slow when I try to expand it and if it is possible to use this tree on the page 0.
Because of the performance problem I searched for some alternatives, but I didn`t found one.
Every custom APEX-tree is not dynamic(AJAX) and the dynamic APEX-lists can not base on a select-statement.
So at this moment I don`t know how to build a AJAX memory tree for navigation which is fast, looks good and works as expected.
Does anybody have an idea why the tree is so slow?
Are there alternatives which I can try to use?
Thank you,
TimHi Tim
100 nodes is not a lot of data for a tree, so why bother with AJAX at all.
Just render the entire tree, and let the user expand and collapse nodes as they like.
APEX has a dhtml tree in the standard themes which is enough to get you started.
The issue I had with it is that it isn't stateful, so doesn't remember which nodes are open between page refreshes.
That's what got me into ExtJS originally.
If you look at my demo, I have a couple of examples worth looking at:
- [tree using APEX lists|http://apex.oracle.com/pls/otn/f?p=200801:2025:0::NO:::] uses APEX built in hierarchical lists, which allows conditional logic on nodes
- [AJAX editable tree|http://apex.oracle.com/pls/otn/f?p=200801:2013:0::NO:::] which is fully AJAX enabled.
The other point worth mentioning is if you are using hierarchical queries for your tree you should consider restructuring your data set.
Typically trees are fairly static, in that the data changes very little over time.
This makes a very strong case for maintaining the node sequence and level in a denormalised way.
Data updates become more expensive, but read operations, which will be the bulk of your operations will be very fast.
Many choices on how to implement, e.g. materialized views with refresh on demand.
Regards
Mark
[Random Insights into Oracle|http://oracleinsights.blogspot.com/] | [Marks Playpen|http://apex.oracle.com/pls/otn/f?p=200801] -
Hi,
I have to implement a dynamic list (I suppose it's an hierarchical tree) on a BSP with expanding branches. Is there any tutorial or how-to?
Thanks!
Carlesnot a staright forward standard feature but what you could do is build a html table and set that as the text of the node.
concatenate
'<nobr><table border="1" cellspacing="1" style="border-collapse: collapse" width="20" id="table1">'
'<tr>'
'<td>one/one</td>'
'<td>two</td>'
'<td>three</td>'
'</tr>'
'</table></nobr>'
into wf_string .
move: wf_string to wa_tree-text .
Raja -
Single click on tree control navigation
Hello I have a tree control where I have include the navigation, I know that there is a method
HANDLE_NODE_DOUBLE_CLICK FOR G_TREE
but is there an method for only one click, I want to change my alv grid data when I click on several nodes in my tree controlHello Muhammet
I have re-written my sample report ZUS_SDN_TWO_ALV_GRIDS into ZUS_SDN_TREE_AND_GRID_CONTROL which is now display a tree control together with the ALV grid.
When you analyze this new report you will see that every step of the program logic is as I described in my previous e-mails.
*& Report ZUS_SDN_TWO_ALV_GRIDS
*& Screen '0100' contains no elements.
*& ok_code -> assigned to GD_OKCODE
*& Flow logic:
* PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
* PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0100.
*& Thread: single click on tree control navigation
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1143770"></a>
REPORT zus_sdn_tree_and_grid_control.
TYPE-POOLS: abap, cntl.
TYPES: node_table_type LIKE STANDARD TABLE OF mtreesnode
WITH DEFAULT KEY.
* CAUTION: MTREESNODE is the name of the node structure which must
* be defined by the programmer. DO NOT USE MTREESNODE!
CONSTANTS:
BEGIN OF c_nodekey,
root TYPE tv_nodekey VALUE 'Root', "#EC NOTEXT
child1 TYPE tv_nodekey VALUE 'Child1', "#EC NOTEXT
* child2 type tv_nodekey value 'Child2', "#EC NOTEXT
new1 TYPE tv_nodekey VALUE 'New1', "#EC NOTEXT
new2 TYPE tv_nodekey VALUE 'New2', "#EC NOTEXT
* new3 type tv_nodekey value 'New3', "#EC NOTEXT
* new4 type tv_nodekey value 'New4', "#EC NOTEXT
END OF c_nodekey.
DATA:
gd_okcode TYPE ui_func,
gd_repid TYPE syst-repid,
go_docking TYPE REF TO cl_gui_docking_container,
go_splitter TYPE REF TO cl_gui_splitter_container,
go_cell_left TYPE REF TO cl_gui_container,
go_cell_right TYPE REF TO cl_gui_container,
go_tree TYPE REF TO cl_gui_simple_tree,
go_grid1 TYPE REF TO cl_gui_alv_grid,
** go_grid2 TYPE REF TO cl_gui_alv_grid,
gs_layout TYPE lvc_s_layo.
DATA:
gt_knb1 TYPE STANDARD TABLE OF knb1,
gt_knvv TYPE STANDARD TABLE OF knvv.
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING
e_row
e_column
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_double_click.
* define local data
DATA:
ls_knb1 TYPE knb1.
CHECK ( sender = go_grid1 ).
READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row-index.
CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
** CALL METHOD go_grid1->set_current_cell_via_id
** EXPORTING
*** IS_ROW_ID =
*** IS_COLUMN_ID =
** is_row_no = es_row_no.
* Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ).
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
* CLASS LCL_APPLICATION DEFINITION
CLASS lcl_application DEFINITION.
PUBLIC SECTION.
CLASS-DATA:
md_event TYPE string READ-ONLY,
md_node_key TYPE tv_nodekey READ-ONLY.
CLASS-METHODS:
handle_node_double_click
FOR EVENT node_double_click
OF cl_gui_simple_tree
IMPORTING node_key,
handle_expand_no_children
FOR EVENT expand_no_children
OF cl_gui_simple_tree
IMPORTING node_key.
ENDCLASS. "LCL_APPLICATION DEFINITION
* CLASS LCL_APPLICATION IMPLEMENTATION
CLASS lcl_application IMPLEMENTATION.
METHOD handle_node_double_click.
" this method handles the node double click event of the tree
" control instance
" show the key of the double clicked node in a dynpro field
md_event = 'NODE_DOUBLE_CLICK'.
md_node_key = node_key.
" Trigger PAI and set ok-code = 'DETAIL'
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'DETAIL'
* IMPORTING
* rc =
MESSAGE md_node_key TYPE 'I'.
ENDMETHOD. "HANDLE_NODE_DOUBLE_CLICK
METHOD handle_expand_no_children.
" this method handles the expand no children event of the tree
" control instance
DATA: node_table TYPE node_table_type,
node TYPE mtreesnode.
" show the key of the double clicked node in a dynpro field
md_event = 'EXPAND_NO_CHILDREN'.
md_node_key = node_key.
IF node_key = 'Child1'.
* add two nodes to the tree control (the children of 'Child1')
* Node with key 'New1'
CLEAR node.
node-node_key = c_nodekey-new1.
node-relatkey = c_nodekey-child1.
node-relatship = cl_gui_simple_tree=>relat_last_child.
node-isfolder = ' '.
node-text = 'New1'(ne1).
APPEND node TO node_table.
* Node with key 'New2'
CLEAR node.
node-node_key = c_nodekey-new2.
node-relatkey = c_nodekey-child1.
node-relatship = cl_gui_simple_tree=>relat_last_child.
node-n_image = '@10@'.
node-expander = ' '.
node-text = 'New2'(ne2).
APPEND node TO node_table.
CALL METHOD go_tree->add_nodes
EXPORTING
table_structure_name = 'MTREESNODE'
node_table = node_table
EXCEPTIONS
failed = 1
error_in_node_table = 2
dp_error = 3
table_structure_name_not_found = 4
OTHERS = 5.
IF sy-subrc <> 0.
** MESSAGE A000.
ENDIF.
ENDIF.
ENDMETHOD. "HANDLE_EXPAND_NO_CHILDREN
ENDCLASS. "LCL_APPLICATION IMPLEMENTATION
START-OF-SELECTION.
SELECT * FROM knb1 INTO TABLE gt_knb1 UP TO 100 ROWS
WHERE bukrs = '1000'.
PERFORM init_controls.
* Display data
gs_layout-grid_title = 'Customers: Sales Areas'.
CALL METHOD go_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'KNVV'
is_layout = gs_layout
CHANGING
it_outtab = gt_knvv
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Link the docking container to the target dynpro
gd_repid = syst-repid.
CALL METHOD go_docking->link
EXPORTING
repid = gd_repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* NOTE: dynpro does not contain any elements
CALL SCREEN '0100'.
* Flow logic of dynpro (does not contain any dynpro elements):
*PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
*PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0100.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'. " contains push button "DETAIL"
* SET TITLEBAR 'xxx'.
* Refresh display of detail ALV list
CALL METHOD go_grid1->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
TRANSLATE gd_okcode TO UPPER CASE.
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
* User has pushed button "Display Details"
WHEN 'DETAIL'.
MESSAGE gd_okcode TYPE 'I'.
PERFORM entry_show_details.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form ENTRY_SHOW_DETAILS
* text
* --> p1 text
* <-- p2 text
FORM entry_show_details .
* define local data
DATA:
ld_row TYPE i,
ls_knb1 TYPE knb1.
IF ( gt_knvv IS INITIAL ).
SELECT * FROM knvv INTO TABLE gt_knvv
FOR ALL ENTRIES IN gt_knb1
WHERE kunnr = gt_knb1-kunnr.
ELSE.
REFRESH: gt_knvv.
ENDIF.
ENDFORM. " ENTRY_SHOW_DETAILS
*& Form INIT_CONTROLS
* text
* --> p1 text
* <-- p2 text
FORM init_controls .
* Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 90
EXCEPTIONS
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Create splitter container
CREATE OBJECT go_splitter
EXPORTING
parent = go_docking
rows = 1
columns = 2
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Get cell container
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = go_cell_left.
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 2
RECEIVING
container = go_cell_right.
* Create ALV grids
CREATE OBJECT go_grid1
EXPORTING
i_parent = go_cell_right
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Set event handler
SET HANDLER:
lcl_eventhandler=>handle_double_click FOR go_grid1.
PERFORM create_and_init_tree.
ENDFORM. " INIT_CONTROLS
*& Form CREATE_AND_INIT_TREE
* text
* --> p1 text
* <-- p2 text
FORM create_and_init_tree .
DATA: lt_node_table TYPE node_table_type,
lt_events TYPE cntl_simple_events,
ls_event TYPE cntl_simple_event.
* create a tree control
CREATE OBJECT go_tree
EXPORTING
parent = go_cell_left
node_selection_mode = cl_gui_simple_tree=>node_sel_mode_single " single node selection is used
EXCEPTIONS
lifetime_error = 1
cntl_system_error = 2
create_error = 3
failed = 4
illegal_node_selection_mode = 5.
IF sy-subrc <> 0.
** MESSAGE a000.
ENDIF.
* define the events which will be passed to the backend
" node double click
ls_event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
** ls_event-appl_event = 'X'. " process PAI if event occurs
" NOTE: Do NOT register as application event !!!!!
APPEND ls_event TO lt_events.
CALL METHOD go_tree->set_registered_events
EXPORTING
events = lt_events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
IF sy-subrc <> 0.
** MESSAGE a000.
ENDIF.
SET HANDLER:
lcl_application=>handle_node_double_click FOR go_tree,
lcl_application=>handle_expand_no_children FOR go_tree.
* add some nodes to the tree control
* NOTE: the tree control does not store data at the backend. If an
* application wants to access tree data later, it must store the
* tree data itself.
PERFORM build_node_table USING lt_node_table.
* node_table_structure_name = 'MTREESNODE'
* A programmer using the tree control must create a structure in the
* dictionary. This structure must include the structure TREEV_NODE
* and must contain a character field with the name 'TEXT'.
CALL METHOD go_tree->add_nodes
EXPORTING
table_structure_name = 'MTREESNODE'
node_table = lt_node_table
EXCEPTIONS
failed = 1
error_in_node_table = 2
dp_error = 3
table_structure_name_not_found = 4
OTHERS = 5.
IF sy-subrc <> 0.
** MESSAGE a000.
ENDIF.
ENDFORM. " CREATE_AND_INIT_TREE
*& Form build_node_table
* text
* --> p1 text
* <-- p2 text
FORM build_node_table
USING
node_table TYPE node_table_type.
DATA: node LIKE mtreesnode.
* Build the node table.
* Caution: The nodes are inserted into the tree according to the order
* in which they occur in the table. In consequence, a node must not
* occur in the node table before its parent node.
* Node with key 'Root'
node-node_key = c_nodekey-root.
" Key of the node
CLEAR node-relatkey. " Special case: A root node has no parent
CLEAR node-relatship. " node.
node-hidden = ' '. " The node is visible,
node-disabled = ' '. " selectable,
node-isfolder = 'X'. " a folder.
CLEAR node-n_image. " Folder-/ Leaf-Symbol in state "closed":
" use default.
CLEAR node-exp_image. " Folder-/ Leaf-Symbol in state "open":
" use default
CLEAR node-expander. " see below.
node-text = 'Root'(roo).
APPEND node TO node_table.
* Node with key 'Child1'
node-node_key = c_nodekey-child1.
" Key of the node
" Node is inserted as child of the node with key 'Root'.
node-relatkey = c_nodekey-root.
node-relatship = cl_gui_simple_tree=>relat_last_child.
node-hidden = ' '.
node-disabled = ' '.
node-isfolder = 'X'.
CLEAR node-n_image.
CLEAR node-exp_image.
node-expander = 'X'. " The node is marked with a '+', although
" it has no children. When the user clicks on the
" + to open the node, the event
" expand_no_children is fired. The programmer can
" add the children of the
" node within the event handler of the
" expand_no_children event
" (see method handle_expand_no_children
" of class lcl_application)
node-text = 'Child1'(ch1).
node-style = cl_gui_simple_tree=>style_emphasized_positive.
APPEND node TO node_table.
ENDFORM. " build_node_table
Regards
Uwe -
How do we create Hierarchical tree??
Can I get help on creating hirerchical tree with detailed description ?? I tried basing hierarchical item on query but it didn't work.Do i need to specifically give code for populating it ??
Also I need help on basing it on Record Group ??
Is there any rule for having specific no of columns for a tree ??You can create Hierarchical Tree in two ways.
One using "connect by prior" and another
by Adding columns and row to record group at run time.
If your table has Self reference Key then
you can create using connect by prior.
Otherwise you have to go for second one.
Go and check the navwiz.fmb in oracle demo files.
Following example is from navwiz.fmb
(open navwiz.pll and then check refresh_tree)
In this example they used both.For Emp they used connect by prior.
PROCEDURE refresh_trees(p_view VARCHAR2) IS
cursor cursor_dept is
select dname, deptno
from dept
order by dname;
cursor cursor_emp(p_dno number) is
select ename, empno
from emp
where deptno = p_dno
order by ename;
v_i number;
v_ignore number;
rg_emps recordgroup;
rg_depts recordgroup;
v_init_state groupcolumn;
v_level groupcolumn;
v_label groupcolumn;
v_icon groupcolumn;
v_value groupcolumn;
begin
if p_view = 'EMP' then
--the emps hierarchy
rg_emps := find_group('EMPS');
if not id_null(rg_emps) then
delete_group(rg_emps);
end if;
rg_emps := create_group_from_query('EMPS',
'select 1, level, ename, NULL, to_char(empno) ' | |
'from emp ' | |
'connect by prior empno = mgr ' | |
'start with mgr IS NULL');
v_ignore := populate_group(rg_emps);
ftree.set_tree_property('navigator.nav_display', ftree.record_group, rg_emps);
else
--the organization
rg_depts := find_group('DEPTS');
if not id_null(rg_depts) then
delete_group(rg_depts);
end if;
rg_depts := create_group('DEPTS');
v_init_state := add_group_column(rg_depts, 'init_state', number_column);
v_level := add_group_column(rg_depts, 'level', number_column);
v_label := add_group_column(rg_depts, 'label', char_column, 40);
v_icon := add_group_column(rg_depts, 'icon', char_column, 20);
v_value := add_group_column(rg_depts, 'value', char_column, 5);
v_i := 1;
for deptrec in cursor_dept loop
add_group_row(rg_depts, v_i);
set_group_number_cell(v_init_state, v_i, 1);
set_group_number_cell(v_level , v_i, 1);
set_group_char_cell (v_label , v_i, deptrec.dname);
set_group_char_cell (v_icon , v_i, NULL);
set_group_char_cell (v_value , v_i, to_char(deptrec.deptno));
v_i := v_i + 1;
for emprec in cursor_emp(deptrec.deptno) loop
add_group_row(rg_depts, v_i);
set_group_number_cell(v_init_state, v_i, 1);
set_group_number_cell(v_level , v_i, 2);
set_group_char_cell (v_label , v_i, emprec.ename);
set_group_char_cell (v_icon , v_i, NULL);
set_group_char_cell (v_value , v_i, to_char(emprec.empno));
v_i := v_i + 1;
end loop;
end loop;
ftree.set_tree_property('navigator.nav_display', ftree.record_group, rg_depts);
end if;
My query******
procedure refresh1 is
v_i number;
v_ignore number;
Rg_Menus recordgroup;
rg_depts recordgroup;
Begin
Rg_Menus := find_group('MENUS');
If not id_null(Rg_Menus) then
delete_group(Rg_Menus);
End If;
Rg_Menus := create_group_from_query('MENUS',
'select 1, level, item_name, NULL, item_id ' | |
'from Item_all '
| |' where Item_id in (select Item_id from Item_access_all where role_id in
(select role_id from org_access_all where user_id =
(select gsp_user_id from users_all where upper(user_name) = upper(USER))
and code = :global.code) )
and item_id not in (select item_id from item_Exception where Code = :Global.Code)' | |
'connect by prior item_name = main_name ' | |
'start with item_name = ''MAIN''');
v_ignore := populate_group(Rg_Menus);
ftree.set_tree_property('tree_blk.tree_menu', ftree.record_group,Rg_Menus);
Exception
When Others then
Bell;
Message('You cannot Access any menu item...');
Raise Form_trigger_Failure;
End;
viji.
null -
HIERARCHICAL TREES + NAVWIZ-DEMO
I made an hierarchical tree as shown in the navwiz demo, but now
I detected another error; when navigating through the tree not by
mouse but with the keyboard everytime the wrong node is slected.
If I have the nodes CLARK-KING-MILLER and I navigate through them
to the node miller, when I want to edit his data I get the data
from king!
Can anybody tell me the reason for this and give me a tip how I
can make it working correctly?
Thx in advance!
nullHello Michaela,
You are in the wonderfull World of Oracle.
I just called Oracle-Support with the same Problem. They said
This is a BuG(928992) and is not fixed with the second patch.
Sorry
Gnter
Michaela (guest) wrote:
: I made an hierarchical tree as shown in the navwiz demo, but
now
: I detected another error; when navigating through the tree not
by
: mouse but with the keyboard everytime the wrong node is
slected.
: If I have the nodes CLARK-KING-MILLER and I navigate through
them
: to the node miller, when I want to edit his data I get the data
: from king!
: Can anybody tell me the reason for this and give me a tip how I
: can make it working correctly?
: Thx in advance!
null -
I have made the Hierarchical Tree as described in the resuable demo help as is but when ever i try to compile the form i gets error on the navigator."anything!". I guess the forms are not able to find the navigator package. I have attached the navigator.pll. I think there is nothing mroe to attach to a form
Till now i have searched every documentation on the net and the files ships wiht DEV 6.0.5.2. But not ablet o find any thing regarding the installation of navigator package :( Is there any one can tell me how u remover the compiling error from the form which is dur to the navigator package!!!!
nullIf you are using DEV 6.0.5.2 you should use the FTREE built-in package. Look under the Built-In package node. The Navigator.pll was a demo used in Forms4.5 before there was a hierarchial tree item type.
Thanks,
Candace Stover
Forms Product Management -
hy everyone,
i've got a really strange problem with a hierarchical tree. it runs fine with C/S, i can expand and collapse as much branches i like.
but when i put it on the web (9iAS Server and MSIE 5.01 as client) and expand some tree nodes the complete web application looses its database connection.
so i can't even navigate to the "show errors" in the navigation bar, everything dead.
do you have any idea why this happens only on the web and not on C/S ?
if you have more questions relating to this problem or need a test case, please contact me.
thanx for replys, martin
nullthis is a bug of FORMs 6i and is fixed with patch 8?
martin -
Hi,
I'am working on the Hierarchical Tree structure which should have three levels, I need to have a check box in the place of the icon & if i select a node that node & the child nodes should get selected.
After this when i say move selected ( i'am trying to use picklist class also) the entire checked tree has to move to the display area to the right & should display as tree structure & after this if i save then the checked records which are moved to another text area should get saved!!
How to achieve this? I have the tree structure ready but the check box part is the worrying factor! & then moving the checked records to the right using picklist class is the second problem & finally saving records to database.
Any help in this regard will be deeply appreciated:)
If check box is not possible then i will have to look at other methods, will the tree structure allow checkboxes????
Thanks
MaheshNo the tree will not allow checkboxes
-
In FF 3.5 through 4.0b11, the Tree-style Tabs extension kept tabs open when I exited so that when I re-opened the program, all tabs re-opened at the same time. Now, every time I return ot the program, I have to re-load all of the tabs I use on a daily basis.
Hi,
I'm using the Tree Style Tab and love it.
However, I was wondering if there's a way to collapse/expand the tab sidebar using a keyboard shortcut.
Ideas, anyone?
Iddo -
How to go to a particular node in a hierarchical tree?
I want to do this simple thing with a Forms hierarchical tree.
Since tree has lots of levels and branches I want to give a search box.
User types the label and press a button. The form then has to query the tree node and expand ONLY the path where the node is (if found) and highlight it. If a node with a label is NOT found I give an error message to the user.
I got hold of a code segment to explode a tree and modified it, but it does not work. The entire tree is expanded and you don't know where you are.
Any help will be greatly appreciated?
PROCEDURE Expand_All_Nodes_in_Tree IS
node ftree.node;
htree ITEM;
state varchar2(30);
BEGIN
-- Search the tree identifiant --
htree := Find_Item('menu.tree');
-- Search the root --
node := Ftree.Find_Tree_Node(htree, '');
-- 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);
END IF;
node := Ftree.Find_Tree_Node(htree, '', ftree.find_NEXT,Ftree.NODE_LABEL,'', node);
IF Ftree.Get_Tree_Node_Property(htree, node, Ftree.NODE_LABEL) = :ctrl.node_lable_to_search THEN
EXIT;
END IF;
END LOOP;
END;Hi Channa,
Try this code with you tree i am using the same situation and this code is working perfect with me.
PROCEDURE find_node_in_tree(search_string varchar2, find_type varchar2) IS
htree ITEM;
search_start_node ftree.node;
find_node ftree.node;
BEGIN
htree := Find_Item('blk_tree.main_tree');
search_start_node := nvl(ftree.get_tree_selection(htree,1),ftree.root_node);
find_node := ftree.find_tree_node(htree,upper(search_string)||'%',ftree.find_next,ftree.node_label,ftree.root_node,search_start_node-1);
if find_node = 0 then
find_node := 1;
end if;
Ftree.Set_Tree_selection(htree, find_node, Ftree.SELECT_ON);
exception
when others then
NULL;
END;
-Ammad
Maybe you are looking for
-
Boxes with numbers and letters show instead of certain images on some websites
On yammer.com and linkedin.com, images for icons, like those that should display along the top of the screen do not display. Instead, I see a rectangle with numbers and letters. I've seen quite a few articles about the rectangles with numbers and let
-
Firewire (1394) vs camera-link digital video camera?
Hello: I would like to purchase a video imaging acquisition system. I need at least 1k by 1k resolution, colors, 8 bits and i am working in a Labview IMAQ environment in which I already have a huge bunch of image analysis routines developed. Now the
-
Standard reports allows monitoring of our purchasing procedures
Hello SAP Gurus, I am looking for any report that will allow monitoring of our purchasing procedures for example: Reports identifying date of invoice v's date of order / requisition Thanks
-
Problems with password for alias email address
I am using two e-mail addresses, one the original @verizon.net and an alias I set up @alias.com I was regularly -- but it seemed sporadically -- getting this following message, sometimes when I tried accessing, but sometimes just when the Apple Mail
-
Hi, I have an error with the Can configuration, someone her already had? Ports in the max are not shown. Thanks befaiz Attachments: Can.zip 114 KB