Custom Icon In Tree Parent Node
I can't replace the default parent node icon. I'm able to
replace the child nodes. I've attached my code. Any
suggestions?
MyTreeCellRenderer extends DefaulTreeCellRenderer{
public Component getTreeCellRendererComponent(
JTree tree,
Object value,
boolean sel,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus) {
super.getTreeCellRendererComponent(
tree, value, sel,
expanded, leaf, row,
hasFocus);
//Do your condition on your value
if( value ....){
setIcon(myIcon);
return this;
}
Similar Messages
-
Is it possible to put two different colors in tree parent
node background and child nodes background?
Any help will be very helpful.
ThanksHi PanosE,
Yes, you can set up another Standard Edition Server in child domain and then deploy pool pairing.
You need to deploy a new Front End Pool for the new Standard Edition Server.
A similar case for your reference.
https://social.technet.microsoft.com/Forums/office/en-US/eca4299c-8edb-481e-b328-c7deba2a79ba/lync-2013-standard-edition-lync-fe-pools-in-multiple-domain-single-forest-senario?forum=lyncdeploy
Best regards,
Eric
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected] -
Hi,
Can anyone tell me how to change the icon for a particular node in a JTree?
I know how to change all the leafs for example by using the DefaultTreeCellRenderer.setLeafIcon()method. But do you know how to set just one node to a particular icon?
Cheers,
JimMyTreeCellRenderer extends DefaulTreeCellRenderer{
public Component getTreeCellRendererComponent(
JTree tree,
Object value,
boolean sel,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus) {
super.getTreeCellRendererComponent(
tree, value, sel,
expanded, leaf, row,
hasFocus);
//Do your condition on your value
if( value ....){
setIcon(myIcon);
return this;
} -
Hi developers,
I have one how to do question: In a tree I like to introduce a custom icon on each leaf.
For this, I tried to introduce at the icon column sql #WORKSPACE_IMAGES#picture.gif but nothing happened, instead if I use #IMAGE_PREFIX#standard_picture.gif it works, but I want to use my custom pictures uploaded in Shared Components->Images.
Is there any way to do this? Thank you in advance.Hi "user11978562",
In APEX 4.0, bug 9893260 was logged against the handling of #WORKSPACE_IMAGES# and #APP_IMAGES# in the setting of custom icons on a tree. However, the fix for this issue was incorporated in the 4.0.1 patch release. It was also discussed on this related thread: Re: Syntax for icon in Tree element If you are running 4.0, then my recommendation would be to upgrade to our latest patch release, 4.0.2. If you are running on 4.0.1 or higher, then this may be a silly question, but is there a chance that the images you've uploaded are associated with a particular application? Maybe it's worth trying #APP_IMAGES# instead of #WORKSPACE_IMAGES#.
Regards,
Hilary -
ADF Tree setting focus back to parent node after deletion of child node
Hi,
Is there a way to get the focus back to the parent node (or rather any particular node) in a tree?
I have a use case where we need to get the focus back to the parent node after a child node is deleted.
Currently the focus is shifted to the next node in the tree, but the need is to get the focus shifted back to the parent node. Also the parent node should be re-invoked to populate to get the latest status after deletion of the child node.
Any help/pointers?
ThanksThanks for the reply Frank.
I saw the link http://sreevardhanadf.blogspot.in/2012/07/showing-next-row-as-current-row-after.html
However the issue is since I am using custom created tree using POJO tree item (composite object).
calling myTree.getWrappedData() doesn't gives me a handle to JUCtrlHierBinding and subsequent access to JUCtrlHierNodeBinding.
my program gives me data like -
List<MyTreeItem> treeData = (List<MyTreeItem>)treeModel.getWrappedData();
because my tree model is build using -
treeModel = new ChildPropertyTreeModel(items, "children");
where items is List of <MyTreeItem>
Hence I am unable to get a handle using -
List nodeParentList = nodeParent .getKeyPath();
I am programmatically able to invoke the parent node to get the fresh data, only issue is the focus/selection of that node is not happening
Is there a way around?
Thanks
Sachin -
How to Formate the Font of The Tree's Parent Node ?
Hello,
Pls. , how to Formate the Font of The Tree's Parent Node ?
Other Formatting Aspects..etc.
Regards,
Abdetu..In ur code is HTREE$ is of type varchar2 or ITEM?
Give valid parameter for item_name/item_id.
This code will be usefull to add/change the icon of the node. You can show the 16x16 image (gif, ico based on your forms_home\forms\java\oracle\forms\registry\Registry.dat file) before the tree item's node lebel.
I tried in this way to get the "Favourites" node label as *"Favourites"* (Bold).
I make *"Favourites"* as a gif icon (16 x 270) and added it as a node icon. but it shows 16 x 16 of my image.
So using this code u cannot format the font of the tree's parent node.
Balaji. -
Parent node showing icons or symbols like - though it does not have leaves
Hi,
I created an adf tree using a view link between region -- countries-- location .. when i see the tree it appears as if all the parent nodes has child nodes as all the nodes indicate an icon or symbol in it... when i expand the nodes i find it does not have any child nodes... how to overcome this... I want symbols or icons only for those nodes that has leaf nodes .So that i need not expand all the nodes . How can it be achieved . Can someone tell me.... I have seen samples but still encounter same problem ...Hi,
for performance reasons, ADF does not query all data from the database and instead uses deferred data fetches when the node is expanded. Because of this optimizations, all tree ends show as nodes. There is a bug I filed to make the performance optimization optional after which you get what you want (by the cost of slower tree rendering if large data sets are involved)
Frank -
Displaying leaf nodes at the bottom of a tree that has parent nodes
I have a problem in that - leaf nodes added to the tree at the bottom appear with big spaces (vertically) between them. It looks as if the nodes are somehow expanded by default!
Is this a known issue with leaf nodes that are added in below parent nodes?
I notice in the normal hierarchy the leaf nodes are displayed fine. Also if I return false on isleaf() it displays the last 3 nodes as expandable icons but they're still lage gaps between them.
this is an example of what i'm getting
Main �
+Parent Node(expandable)
|
+Parent Node(expandable)
|
+Parent Node(expandable)
|
|
|_leaf node (not expandable)
|
|
|_leaf node (not expandable)
|
|
|_leaf node (not expandable)You got my interest with your topic subject as I'm working on a library which simplifies the development with Swing trees. However everyone here except you knows nothing about your "anormal hierarchy" which creates you problem.
Denis Krukovsky
http://sourceforge.net/projects/dotuseful/ -
Problem with trees(Duplication of the parent node in creation of children)
Hi guys i am experiencing a slight problem with the creation of trees.Here is a clear explanation of my program.I created a program that generates edges from a set of datapoints then use each and every edge that is generated to create multiple trees with the edge as the rootnode for each and every tree.Everything up to so far everything went well but the problem comes when i want the program to pick every single tree and traverse through the set of generated edges to create the children of a tree.What it does at the moment for each tree is returning the a duplication of the parent node as the child nodes and that is a problem.Can anyone related with this problem help.Your help will be appreciated.
The code
TreeNode class
package SPO;
import java.util.*;
public class TreeNode
Edge edge;
TreeNode node;
Vector childrens = new Vector();
public TreeNode(Edge edge)
this.edge = edge;
public synchronized void insert(Edge edge)
if(edge.fromNode == this.edge.toNode)
if(node == null )
node = new TreeNode(edge);
childrens.add(node);
else
node.insert(edge);
childrens.add(node);
Tree class
package SPO;
import java.util.*;
public class Tree
TreeNode rootNode;
public Tree()
rootNode = null;
public Tree[] createTrees(Vector initTrees,Vector edges)
Tree [] trees = new Tree[initTrees.size()];
for(int c = 0;c < trees.length;c++)
trees[c] = (Tree)initTrees.elementAt(c);
for(int i = 0;i < trees.length;i++)
for(int x = 0;x < edges.size();x++)
Vector temp = (Vector)edges.elementAt(x);
for(int y = 0;y < temp.size();y++)
trees.insertNode((Edge)temp.elementAt(y));
return trees;
public void printTree(Tree tree)
System.out.print("("+tree.rootNode.edge.fromNode.getObjName()+","+tree.rootNode.edge.toNode.getObjName()+")");
Vector siblings = tree.rootNode.childrens;
for(int i = 0; i < siblings.size();i++)
TreeNode node = (TreeNode)siblings.elementAt(i);
System.out.print("("+node.edge.fromNode.getObjName()+","+node.edge.toNode.getObjName()+")");
System.out.println();
public Vector initializeTrees(Vector edges)
Vector trees = new Vector();
for(int i = 0;i < edges.size();i++)
Vector temp = (Vector)edges.elementAt(i);
for(int j = 0;j < temp.size();j++)
Tree tree = new Tree();
tree.insertNode((Edge)temp.elementAt(j));
trees.add(tree);
return trees;
public synchronized void insertNode(Edge edge)
if(rootNode == null)
rootNode = new TreeNode(edge);
else
rootNode.insert(edge);
EdgeGenerator class
package SPO;
import java.util.*;
import k_means.*;
public class EdgeGenerator
public EdgeGenerator()
public Vector createEdges(Vector dataPoints)
//OrderPair orderPair = new OrderPair();
Vector edges = new Vector();
for(int i = 0;i < dataPoints.size()-1 ;i++)
Vector temp = new Vector();
for(int j = i+1;j < dataPoints.size();j++)
//Create an order of edges
Edge edge = new Edge((DataPoint)dataPoints.elementAt(i),(DataPoint)dataPoints.elementAt(j));
temp.add(edge);
edges.add(temp);
return edges;
Edge class
package SPO;
import k_means.*;
public class Edge
public DataPoint toNode;
public DataPoint fromNode;
public Edge(DataPoint x,DataPoint y)
if (x.getX() > y.getX())
this.fromNode = x;
this.toNode = y;
else
this.fromNode=y;
this.toNode = x;
Entry Point
package SPO;
import java.util.*;
import k_means.*;
public class Tester {
public static void main(String[] args)
Vector dataPoints = new Vector();
dataPoints.add(new DataPoint(140, "Orange"));
dataPoints.add(new DataPoint(114.2, "Lemmon"));
dataPoints.add(new DataPoint(111.5, "Coke"));
dataPoints.add(new DataPoint(104.6, "Pine apple"));
dataPoints.add(new DataPoint(94.1, "W grape"));
dataPoints.add(new DataPoint(85.2, "Appletizer"));
dataPoints.add(new DataPoint(84.8, "R Grape"));
dataPoints.add(new DataPoint(74.2, "Sprite"));
dataPoints.add(new DataPoint(69.2, "Granadilla"));
dataPoints.add(new DataPoint(59, "Strawbery"));
dataPoints.add(new DataPoint(45.5, "Stone"));
dataPoints.add(new DataPoint(36.3, "Yam"));
dataPoints.add(new DataPoint(27, "Cocoa"));
dataPoints.add(new DataPoint(13.8, "Pawpaw"));
EdgeGenerator eg = new EdgeGenerator();
Vector edges = eg.createEdges(dataPoints);
Tree treeMaker = new Tree();
Vector partialTrees = treeMaker.initializeTrees(edges);
Tree [] trees = treeMaker.createTrees(partialTrees,edges);
for(int i = 0;i < trees.length;i++)
treeMaker.printTree(trees[i]);
The program output
Each and every "@" symbol represents the start of a tree
@(Orange,Lemmon)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)
@(Orange,Coke)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)
@(Orange,Pine apple)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)
@(Orange,W grape)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)
@(Orange,Appletizer)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)
@(Orange,R Grape)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)
@(Orange,Sprite)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)
@(Orange,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
@(Orange,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
@(Orange,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
@(Orange,Yam)(Yam,Cocoa)(Yam,Cocoa)
@(Orange,Cocoa)(Cocoa,Pawpaw)
@(Orange,Pawpaw)
@(Lemmon,Coke)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)
@(Lemmon,Pine apple)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)
@(Lemmon,W grape)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)
@(Lemmon,Appletizer)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)
@(Lemmon,R Grape)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)
@(Lemmon,Sprite)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)
@(Lemmon,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
@(Lemmon,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
@(Lemmon,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
@(Lemmon,Yam)(Yam,Cocoa)(Yam,Cocoa)
@(Lemmon,Cocoa)(Cocoa,Pawpaw)
@(Lemmon,Pawpaw)
@(Coke,Pine apple)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)
@(Coke,W grape)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)
@(Coke,Appletizer)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)
@(Coke,R Grape)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)
@(Coke,Sprite)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)
@(Coke,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
@(Coke,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
@(Coke,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
@(Coke,Yam)(Yam,Cocoa)(Yam,Cocoa)
@(Coke,Cocoa)(Cocoa,Pawpaw)
@(Coke,Pawpaw)
@(Pine apple,W grape)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)
@(Pine apple,Appletizer)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)
@(Pine apple,R Grape)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)
@(Pine apple,Sprite)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)
@(Pine apple,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
@(Pine apple,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
@(Pine apple,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
@(Pine apple,Yam)(Yam,Cocoa)(Yam,Cocoa)
@(Pine apple,Cocoa)(Cocoa,Pawpaw)
@(Pine apple,Pawpaw)
@(W grape,Appletizer)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)
@(W grape,R Grape)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)
@(W grape,Sprite)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)
@(W grape,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
@(W grape,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
@(W grape,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
@(W grape,Yam)(Yam,Cocoa)(Yam,Cocoa)
@(W grape,Cocoa)(Cocoa,Pawpaw)
@(W grape,Pawpaw)
@(Appletizer,R Grape)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)
@(Appletizer,Sprite)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)
@(Appletizer,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
@(Appletizer,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
@(Appletizer,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
@(Appletizer,Yam)(Yam,Cocoa)(Yam,Cocoa)
@(Appletizer,Cocoa)(Cocoa,Pawpaw)
@(Appletizer,Pawpaw)
@(R Grape,Sprite)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)
@(R Grape,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
@(R Grape,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
@(R Grape,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
@(R Grape,Yam)(Yam,Cocoa)(Yam,Cocoa)
@(R Grape,Cocoa)(Cocoa,Pawpaw)
@(R Grape,Pawpaw)
@(Sprite,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
@(Sprite,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
@(Sprite,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
@(Sprite,Yam)(Yam,Cocoa)(Yam,Cocoa)
@(Sprite,Cocoa)(Cocoa,Pawpaw)
@(Sprite,Pawpaw)
@(Granadilla,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
@(Granadilla,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
@(Granadilla,Yam)(Yam,Cocoa)(Yam,Cocoa)
@(Granadilla,Cocoa)(Cocoa,Pawpaw)
@(Granadilla,Pawpaw)
@(Strawbery,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
@(Strawbery,Yam)(Yam,Cocoa)(Yam,Cocoa)
@(Strawbery,Cocoa)(Cocoa,Pawpaw)
@(Strawbery,Pawpaw)
@(Stone,Yam)(Yam,Cocoa)(Yam,Cocoa)
@(Stone,Cocoa)(Cocoa,Pawpaw)
@(Stone,Pawpaw)
@(Yam,Cocoa)(Cocoa,Pawpaw)
@(Yam,Pawpaw)
@(Cocoa,Pawpaw)Your program description makes no sense. What exactly is it supposed to do?
Your errors make no sense. What is it doing wrong?
Your program output makes no sense. Look up pre-order, in-order, and post-order notation for representing trees. Pick one of those that you think would be best. I would go with pre-order. Because what you are doing isn't understandable.
By the way, I think your concept of a tree is flawed. A node in a tree has 3 things. it has a reference to its parent, it has references to any of its children, and it has some key value that represents the node (if each node were represented by numbers, the value would be an integer or something). In the case of the root, its reference to its parent is null. I don't know what you are doing with your tree, but it is highly confusing. -
Af:tree Master child relation ,but showing child id's as parent node vice
Hi ,
Am using adf 11G 11.1.1.5
I have a small requiement .
Am using af:tree , where i display childId's . Onclick of child it i have to show popup with tree structure where i will show parentid as node and childId's as child nodes
i have created view link between child and parent views.
Now isssue is when i selected childId in table (i mean a checkbox is given where user check the child Id and fire button ).On dat action am calling popup with tree structure .BUT here childId's are displaying like Parent nodes and parentId's as child node.
any suggestion . if want i will drop the codei knew somewhere i was messed up .
There is only viewlink between, Parent and child .NO FK ,these are not related database table (Entity Object.).
simple query's which are made from same table , but base on Parent/Root col i have show data in tree structure way.
Just like
ParentId Chilld id
100 jhon
100 max
100 adam
101 jack
103 jill
103 marven
Now it will show in table like
jhon
max
adam
jack
jill
marven
If i click max i mean check box and fire button , i have to show tree structure like below
100
jhon
max
adam
As max parentid is 100 , i have to show all the childid which have 100 as parentid.
any suggestion plz , me struck here to handel -
Insert Parent Node From Tree To Another
Hello
My problem is: haw can I insert or shift Parent Node with its child from tree to another without use SQL query.
I should find the child and if this child has a child to shift with the parent to another tree, there are no tools or function can return the child of the node? Or what is the best procedure to do that?
I will be thankful if there some one can help me
RegardsYou can grab the data with ftree.populate_group_from_tree and then use ftree.add_tree_data to put it in another tree.
-
Getting Parent Node On tree Issue..
Hi,
I Have Constructed a Tree and i am Able to get the Details of the clicked Node on the Tree into the Backing Bean.
But I'm unable to get the Parent Node of the Clicked Child Node.
Ex:On Click of Employee(Child Node) in the Tree, I should get the Department (Parent Node) in Backing Bean.
I'm able to get only the details in the same Level of Tree Node(ie All Employees in the Selected Employee Level).
IDE: JDeveloper 10.1.3.2.
Please Suggest me.
Thanking You,
Bandaru.Sounds like you are looking for something like this
Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
SQL> WITH table_1 AS
2 (SELECT XMLTYPE('<sdi_header>
3 <Person>
4 <Customer_First_Name>ABC</Customer_First_Name>
5 <Customer_Last_Name>DEF</Customer_Last_Name>
6 </Person>
7 <warehouse>
8 <Person>
9 <Customer_First_Name>XYZ</Customer_First_Name>
10 <Customer_Last_Name>MNO</Customer_Last_Name>
11 </Person>
12 </warehouse>
13 </sdi_header>') column_name
14 FROM dual) -- WITH simulates your table I do not have
15 select t1.*
16 from TABLE_1,
17 XMLTABLE('for $i in /sdi_header//Person
18 return <root>
19 {$i/Customer_First_Name,
20 $i/Customer_Last_Name}
21 <parent>{$i/../name()}</parent>
22 </root>'
23 PASSING table_1.column_name
24 COLUMNS
25 fname VARCHAR2(20) PATH 'Customer_First_Name',
26 lname VARCHAR2(20) PATH 'Customer_Last_Name',
27 pnode VARCHAR2(20) PATH 'parent') t1;
FNAME LNAME PNODE
ABC DEF sdi_header
XYZ MNO warehouseYou can find out how formatted that message by looking in the FAQ in the upper right. It uses the { code } tag (without spaces). -
How to retrieve a child node's immediate parent node from a tree table?
Hello
Hi,
I have a category_subcategories table, and I would like to know how to construct a sql and sub-sql for retrieving a child node's immediate parent node.
Here is my first part of the sql, it only returns the node "Flash"'s parent and its grand-parents:
SELECT parent.category_name, node.lft, node.rgt
FROM category_subcategories AS node,
category_subcategories AS parent
WHERE node.lft > parent.lft AND node.lft < parent.rgt
AND node.category_name = 'FLASH'
ORDER BY parent.lft;
| name |
| ELECTRONICS |
| PORTABLE ELECTRONICS |
| MP3 PLAYERS | |
how can I modify this query so that it returns Flash' parent - 'MP3 Players'?
Thanks a lot
SamHi,
This is an Oracle forum. If you're not iusing Oracle, make that clear. Always say what version of your softwate you're using, whether it's Oracle or anything else.
Whenever you have a question, post a little sample data (CREATE TABLE and INSERT statements), and the results you want from that data. Explain how you get those results from that data.
It looks like you're using the Nested Sets technique for modeling a tree. To get the parents of given nodes, do something like this:
SELECT parent.category_name
, node.lft
, node.rgt
FROM category_subcategories node -- Can't use AS with table alias in Oracle
, category_subcategories parent
WHERE parent.lft IN (
SELECT MAX (lft)
FROM category_subcategories
WHERE lft < node.lft
AND rgt > node.rgt
AND node.category_name = 'FLASH'
ORDER BY parent.lft; This should work in Oracle 8.1 and up. (I can't actually test it unless you post CREATE TABLE and INSERT statements for some sample data). You may need to modify the syntax a little for your database.
785102 wrote:
Hello,
I tried to implement the solution as follow:
mysql> select parent.*
-> from category_subcategories as parent
-> having parent.lft =
-> (select max(parent.lft) from
-> (SELECT parent.category_name, parent.lft, parent.rgt
-> FROM category_subcategories AS node,
-> category_subcategories AS parent
-> WHERE node.lft > parent.lft AND node.lft < parent.rgt
-> AND node.category_name = 'Sofa'
-> ORDER BY parent.lft
-> )
-> );
ERROR 1248 (42000): Every derived table must have its own alias
mysql>
But I got an error.
What is wrong with it?What does the error message say?
Apparantly, in your system (unlike Oracle), every sub-query must have a name. Try something like this:
select parent.*
from category_subcategories as parent
having parent.lft = (
select max(parent.lft)
from (
SELECT parent.category_name
, parent.lft
, parent.rgt
FROM category_subcategories AS node,
category_subcategories AS parent
WHERE node.lft > parent.lft
AND node.lft < parent.rgt
AND node.category_name = 'Sofa'
ORDER BY parent.lft -- Is this a waste of effort?
) AS got_name_lft_and_rgt
) AS got_lft
;What is the purpose of having the inner sub-query, the one I called got_name_lft_and_rgt?
Also, in Oracle, an ORDER BY clause in a sub-query doesn;t guarantee that any super-queries will keep that order. Why do you have an ORDER BY clause in the sub-query, and not in the main query? -
Tree control parent node label
The following code works fine (except the part in caps, which
isn't code). Suggestions?
private function changeEvt(event:Event):void {
var theData:String = ""
if (event.currentTarget.selectedItem.@value) {
theData = " Data: " +
event.currentTarget.selectedItem.@value;
trace(event.currentTarget.selectedItem.@label + theData);
//trace(NEED PARENT NODE LABEL HERE IF IT EXISTS);
}OK. So I stopped looking too soon. In my case:
trace(browserTree.selectedItem.parent().@label); -
How to add Icon in Tree View in Forms 6.0 (URGENT..!)
Hello All,
I want to add icons in tree view (hierarchical tree) by using
forms 6.0.
So pls. help me to find out the solution for the same.
thanks
Pradeep
nullPradeep (guest) wrote:
: Hello All,
: I want to add icons in tree view (hierarchical tree) by using
: forms 6.0.
: So pls. help me to find out the solution for the same.
: thanks
: Pradeep
hello pradeep,
for adding icons in the tree, u willhave to look closely to the
data format for the tree.in the data format used for populating
the tree we are supplying 5 fields. the state of the tree node
(expanded or collapsed), the depth of the node w.r.t the parent
node, the node value, the node label(what we see on the tree)
and the node icon which we want to use. for the node icon we
have to provide the entire path of the icon file. that's it.
hope this will solve the problem
null
Maybe you are looking for
-
BP upload from CRM to ECC 6.0 in table KNA1
Hello @ll, I have a problem with created business partners in CRM and the upload to ECC 6.0. I use the IS-M solution in ECC 6.0. The requirements of the process interdicts the entries in table BUT000 (which is mandatory in IS-Media). Only the debitor
-
I am trying to set up iCloud on iPhone 5
Hello, I've been trying to set up iCloud on my iPhone 5 and iPad3 and running into the same problem message at top of screen saying "account not verified". "check your email for instructions to verify this account". When I check my email, there are
-
.mac sync icon won't go away!
Unexpectedly at the bar on the top of the screen, I get a ".mac sync" icon. I do not have a .mac account, and never had. I believe this icon showed up after I installed the latest Safari update, but I'm not certain. When I go to preferences, it simpl
-
I would like to encrypt directory used for system backup and EFS private must be protected by TPM. I have a valid certificate (template derived from "EFS Basic" + "Microsoft Platform Crypto Provider" RSA/2048) D:\>whoami nt authority\system D:\>certu
-
What does a zone in ORS map to on MWM ?
Guys: I am using ORS right now and I know what a zone means in their terminology. Since zone is a common concept used by both MWM and ORS what data elements on the MWM side represent a zone ?