Help on adding a node to a tree
Hi All,
I need help on hierarchical trees.
I am running forms 6i on oracle 9i. I am trying to create an organizational chart using the hierarchical tree.
I create an initial tree based on a record group, with two . I want to add a node to the last node but I cant see it anytime I try. I mean if my tree looks like
+ (Parent_1)
|
(Child_1_of_Parent_1)
As indicated, I want to add a node which will be a child of Child_1_of_Parent_1, but I have not been able to. I can add a node as a child of Parent_1 using the Add_Tree_Node but not Child_1_of_Parent_1.
Can any one help, I want to build the chart on the screen so I will prefer the use of the Ftree built-in to add nodes as opposed to populating the tree from a record group.
I will appreciate any help.
Thanks in advance.
Hi All,
Could some one please help me out on this, its urgent.
Pls help.
Similar Messages
-
Help on adding adding a node to a tree
Hi all,
I am compelled to re-post this thread because I still haven't received any help yet.
Could someone please help me out, its urgent.
I am developing in Forms 6i with Oracle 9i.
I am trying to build an organizational chart. I use a non-query record group to populate the first two nodes of the tree. The other nodes I want to add from the screen. I am able to add to the parent node with the Add_Tree_Node function of the Ftree package, but I am not able to add to the second node. To illustrate I have something in the form shown below:
- Parent
|
|_ Child1
I can add Child2 to Parent, but I want to add GrandChild1 to Child1 so I get something in the form below:
- Parent
|
|_ Child1
|
|_ GrandChild1
Please help.Could you please post your code?
Below code is working fine for me....
declare
rg_id recordgroup;
col_id1 groupcolumn;
col_id2 groupcolumn;
col_id3 groupcolumn;
col_id4 groupcolumn;
col_id5 groupcolumn;
begin
rg_id := create_group('rg1',form_scope,10);
col_id1 := add_group_column(rg_id,'stat',number_column,1);
col_id2 := add_group_column(rg_id,'lvl',number_column,1);
col_id3 := add_group_column(rg_id,'lbl',char_column,20);
col_id4 := add_group_column(rg_id,'ico',char_column,10);
col_id5 := add_group_column(rg_id,'val',number_column,5);
add_group_row(rg_id,1);
set_group_number_cell(col_id1,1,'1');
set_group_number_cell(col_id2,1,'1');
set_group_char_cell(col_id3,1,'p1');
set_group_number_cell(col_id5,1,'10');
add_group_row(rg_id,2);
set_group_number_cell(col_id1,2,'1');
set_group_number_cell(col_id2,2,'2');
set_group_char_cell(col_id3,2,'c1');
set_group_number_cell(col_id5,2,'20');
add_group_row(rg_id,3);
set_group_number_cell(col_id1,3,'1');
set_group_number_cell(col_id2,3,'3');
set_group_char_cell(col_id3,3,'g1');
set_group_number_cell(col_id5,3,'30');
ftree.set_tree_property('b1.t1',ftree.record_group,rg_id);
end; -
Runtime error while i add a node in ALV Tree in oops
i am adding a node to alv tree using oop am passing a work area and when i execute it is going for a dump and it says UC_OBJECTS_NOT_CONVERTIBLE
and the below where it is bold and italic it is where the dump is occuring
METHOD ADD_NODE.
FIELD-SYMBOLS: <TAB1> TYPE standard TABLE,
<wa> type any.
assign mt_outtab->* to <tab1>.
insert line in outtab
DATA: L_INDEX TYPE SY-TABIX.
if is_outtab_line is initial.
create initial line
data l_dref_wa type ref to data.
create data l_dref_wa like line of <tab1>.
assign l_dref_wa->* to <wa>.
l_index = 0.
append <wa> to <Tab1>.
else.
APPEND IS_OUTTAB_LINE TO <TAB1>. endif.
L_INDEX = SY-TABIX.
add node to model
CALL METHOD ME->ADD_MODEL_NODE
EXPORTING
I_RELAT_NODE_KEY = I_RELAT_NODE_KEY
I_RELATIONSHIP = I_RELATIONSHIP
IS_NODE_LAYOUT = IS_NODE_LAYOUT
IT_ITEM_LAYOUT = IT_ITEM_LAYOUT
I_NODE_TEXT = I_NODE_TEXT
I_INDEX_OUTTAB = L_INDEX
IMPORTING
E_NEW_NODE_KEY = E_NEW_NODE_KEY.
ENDMETHOD.HI Mohsin,
please refer to the below ....
might be helpful for u .....
https://scn.sap.com/thread/2050188
http://scn.sap.com/message/6407195
http://r0005001.benxbrain.com/de%28bD1lbiZjPTAwMQ==%29/index.do?onInputProcessing=brai_thread&001_thread_id=1759814%20&001_temp=R3TR|PROG|RCSBI010||P01|
Hope thiw will help ....
Regards,
AKS -
Runtime error when am adding a node to oop alv
i am adding a node to alv tree using oop am passing a work area and when i execute it is going for a dump and it says UC_OBJECTS_NOT_CONVERTIBLE
and the below where it is bold and italic it is where the dump is occuring
METHOD ADD_NODE.
FIELD-SYMBOLS: <TAB1> TYPE standard TABLE,
<wa> type any.
assign mt_outtab->* to <tab1>.
insert line in outtab
DATA: L_INDEX TYPE SY-TABIX.
if is_outtab_line is initial.
create initial line
data l_dref_wa type ref to data.
create data l_dref_wa like line of <tab1>.
assign l_dref_wa->* to <wa>.
l_index = 0.
append <wa> to <Tab1>.
else.
<i><b> APPEND IS_OUTTAB_LINE TO <TAB1>.</b></i> endif.
L_INDEX = SY-TABIX.
add node to model
CALL METHOD ME->ADD_MODEL_NODE
EXPORTING
I_RELAT_NODE_KEY = I_RELAT_NODE_KEY
I_RELATIONSHIP = I_RELATIONSHIP
IS_NODE_LAYOUT = IS_NODE_LAYOUT
IT_ITEM_LAYOUT = IT_ITEM_LAYOUT
I_NODE_TEXT = I_NODE_TEXT
I_INDEX_OUTTAB = L_INDEX
IMPORTING
E_NEW_NODE_KEY = E_NEW_NODE_KEY.
ENDMETHOD.Hi Mohsin,
Check the program : BCALV_TREE_MOVE_NODE_TEST
Regards,
Basha
Rewards points if it helps you. -
Adding JTree nodes from worker threads
I'm trying to add a large number of nodes (> 1700) to a JTree, and I'm looking for a way to do this while allowing the user to continue working in the meantime.
The nodes are retrieved from a database, which may be geographically distant and therefore possibly slow to access. I would like to have the process of processing the result-set and creating the Nodes run separately.
I have considered processing the result-set in a separate Thread and creating the Nodes before then returning to the EDT to add them to the tree. This would cause the GUI to pause when adding the Nodes to the tree, but does at least separate the DB access out of the EDT.
I would prefer to update the tree node by node as the result-set is processed, but I'm not sure whether this would incur too much overhead.
I would appreciate any advice.I'm not sure overhead is the problemimport java.awt.*;
import javax.swing.*;
import javax.swing.tree.*;
import java.util.Random;
public class Test extends JFrame implements Runnable {
JTree jt = new JTree();
DefaultTreeModel dtm = (DefaultTreeModel)jt.getModel();
public Test() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container content = getContentPane();
content.add(new JScrollPane(jt), BorderLayout.CENTER);
new Thread(this).start();
setSize(500, 500);
setVisible(true);
public void run() {
Random r = new Random();
DefaultMutableTreeNode root = (DefaultMutableTreeNode)dtm.getRoot();
for (int i=0; i<1700; i++) {
DefaultMutableTreeNode item = (DefaultMutableTreeNode)root.getChildAt(r.nextInt(root.getChildCount()));
while (r.nextInt(5)>0 && item.getChildCount()>0) {
item = (DefaultMutableTreeNode)item.getChildAt(r.nextInt(item.getChildCount()));
item.add(new DefaultMutableTreeNode("Node-"+i));
dtm.nodeStructureChanged(item);
try { Thread.sleep(500); } catch (Exception e) {}
public static void main(String[] args) { new Test(); }
} -
Adding 2 icons for a single node on a tree
Hi,
I am trying to create a tree to represent objects. These objects can be of different types, and different states. I intend to use two icons for each node in the tree, one signifying the type and the other the status. I am a bit stuck though.
At present each node has a single icon, and uses a JLabel to add to the tree (with a custom renderer). Is it possible to manipulate the icons so instead of adding 2 16x16icons I can simplify it by adding a 32x16 icon?
Alternativley is it possible to customise JLabel (or something) to allow two icons to be added and alligned?
Cheers in advance
ChrisJust write your own composite Icon class:
public class CompositeIcon implements Icon
private Icon icon1;
private Icon icon2;
public CompositeIcon(Icon icon1, Icon icon2)
this.icon1 = icon1;
this.icon2 = icon2;
public int getIconHeight()
return Math.max(icon1.getIconHeight(), icon2.getIconHeight());
public int getIconWidth()
return icon1.getIconWidth() + icon2.getIconWidth();
public void paintIcon(Component c, Graphics g, int x, int y)
icon1.paintIcon(c, g, x, y);
icon2.paintIcon(c, g, x + icon1.getIconWidth, y);
}Hopefully a slightly more reusable solution. You could write all sorts of different layouts in this way.
Hope this helps. -
Can somebody tell me how to get all the node objects (DefaultMutableTreeNode) that are there in JTree?
Suppose I have created a tree and added 4 nodes to the same, and if I want to get dynamically all the nodes that are there in the tree, what should I do?
Please help me..as it is urgent
Thanx in Advance
NoviIf you check the documentation to DefaultMutableTreeNode you see that some methods return enumerations, for example postorderEnumeration. You can use these to traverse the tree,
DefaultMutableTreeNode root = ....; // start node.
Enumeration e = root.postorderEnumeration(); // get wanted enumeration
while (e.hasMoreElements()) { // all nodes
DefaultMutableTreeNode node =
(DefaultMutableTreeNode)e.nextElement(); // get node
// do something with the node
}PS. The code compiles but I havent actually run it :( -
Select the multiple nodes in a tree
Hi Experts,
We need to select the multiple nodes in a tree.Whatever we are selecting,that has to be added in the table as a tree structure itself.
For ex:
A
|--A1
|--B1
If We select the A then A,A1 and B1 has to be added in a table.Please help me out for this.
Regards
Nutan
Edited by: Armin Reichert on Jan 29, 2008 2:33 PMHi,
You have to create a recursive node and use the tree by nesting UI component
Following tutorial will be of use
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/webdynpro/wd%20java/wdjava%20tutorials%20and%20articles%20archive/constructing%20a%20recursive%20and%20loadable%20web%20dynpro%20tree.pdf
Recursive Node
http://help.sap.com/saphelp_nw70/helpdata/en/5d/97384162316532e10000000a1550b0/frameset.htm
TreeByNesting
http://help.sap.com/saphelp_nw70/helpdata/en/92/12a74046033913e10000000a155106/content.htm
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#31 [original link is broken]
Regards
Ayyapparaj -
Adding image for the selected Tree leaf???
Hi All,
I am working with flex tree component in which i have to add
an arrow image for the selected leaf node. I tried to do this using itemclick event
but cant make it. can you help me out in doing this???
Note: I have written custom Tree and TreeItemRenderer...
-SundarThanks for ur reply Grizzzzzzzzz,
is there a way to identify the selected leaf from within MyTreeItemRenderer(Extends TreeItemRenderer)?
If this is possible,i can add the image to the selected leaf of the tree.
Right now i am assigning images to all the leaf nodes of the tree as follows:
public
class MyTreeItemRenderer extends TreeItemRenderer
* Override to draw a line in case current item is a leaf.
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):
void{
// Call super method
super.updateDisplayList(unscaledWidth, unscaledHeight);
if(super.data){
if(TreeListData(super.listData).hasChildren){
// logic for parent node comes here
else{
//Adding leaf Image
//Logic to add images to leaf
myImage.source = leafImage;
myImage.x =
super.label.x;
//The above code adds images to all leaf nodes. CAN I ADD THIS IMAGE ONLY TO THE SELECTED LEAF NODE???
//HOW TO FIND THE SELECTED LEAF NODE FROM HERE??? SO THAT SELECTED LEAF WILL BE ADDED WITH THE IMAGE???
//The above code adds images to all leaf nodes. CAN I ADD THIS IMAGE ONLY TO THE SELECTED LEAF NODE???
//HOW TO FIND THE SELECTED LEAF NODE FROM HERE??? SO THAT SELECTED LEAF WILL BE ADDED WITH THE IMAGE???
THANKS,
SUNDAR -
Need help to read model node input field attribute present in view - first time developer.
Hello Experts,
I am new to CRM Web UI development.
Presently, I am trying to develop a Guided Activity Page having 2 views.
First view has the field Business Partner Number, I have added model Node BuilHeader and the attribute BP_NUMBER while creation of the view.
The Second View consists of 2 fields from the Model Node BuilHeader, namely First Name and Last Name.
The requirement is to enter the BP Number on the first screen then click on the NEXT button from the Guided Activity buttons, on navigating to the Second View, the Names should auto-populate.
I have Created both views and the GP page, the GP navigation is also happening. Initially the fields were showing Not Bound text in value, so I commented the line in GET_I and GET methods to enable the field and remove the Not Bound text. I have created a custom controller with BuilHeader
I have tried doing this but facing the below problems :
1) When I enter the BP number on the first view and press Enter, the value disappears. How to solve this ?
2) Does clicking on the NEXT button on the GP Navigation trigger a Server Roundtrip ?
3) How to read the context node value of BP Number entered on the first view and populate the Name fields on the second view.
Please help.........you can take reference from from below code as in above case we use BuilHeaderAdvancedSearch search object, to get current entity.
data: query TYPE REF TO cl_crm_bol_dquery_service,.
query ?= me->typed_context->BuilHeaderAdvancedSearch->collection_wrapper->get_current( ).
Do not remove code from getter setter of fields , it will not clear.
Check with http://scn.sap.com/thread/3391203 , for basic understanding of UI.
Regards,
Harish Kumar -
How to not display nodes in a tree if Oracle roles are NOT used?
How to not display nodes in a tree if Oracle roles are NOT used?
We don't use Oracle DB roles to grant users access to Forms from the menu. We use a template and role system of our own. Basically a few tables with templates and roles.
We want to convert our normal Forms menu to a tree menu and one of our key requirements is that when the tree is populated ONLY nodes with programs (i.e. forms) he has been granted to execute is shown.
Since we don't use Oracle Roles how to do this in a tree?
I created a function to show/hide LEAF nodes, BUT problem is that there are sub-menu nodes showing even if the leaf-nodes under it has not being displayed. My function has suppressed it.
My tree query is like this:
SELECT
t.status, LEVEL, t.label, t.icon, t.node VALUE
FROM
tma_tree_menu t
WHERE
tma_authenticate_sys_chk_role(USER, t.node) = 1
CONNECT BY
PRIOR t.node = t.master
START WITH
t.MASTER IS NULL
ORDER SIBLINGS BY
t.position
The tma_authenticate_sys_chk_role will return 1 only if the user has access to the form under that node.
I tried the FTree functions in Forms but even that has nothing.
Any help would be greatly appreciated.
Edited by: Channa on Mar 17, 2010 6:49 AMWould you share the source code? I guess what I need is how exactly you retreive the user credentials from the DB table and set that boolean variable.
and then how to condition it in UIX? -
Fetch the index of the node in a tree
hi,
i am using a recursive tree structure,
i need to get the index value of a selected node in a tree structure,
can any one help me?
thanks in advance,
Regards,
MeyyappanHello Ganesh,
in that case, just call
lr_node_tmp = context_element->get_node().
lr_parent_element = lr_node_tmp->get_parent_element().
lr_parent_node = lr_parent_element->get_node().
Best regards,
Thomas -
Adding new node to the Clusterware fails with the root.sh script.
Dear All,
I had successfully added third node to the existing 2 node cluster. After adding new node I need to run the root.sh scripts, but it was faling with the below error.
Please help me with the below issue:
Instantiating scripts for add node (Monday, April 8, 2013 3:23:14 PM EDT)
. 1% Done.
Instantiation of add node scripts complete
Copying to remote nodes (Monday, April 8, 2013 3:23:16 PM EDT)
............................................................................................... 96% Done.
Home copied to new nodes
Saving inventory on nodes (Monday, April 8, 2013 3:31:40 PM EDT)
. 100% Done.
Save inventory complete
WARNING:
The following configuration scripts need to be executed as the "root" user in each new cluster node. Each script in the list below is followed by a list of nodes.
/u01/app/11.2.0/grid/root.sh #On nodes svphxwgdbprd06
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts in each cluster node
The Cluster Node Addition of /u01/app/11.2.0/grid was successful.
Root.SH Script Log:
[root@svphxwgdbprd06 ~]# /u01/app/11.2.0/grid/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/11.2.0/grid
Enter the full pathname of the local bin directory: [usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
OLR initialization - successful
Adding Clusterware entries to inittab
CRS-2672: Attempting to start 'ora.mdnsd' on 'svphxwgdbprd06'
CRS-2676: Start of 'ora.mdnsd' on 'svphxwgdbprd06' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'svphxwgdbprd06'
CRS-2676: Start of 'ora.gpnpd' on 'svphxwgdbprd06' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'svphxwgdbprd06'
CRS-2672: Attempting to start 'ora.gipcd' on 'svphxwgdbprd06'
CRS-2676: Start of 'ora.cssdmonitor' on 'svphxwgdbprd06' succeeded
CRS-2676: Start of 'ora.gipcd' on 'svphxwgdbprd06' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'svphxwgdbprd06'
CRS-2672: Attempting to start 'ora.diskmon' on 'svphxwgdbprd06'
CRS-2676: Start of 'ora.diskmon' on 'svphxwgdbprd06' succeeded
CRS-2676: Start of 'ora.cssd' on 'svphxwgdbprd06' succeeded
ASM created and started successfully.
Disk Group DATA created successfully.
clscfg: -install mode specified
clscfg: EXISTING configuration version 5 detected.
clscfg: version 5 is 11g Release 2.
Successfully accumulated necessary OCR keys.
clscfg: Arguments check out successfully.
NO KEYS WERE WRITTEN. Supply -force parameter to override.
-force is destructive and will destroy any previous cluster
configuration.
Failed to initialize Oracle Cluster Registry for cluster, rc 105
Oracle Grid Infrastructure Repository configuration failed at /u01/app/11.2.0/grid/crs/install/crsconfig_lib.pm line 6818.The document references posted already are very good ones. However, I would say that on personal experience (on Solaris and 10gR2) that the addnode tools gave me nothing but problems. Luckily, I was able to build a parallel cluster (with three nodes) on other hardware and then move the databases across via DataGuard. It was quicker and cleaner (and easier!) that way...
Good luck! -
How can I get the previous clicked node in a Tree?
I have a JTree. If a node is selected, before the user select another, I need to make a question if he have sure about the new selection.
If the user answers not, I need to select the previous node.
I have in my class a variable, type of DefaultMutableTreeNode, that makes reference to the last node selected.
How can I turn this node selected again, if the user select "No"?
Thanks for any help.
Renato de MeloYou don't want to maintain a reference to the last selected node, but to the last selected path. Nodes within a tree are addressed using a TreePath, with contains references to each node from the root, down to a specific node. Look at the JavaDocs of javax.swing.tree.TreePath for more info.
Also, JTree has getter/setter methods for the selectionPath. -
Adding new Node in 10gR2(10.2.0.4) in AIX
Hi Experts,
i need your guidence actually we are planning to add new node in our exsisting two node RAC. i need a dacument or refrence links that can guide me in adding new node.
your help will be very helpfull for me.thanx in advance
regards,Hi,
you can drive some tests using following docs:
http://www.smaliz.com/notes/10g-AddNode-RAC-ASM-AIX.pdf
http://blogs.oracle.com/AlejandroVargas/gems/RAC10gR2AddNode.pdf
Or refer to the RAC admin books that you can find on http://tahiti.oracle.com/
HTH,
Thierry
Maybe you are looking for
-
Dear all, I have different kind of problem in standerd report MB5B. In same period report is showing me different values if run at different timimgs. Required your valuable input. Thanks and regards Gitesh
-
Connect two G5 with 1000BASE-T (Gigabit) - how?
what i need to connect two G5 dual 1.8 with 1000BASE-T (Gigabit)? just a cable or some cards and routers and ....?
-
How completely delete weather app since it doesn't work?
I finally got a phone (first one besides trust flip phone), and is iPhone 5s. I was surprised to see it came with reinstalled crapware like a computer. Since the weather app thing doesn't work anyway (has day/night mixed up, says sunrise is at 9:42
-
We're pleased to announce a new major release, JE 4.0.71. The release introduces High Availability/Replication, as well as other functionality and performance improvements. Complete information can be found in the [JE documentation|http://www.oracle.
-
Connection between Two servers : FM Required
Dear All, I'm doing one report which calls RFC enabled Z function module. The function module is connecting to another SAP system through Logical system name. If the connection fails, then I need to pass an error message. Can anyone please tell me th