Hierarchical tree node editable
hi,
is there a property to make a tree node label editable? it would be kind to click on the label, change it and save to DB, instead of copying its value into a text field.
thanks
Not directly as Andreas said but alternately you can do by
You can set the label of NODE and update into the BASE table block and re-populate the tree
- on Double click the label call custom Stack canvas contains new label in text item and user will press OK
- Sets the Label of the Tree node
- Update the new label to the base table block
- Commit and re-populate the tree
if responses are helpful or correct please mark it
Baig,
http://baigsorcl.blogspot.com
Similar Messages
-
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 -
Call forms and reports through a hierarchical tree node.
Hello,
I am new in pl/sql programming and I have some dificulties. I have created a hierarchical tree, in order to use it as a menu in an application that I am trying to develope. The problem is that I do not know how can I make the last nodes to be either a form or a report and when somebody double clicks on these nodes the form or the report will run. What is more, should I use the when-tree-node-selected trigger or the when-tree-node-activated? I use forms 6i.
Thank you in advance,
Vag
Message was edited by:
user537672Thank you very much for your reply. I tried what you said and managed to create a when-tree-node-activated trigger that works fine. The only problem is that I do not know how to find the last 3 characters of every node in order to make the form understand if it is a form or a report. I mean that the name of each node maybe of different length so I do not know how exactly to use the substr().
Thank you
Vag -
Call forms and reports from a hierarchical tree node.
Hello,
I am new in pl/sql programming and I have some dificulties. I have created a hierarchical tree, in order to use it as a menu in an application that I am trying to develope. The problem is that I do not know how can I make the last nodes to be either a form or a report and when somebody double clicks on these nodes the form or the report will run. What is more, should I use the when-tree-node-selected trigger or the when-tree-node-activated?
Thank you in advance,
VagHi ,
In Oracle Forms , a hierarchical tree is developed through the use of a sql statement and column which defines the order of leaves...
Visit the on-line help of Forms10g to find out the details , and the triggers as well...
Something else...post this question to Oracle Forms to get more detailed answer...
Regards,
Simon -
Hierarchical Tree Node icon ?
Hi
How to create a icon on Hierarchical tree
Regards
ShahzaibThanks for your reply and i am sorry for not clear my developer version
My developer version is 6I
Database express addition
Well i write the trigger when tree node activate
:parameter.current_emp := ftree.get_tree_node_property(find_item('Block28.Tree8'),
:system.trigger_node,
ftree.node_value);
DECLARE
htree ITEM;
current_node FTREE.NODE;
find_node FTREE.NODE;
BEGIN
htree := Find_Item('block28.tree8');
find_node := :SYSTEM.TRIGGER_NODE;
ftree.set_tree_node_property(htree, find_node, ftree.NODE_ICON, 'D:\ico\Ico\favorite.ico');
END;
Ftree.SET_tree_NODE_PROPERTY(htree, :SYSTEM.TRIGGER_NODE, Ftree.NODE_ICON, 'print');And also when mouse double click
declare
al_button number;
pl_id ParamList;
v_emp_id number;
e_child_rec exception;
pragma exception_init(e_child_rec, -02292);
len number := 3; --variable which tells till what length from last not to copy from first string
begin
v_emp_id := ftree.get_tree_node_property(find_item('Block28.tree8'),
:system.trigger_node,
ftree.node_value);
SET_BLOCK_PROPERTY('block3', DEFAULT_WHERE, 'acc_id = ''' || V_emp_id|| '''');
go_block('block3');
EXECUTE_QUERY;
exception
when e_child_rec then
Message ('Go Kimi Go');
end;
Now when i double click the mouse its show tree icon
I want when i run my module its show me all node icon
Hope this time i clear my question
Regards
Shahzaib ismail -
Hierarchical Tree Node Attributes
Hi,
I know that Oracle' official answer to this is no, but is there a way to specify attributes for specific nodes in a hierarchical tree? I would like to display specific nodes in bold and specific nodes in a different color.
Any idea welcomed.
MonicaIf this were possible then you would have to use the FTree package and probably the FTree.Set_Tree_Node_Property procedure, so check those in the help system. But I'm 99.99% sure you'd be wasting your time.
You might be able to do it with a JTree in a bean (it looks like it's not possible to extend an htree item in a pjc) but in forms the best you can do is assign icons to the nodes. -
Request a Simple Sample of adding Hierarchical Tree Node
Hai! if you are familiar with hierarchical tree. please show me
some sample of adding node to the hierarchical tree(simple
adding node)
If you are providing code, please also provide information where
the code am I suppose to be put cause i'm still new in oracle.
Thanks in advance for spending some time on it...
Eric :)
nullHere is the code for both the tree node selected and tree node activated triggers
Tree Node Seleceted code:
:CONTROL.Node_Activated := null ;
:CONTROL.Node_Selected := Ftree.Get_Tree_Node_Property('CONTROL_TREE.MENU', :SYSTEM.TRIGGER_NODE, Ftree.NODE_VALUE) ;
===========================================================
Tree Node Activated code:
Declare
LN$I Pls_integer ;
Begin
:CONTROL.Node_Selected := null;
:CONTROL.Node_Activated := Ftree.Get_Tree_Node_Property('CONTROL_TREE.MENU', :SYSTEM.TRIGGER_NODE, Ftree.NODE_VALUE) ;
If :CONTROL.Node_Activated IS NOT NULL Then
if :GLOBAL.curr_proc_id <> :control.node_activated or :control.node_activated
is null then
CALL_FORM(:CONTROL.Node_Activated);
else
Set_Alert_Property( 'AL_FORM_OPENED', ALERT_MESSAGE_TEXT,
:CONTROL.Node_Activated || ' is already opened. Please check your current or previously opened library.' );
LN$I := Show_Alert( 'AL_FORM_OPENED' ) ;
end if;
end if ;
end ; -
Hierarchical tree node problem
Hi all --
Today's problem is (drum roll)............
My application uses a heirarichal tree where each tree node contains the name of a form within this system. The user can navigate from form to form by clicking the appropriatetly name tree node. This seems to work - sometimes. Some users click on a node for one form, but get transferred to another named form(usually the one above or below the one actually activated). I've also found out that this happens ONLY when the user has their screen resolution set to 800 x 600. This application was developed at screen resolution 1024 x 768 and it woks fine. Anybody know why??Here is the code for both the tree node selected and tree node activated triggers
Tree Node Seleceted code:
:CONTROL.Node_Activated := null ;
:CONTROL.Node_Selected := Ftree.Get_Tree_Node_Property('CONTROL_TREE.MENU', :SYSTEM.TRIGGER_NODE, Ftree.NODE_VALUE) ;
===========================================================
Tree Node Activated code:
Declare
LN$I Pls_integer ;
Begin
:CONTROL.Node_Selected := null;
:CONTROL.Node_Activated := Ftree.Get_Tree_Node_Property('CONTROL_TREE.MENU', :SYSTEM.TRIGGER_NODE, Ftree.NODE_VALUE) ;
If :CONTROL.Node_Activated IS NOT NULL Then
if :GLOBAL.curr_proc_id <> :control.node_activated or :control.node_activated
is null then
CALL_FORM(:CONTROL.Node_Activated);
else
Set_Alert_Property( 'AL_FORM_OPENED', ALERT_MESSAGE_TEXT,
:CONTROL.Node_Activated || ' is already opened. Please check your current or previously opened library.' );
LN$I := Show_Alert( 'AL_FORM_OPENED' ) ;
end if;
end if ;
end ; -
First, sorry for my English.
It is necessary to rename a treenode by selecting of a
menuitem from the contextual menu like to rename folder in Windows
explorer.
Did so:
1.) Last used treenode:
(- Tree in MXML)
<mx:Tree id="computerTree" width="100%" height="100%"
labelField="@label" showRoot="true"
dataProvider="{treeData}"
contextMenu="{treeMenu}"
itemRollOver="SetLastTreeItem(event)"
editable="false"
itemEditBeginning="Tree_itemEditBeginning(event)"/>
(- in ActionScript)
public function SetLastTreeItem(event:ListEvent):void
lastTreeItem = event.itemRenderer.data as XML;
2.) eventListener when ContextMenu item "rename" selected:
public function
ContextMenu_SelectItemRename(event:ContextMenuEvent):void
var y:int;
y=computerTree.getItemIndex(lastTreeItem);
tree.editedItemPosition={columnIndex:0, rowIndex:y};
tree.createItemEditor(0,y);
But that didn't work:
- itemEditor appears in necessary position, but empty.
- When itemEditor is closed there is an error in List.as.
(TypeError: Error #1009: Cannot access a property or method
of a null object reference.
at
mx.controls::List/endEdit()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\Li st.as:2174]
at
mx.controls::List/editorKeyDownHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\m x\controls\List.as:2444])
May be someone knows the ways to rename a treenode by
selecting of a menuitem from the contextual menu, not by
mouseClick?
In adobe manual I has read:
"To create an editor at other times, set the
editedItemPosition property to generate the itemEditBegin event"
But this event does not come.
Textbrother,Tell us how to solve this problem, which method to use
-
Add/Edit/Delete Tree Nodes using CL_GUI_ALV_TREE
Hi All,
I am looking for an example of program with CL_GUI_ALV_TREE that have a functionality of add a tree node, edit a tree node, and delete a tree node.
I have already looked the BCALV_TREE* demo program but could not able to find a program to add/edit/delete node tree elements.
Any info on this.
Thanks
aRsHello aRs
Here is a sample report showing how to delete nodes in an ALV tree. The report was copied from BCALV_TREE_01. Search for added code:
*$ADDED: begin
*$ADDED: end[/code]
When you display the tree expand the first folder completely. When entering 'DELETE' into the command field directly the first flight date node will be deleted.
REPORT ZUS_SDN_BCALV_TREE_01_DELNODE.
based on: REPORT bcalv_tree_01.
Purpose:
~~~~~~~~
This report shows the essential steps to build up a hierarchy
using an ALV Tree Control (class CL_GUI_ALV_TREE).
Note that it is not possible to build up this hierarchy
using a simple ALV Tree Control (class CL_GUI_ALV_TREE_SIMPLE).
To check program behavior
~~~~~~~~~~~~~~~~~~~~~~~~~
Start this report. The hierarchy tree consists of nodes for each
month on top level (this level can not be build by a simple ALV Tree
because there is no field for months in our output table SFLIGHT.
Thus, you can not define this hierarchy by sorting).
Nor initial calculations neither a special layout has been applied
(the lines on the right do not show anything).
Note also that this example does not build up and change the
fieldcatalog of the output table. For this reason, all fields
of the output table are shown in the columns although the fields
CARRID and FLDATE are already placed in the tree on the left.
(Of course, this is not a good style. See BCALV_TREE_02 on how to
hide columns).
Essential steps (Search for '§')
~~~~~~~~~~~~~~~
1.Usual steps when using control technology.
1a. Define reference variables.
1b. Create ALV Tree Control and corresponding container.
2.Create Hierarchy-header
3.Create empty Tree Control
4.Create hierarchy (nodes and leaves)
4a. Select data
4b. Sort output table according to your conceived hierarchy
4c. Add data to tree
5.Send data to frontend.
6.Call dispatch to process toolbar functions
*$ADDED: begin
DATA:
gd_del_nkey TYPE lvc_nkey.
*$ADDED: end
§1a. Define reference variables
DATA: g_alv_tree TYPE REF TO cl_gui_alv_tree,
g_custom_container TYPE REF TO cl_gui_custom_container.
DATA: gt_sflight TYPE sflight OCCURS 0, "Output-Table
ok_code LIKE sy-ucomm,
save_ok LIKE sy-ucomm, "OK-Code
g_max TYPE i VALUE 255.
END-OF-SELECTION.
CALL SCREEN 100.
*& Module PBO OUTPUT
process before output
MODULE pbo OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'MAINTITLE'.
IF g_alv_tree IS INITIAL.
PERFORM init_tree.
CALL METHOD cl_gui_cfw=>flush
EXCEPTIONS
cntl_system_error = 1
cntl_error = 2.
IF sy-subrc NE 0.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = 'Automation Queue failure'(801)
txt1 = 'Internal error:'(802)
txt2 = 'A method in the automation queue'(803)
txt3 = 'caused a failure.'(804).
ENDIF.
ENDIF.
ENDMODULE. " PBO OUTPUT
*& Module PAI INPUT
process after input
MODULE pai INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'EXIT' OR 'BACK' OR 'CANC'.
PERFORM exit_program.
*$ADDED: begin
WHEN 'DELETE'.
CALL METHOD g_alv_tree->delete_subtree
EXPORTING
i_node_key = gd_del_nkey
I_UPDATE_PARENTS_EXPANDER = SPACE
i_update_parents_folder = 'X'
EXCEPTIONS
node_key_not_in_model = 1
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.
CALL METHOD g_alv_tree->frontend_update.
*$ADDED: end
WHEN OTHERS.
§6. Call dispatch to process toolbar functions
CALL METHOD cl_gui_cfw=>dispatch.
ENDCASE.
CALL METHOD cl_gui_cfw=>flush.
ENDMODULE. " PAI INPUT
*& Form init_tree
text
--> p1 text
<-- p2 text
FORM init_tree.
§1b. Create ALV Tree Control and corresponding Container.
create container for alv-tree
DATA: l_tree_container_name(30) TYPE c.
l_tree_container_name = 'CCONTAINER1'.
CREATE OBJECT g_custom_container
EXPORTING
container_name = l_tree_container_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc <> 0.
MESSAGE x208(00) WITH 'ERROR'(100).
ENDIF.
create tree control
CREATE OBJECT g_alv_tree
EXPORTING
parent = g_custom_container
node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
item_selection = 'X'
no_html_header = 'X'
no_toolbar = ''
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
illegal_node_selection_mode = 5
failed = 6
illegal_column_name = 7.
IF sy-subrc <> 0.
MESSAGE x208(00) WITH 'ERROR'. "#EC NOTEXT
ENDIF.
§2. Create Hierarchy-header
The simple ALV Tree uses the text of the fields which were used
for sorting to define this header. When you use
the 'normal' ALV Tree the hierarchy is build up freely
by the programmer this is not possible, so he has to define it
himself.
DATA l_hierarchy_header TYPE treev_hhdr.
PERFORM build_hierarchy_header CHANGING l_hierarchy_header.
§3. Create empty Tree Control
IMPORTANT: Table 'gt_sflight' must be empty. Do not change this table
(even after this method call). You can change data of your table
by calling methods of CL_GUI_ALV_TREE.
Furthermore, the output table 'gt_outtab' must be global and can
only be used for one ALV Tree Control.
CALL METHOD g_alv_tree->set_table_for_first_display
EXPORTING
i_structure_name = 'SFLIGHT'
is_hierarchy_header = l_hierarchy_header
CHANGING
it_outtab = gt_sflight. "table must be empty !
§4. Create hierarchy (nodes and leaves)
PERFORM create_hierarchy.
§5. Send data to frontend.
CALL METHOD g_alv_tree->frontend_update.
wait for automatic flush at end of pbo
ENDFORM. " init_tree
*& Form build_hierarchy_header
build hierarchy-header-information
-->P_L_HIERARCHY_HEADER strucxture for hierarchy-header
FORM build_hierarchy_header CHANGING
p_hierarchy_header TYPE treev_hhdr.
p_hierarchy_header-heading = 'Month/Carrier/Date'(300).
p_hierarchy_header-tooltip = 'Flights in a month'(400).
p_hierarchy_header-width = 30.
p_hierarchy_header-width_pix = ' '.
ENDFORM. " build_hierarchy_header
*& Form exit_program
free object and leave program
FORM exit_program.
CALL METHOD g_custom_container->free.
LEAVE PROGRAM.
ENDFORM. " exit_program
*& Form create_hierarchy
text
--> p1 text
<-- p2 text
FORM create_hierarchy.
DATA: ls_sflight TYPE sflight,
lt_sflight TYPE sflight OCCURS 0,
l_yyyymm(6) TYPE c, "year and month of sflight-fldate
l_yyyymm_last(6) TYPE c,
l_carrid LIKE sflight-carrid,
l_carrid_last LIKE sflight-carrid.
DATA: l_month_key TYPE lvc_nkey,
l_carrid_key TYPE lvc_nkey,
l_last_key TYPE lvc_nkey.
§4a. Select data
SELECT * FROM sflight INTO TABLE lt_sflight UP TO g_max ROWS.
§4b. Sort output table according to your conceived hierarchy
We sort in this order:
year and month (top level nodes, yyyymm of DATS)
carrier id (next level)
day of month (leaves, dd of DATS)
SORT lt_sflight BY fldate0(6) carrid fldate6(2).
Note: The top level nodes do not correspond to a field of the
output table. Instead we use data of the table to invent another
hierarchy level above the levels that can be build by sorting.
§4c. Add data to tree
LOOP AT lt_sflight INTO ls_sflight.
Prerequesite: The table is sorted.
You add a node everytime the values of a sorted field changes.
Finally, the complete line is added as a leaf below the last
node.
l_yyyymm = ls_sflight-fldate+0(6).
l_carrid = ls_sflight-carrid.
Top level nodes:
IF l_yyyymm <> l_yyyymm_last. "on change of l_yyyymm
l_yyyymm_last = l_yyyymm.
*Providing no key means that the node is added on top level:
PERFORM add_month USING l_yyyymm
CHANGING l_month_key.
The month changed, thus, there is no predecessor carrier
CLEAR l_carrid_last.
ENDIF.
Carrier nodes:
(always inserted as child of the last month
which is identified by 'l_month_key')
IF l_carrid <> l_carrid_last. "on change of l_carrid
l_carrid_last = l_carrid.
PERFORM add_carrid_line USING ls_sflight
l_month_key
CHANGING l_carrid_key.
ENDIF.
Leaf:
(always inserted as child of the last carrier
which is identified by 'l_carrid_key')
PERFORM add_complete_line USING ls_sflight
l_carrid_key
CHANGING l_last_key.
ENDLOOP.
ENDFORM. " create_hierarchy
*& Form add_month
FORM add_month USING p_yyyymm TYPE c
p_relat_key TYPE lvc_nkey
CHANGING p_node_key TYPE lvc_nkey.
DATA: l_node_text TYPE lvc_value,
ls_sflight TYPE sflight,
l_month(15) TYPE c. "output string for month
get month name for node text
PERFORM get_month USING p_yyyymm
CHANGING l_month.
l_node_text = l_month.
add node:
ALV Tree firstly inserts this node as a leaf if you do not provide
IS_NODE_LAYOUT with field ISFOLDER set. In form 'add_carrid_line'
the leaf gets a child and thus ALV converts it to a folder
automatically.
CALL METHOD g_alv_tree->add_node
EXPORTING
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_outtab_line = ls_sflight
IMPORTING
e_new_node_key = p_node_key.
ENDFORM. " add_month
FORM add_carrid_line USING ps_sflight TYPE sflight
p_relat_key TYPE lvc_nkey
CHANGING p_node_key TYPE lvc_nkey.
DATA: l_node_text TYPE lvc_value,
ls_sflight TYPE sflight.
add node
ALV Tree firstly inserts this node as a leaf if you do not provide
IS_NODE_LAYOUT with field ISFOLDER set. In form 'add_carrid_line'
the leaf gets a child and thus ALV converts it to a folder
automatically.
l_node_text = ps_sflight-carrid.
CALL METHOD g_alv_tree->add_node
EXPORTING
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_outtab_line = ls_sflight
IMPORTING
e_new_node_key = p_node_key.
ENDFORM. " add_carrid_line
*& Form add_complete_line
FORM add_complete_line USING ps_sflight TYPE sflight
p_relat_key TYPE lvc_nkey
CHANGING p_node_key TYPE lvc_nkey.
DATA: l_node_text TYPE lvc_value.
WRITE ps_sflight-fldate TO l_node_text MM/DD/YYYY.
add leaf:
ALV Tree firstly inserts this node as a leaf if you do not provide
IS_NODE_LAYOUT with field ISFOLDER set.
Since these nodes will never get children they stay leaves
(as intended).
CALL METHOD g_alv_tree->add_node
EXPORTING
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
is_outtab_line = ps_sflight
i_node_text = l_node_text
IMPORTING
e_new_node_key = p_node_key.
*$ADDED: begin
IF ( ps_sflight-fldate = '20040522' ). " first flight date
IF ( gd_del_nkey IS INITIAL ). " collect only first date
gd_del_nkey = p_node_key.
ENDIF.
ENDIF.
*$ADDED: end
ENDFORM. " add_complete_line
*& Form GET_MONTH
text
-->P_P_YYYYMM text
<--P_L_MONTH text
FORM get_month USING p_yyyymm
CHANGING p_month.
Returns the name of month according to the digits in p_yyyymm
DATA: l_monthdigits(2) TYPE c.
l_monthdigits = p_yyyymm+4(2).
CASE l_monthdigits.
WHEN '01'.
p_month = 'January'(701).
WHEN '02'.
p_month = 'February'(702).
WHEN '03'.
p_month = 'March'(703).
WHEN '04'.
p_month = 'April'(704).
WHEN '05'.
p_month = 'May'(705).
WHEN '06'.
p_month = 'June'(706).
WHEN '07'.
p_month = 'July'(707).
WHEN '08'.
p_month = 'August'(708).
WHEN '09'.
p_month = 'September'(709).
WHEN '10'.
p_month = 'October'(710).
WHEN '11'.
p_month = 'November'(711).
WHEN '12'.
p_month = 'December'(712).
ENDCASE.
CONCATENATE p_yyyymm+0(4) '->' p_month INTO p_month.
ENDFORM. " GET_MONTH
/code
Regards
Uwe -
Hi All Is it possible to insert values into another table using hierarchical Tree Node values.Please give Methods
Regards
R.MaheshBabuhi
try something like this.
when-new-form-instance trigger.
declare
cursor dept_cur is
select deptno , dname
from dept;
cursor emp_cur (N number) is
Select empno , ename
from emp
where deptno=N;
Htree item;
parent_node varchar2(200);
child_node varchar2(200);
begin
Htree:=Find_item('tree');
For dept_R in Dept_cur loop
parent_node:=Ftree.Add_Tree_Node(htree,
Ftree.ROOT_NODE,
Ftree.PARENT_OFFSET,
Ftree.LAST_CHILD,
Ftree.EXPANDED_NODE,
dept_r.deptno||' '||dept_r.dname,
'insrec',
dept_r.deptno);
Htree:=Find_item('tree');
For emp_R in emp_cur(dept_r.deptno) loop
child_node:=Ftree.Add_Tree_Node(htree,
parent_node,
Ftree.PARENT_OFFSET,
Ftree.LAST_CHILD,
Ftree.EXPANDED_NODE,
emp_r.empno||' '||emp_r.ename,
'insrec',
emp_r.empno);
end loop;
end loop;
end;create tree and use this trigger for it.
when-tree-node-selected trigger.
declare
Value_node varchar2(50);
htree item;
begin
htree:=find_item('tree');
Value_node := Ftree.GET_TREE_NODE_PROPERTY(htree,
:system.trigger_node,
Ftree.node_value);
:val_from_tree:=value_node;
set_block_property('emp',default_where,'empno='||:val_from_tree);
go_block('emp');
execute_query;
end;create 3 blocks.
1.control(Tree Block)
2.emp (Table Block)
3.value(create a item,named "VAL_FROM_TREE").
i hope it will help u.
sarah -
How to make a node of a Hierarchical Tree BOLD
When we click the node of a Hierarchical Tree, we want to make the node BOLD. We tried using set item property but it's not working.
There aren't really any built-ins that will allow you to change the Font Weight of the Tree Node Label. You might be able to accomplish this with Java, but you would have to write your own Java Bean to implement. It might be easier to simply add an Asterisk (*) to the label programatically using the Set-Tree-Node-Property() built-in, but this presents problems with removing the asterisk when you leave the selected node or select a new node. It can be resolved, but you'll have to record all the information you'll need to reset the node - namly just the Node_ID.
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly.
Edited by: CraigB on Feb 24, 2012 7:52 AM -
JTreeTable problem editing tree node
Hi,
Iam using the swing JTreeTable component and facing a problem. Iam displaying hierarchical data in the JTreeTable. Now I would like to provide the facility to edit a tree node. I have a TreeSelectionListener registered on the tree and a TreeModelListener registered on the DefaultTreeModel. Wheneve, I start editing a node by double clicking it the valueChanged method is called but I do not see the new value the user types in this method. I have another method setValueAt which is where I can see the new value the user has entered.
I can set this new value to the treenode using
node.setUserObject(newValue);However, if I do this, the next time I try to edit the same node, the editor component is painted over the tree node thus displaying an empty textfield that occupies the entire cell.
How can I make the editor appear above the tree node with the contents loaded in it always.
Any help is appreciated.
cheers,
vidyutYou bind a mouselistener to the tree, so it has to be handled there.
When clicking once (method should be "mouseReleased" or something, treenodes name (toString) should be .setText("");
regards
marco -
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 -
How-to synchronize edit forms for a single View Object tree node entrie
Hi all,
I created a tree from a single View Object,
follow this [http://www.oracle.com/technetwork/developer-tools/adf/learnmore/32-tree-table-from-single-vo-169174.pdf]
then i want to create and synchronize edit forms for tree node entries,
follow this [http://www.oracle.com/technetwork/developer-tools/adf/learnmore/50-synchromize-form-treeselection-169192.pdf]
but it not working when i click child node!!
i found the latter tree from many View Object ,but the former tree from single View Object.
what should i do?
Thanks in advanceHi,
say the tree is built from ViewObject1. In the AM model, create a second View Object instance for this. Say ViewObject2. Create the form from ViewObject2 and the tree from ViewObject1. When creating the tree, use the"Target Data Source" option at the bottom to reference the iterator of ViewObject2. Then create a PartialTrigger on the paneFormLayout that holds the synch form. In the partial trigger property, reference the tree so that when the tree selection changes, the form is updated. Then create a PartialTrigger property on the tree and point it to the submit button of the form so you can show updated values in the tree.
Frank
Maybe you are looking for
-
Apple Wireless keyboard eating batteries
I've an Apple aluminium wireless keyboard and a Magic Mouse. My keyboard's batteries last less than a week. I've seen this problem posted long time ago, but not clear solution now. Can anyone help
-
What makes a song 'ineligible' for match?
I have a number of files in my itunes library which are not uploaded to itunes match. They are all labled 'ineligible'. Are there certain types of recordings i.e. aiff, mp3, Sd2f which are not uploadable? What can I do to make them 'eligible'?
-
Sync after new operating system
I replaced Vista with Windows 7 (nice change). But I did not save any itunes files fron the old setup when I did a clean install. I want to transfer the media content that is on the iphone to the pc. Having authorized the pc, when I sync, it doesn't
-
Why isn't my device able to connect to a WiFi network?
Hi guys, I have noticed that there is a WiFi network which is free, nearby my house. It's called "Belkin54g" but when I try to connect to it, a message comes up saying: "Unable to connect to the network "Belkin54g"" When I scan for the netwrok, it ha
-
POP account requires password each time
After 10.4.6 update very time I open mail it requires entry of password to one of my three POP accounts (SBC.) Even though I have checked "remember this passowrd in my keychain" it has no effect. This never happened before, nor does it affect my two