Loading Tree
Hi,
I want to initial my root Node to making a Tree. my data model columns are id,parent and leaf .
how should i load this tree recursively? i have implemented TreeNode interface.
thanks
> Hi,
I want to initial my root Node to making a Tree. my
data model columns are id,parent and leaf .
how should i load this tree recursively? i have
implemented TreeNode interface.
thanks
Have a look at this tutorial:
http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
Similar Messages
-
Shared Services 9.3.1 error - "...error loading tree data"
We have recently upgraded to version 9.3.1 and have been using it for several months now.
This past week, when logging in to Shared Services, we are suddenly experiencing a pop up with an error that says "There was a communication error while loading tree data".
Has anyone seen this error, and why would it suddenly start appearing when everything has worked for months and no changes have been applied?
Thanks for any advice, I will post screens and some sections from log files soon...We are also facing the issue while accessing the Hyperion Planning 9.3.1 application from Workspace. But it allows us to access it through planning URL. The workspace classic administration for planning works perfectly fine. Let me know in case you get any solution.
-
Dynamic loading tree and data grid
Hi All,
I new to java as well as JSF. I am very impressed with the jsf and Sun Java Creator IDE. I made a sample project.
Now I want to load tree and data grid with dynamic values how can I achieve this.
Please help to find out some examples.
Also I need to know who I can use SOAP call using JSF.
Thanks
CSCSTo dynamically load a Basic Table (ui:table) from a database, see http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/databoundcomponents.html
To dynamically load a Basic Table from other sources of data that are loaded into an array or such, see http://blogs.sun.com/roller/page/divas?entry=table_component_sample_project
To dynamically CREATE a Basic Table, see http://developers.sun.com/prodtech/javatools/jscreator/reference/tips/2/createTableDynamically.html and http://developers.sun.com/prodtech/javatools/jscreator/reference/tips/2/add_component_to_table.html
To dynamically create an HTML table on the fly, see section 7.5 in Chapter 7 of the Field Guide at http://developers.sun.com/prodtech/javatools/jscreator/learning/bookshelf/index.html
To dynamically create a tree, see Dynamic Tree example at http://developers.sun.com/prodtech/javatools/jscreator/reference/index.jsp.
A tutorial for dynamically creating a tree from a database is work in progress.
Hope this helps,
Chris -
Shared Services Error: Failed to load Tree
Hi All,
I am trying to open up an application in Shared services under the projects folder:
path : Projects -> Analytic Servers:<Server Name> -> <Application>
When I do this the page just keeps loading for a very long time and then gives me an error which says "Failed to load Tree"
Can anyone help me out on what the problem is here?
The exact error message is : "There was a communication error while loading tree data"
Regards,
Anindyo
Edited by: user644118 on Oct 31, 2008 4:27 PMAnindyo,
Which operating system are you working on, I remember some one faced same problem when it was solaris, am not very sure though.I guess , it has something to do with 'Hyperion Remote Authentication Module'.
Sandeep Reddy Enti
HCC
http://hyperionconsultancy.com/ -
Loading tree data lazily?
I have a tree to display some ejb3 entities; the entities are
related to each other in a tree hierarchy. I implement
ITreeDataDescriptor to load the entities into the tree, which works
fine. However, when I try to expand a branch node, I got an error
"PersistenceCollection initializing", because the collections are
marked to load lazily. So I need to do the following in sequence:
1. Intercept the branch opening event; (I can do this by
listening for itemOpening)
2. Find out which item is being opened;
3. Load the collection for that item;
4. Wait till the collection finishes loading, then continue
with the branch open;
I can figure out how to do steps 1 and 3, but have no idea
how 2 and 4 could be done. I appreciate if someone could shed a
light on this."wt.ustc" <[email protected]> wrote in
message
news:gmva76$2mq$[email protected]..
>I have a tree to display some ejb3 entities; the entities
are related to
>each
> other in a tree hierarchy. I implement
ITreeDataDescriptor to load the
> entities
> into the tree, which works fine. However, when I try to
expand a branch
> node, I
> got an error "PersistenceCollection initializing",
because the collections
> are
> marked to load lazily. So I need to do the following in
sequence:
>
> 1. Intercept the branch opening event; (I can do this by
listening for
> itemOpening)
> 2. Find out which item is being opened;
> 3. Load the collection for that item;
> 4. Wait till the collection finishes loading, then
continue with the
> branch
> open;
>
> I can figure out how to do steps 1 and 3, but have no
idea how 2 and 4
> could
> be done. I appreciate if someone could shed a light on
this.
This might help:
http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html -
Flex Lazy Loading Tree example posted
Hi, all;
I've posted a new example to my blog:
http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html
This example demonstrates
- Using lazy loading with a Tree component.
- Using an interface rather than a concrete type to allow the
LazyDataDescriptor to work with any class that implements
LazyLoading.
- An all-actionscript remoting connection
It also has the PHP files and instructions for creating the
mySQL database
that provide the service data."danger42" <[email protected]> wrote in
message
news:gkig47$hqu$[email protected]..
> Very cool!
Thanks :-) -
Loading Tree Node/Leaf causing numerous errors
I am loading a tree with UNSPSC codes using an application engine program with code borrowed from a delivered app engine program. The code loads most of the codes, however I receive numerous errors as follows:
Node not Found (92,3209) - I get this a lot but the data still loads in both PSTREENODE and PSTREELEAF
Return: 805 - ORA-00001: unique constraint (FS.PS_PSTREELEAF) violated
Failed SQL stmt:UPDATE PSTREELEAF SET TREE_NODE_NUM = :1, OLD_TREE_NODE_NUM = 'N' WHERE SETID = :2 AND SETCNTRLVALUE = :3 AND TREE_NAME = :4 AND EFFDT = TO_DATE(:5,'YYYY-MM-DD') AND OLD_TREE_NODE_NUM = 'Y' AND TREE_NODE_NUM = :6
Tree Save error (92,3061)
-- This error will rollback my changes to my last commit point, which, because of this error, I am committing after every value (saving tree, closing tree, and reopening the tree).
Node index error (0,0)
Node insert error (0,0)
-- These errors still allow me to enter the data.
A node without a parent was detected: %1 (25,22)
-- This error causes an abend.
The code used to update the tree is very simple (this code was copied verbatim from PV_CP_LOAD along with additional functions):
REM ****************************************************************************************;
Function AddToTree(&CAT_ID, &CAT_ID_PAR, &CAT_NAME, &ACCOUNT, &SIBLING)
REM ****************************************************************************************;
rem Add child to parent;
If &CAT_ID <> &FIRST_NODE Then
&MYNODE = &MS_TREE.FindNode(&CAT_ID, "");
If None(&MYNODE) Then
&MYNODE = &MS_TREE.FindNode(&CAT_ID_PAR, "");
If All(&MYNODE) Then
&NEWNODE = &MYNODE.InsertChildNode(&CAT_ID);
If All(&NEWNODE) Then
&NEWLEAF = &NEWNODE.INSERTDYNCHILDLEAF();
&NodeCount = &NodeCount + 1;
End-If;
End-If;
Else
rem in case tree node is already there, but category isn't;
rem addcategories(&CAT_ID, &CAT_NAME, &ACCOUNT, &CATEGORY_REC);
End-If;
End-If;
End-Function;
I am getting roughly 50% failure rate.
Is there a database issue? Configuration of my Tree?What I discovered is that Node API method INSERTDYNCHILDLEAF tries to re-number all the leafs inserted each time it is called. However, it doesn't check to see if the TREE_NODE_NUM already exists. Since the TREE_NODE_NUM column is a key, it causes a unique constraint error.
I pointed this out to Oracle, however, since I was using this function in a custom app engine program, they would not look at the problem. My app engine trace clearly showed the problem.
I ended up re-writing the program to insert directly into the PSTREENODE and PSTREELEAF tables, controlling the TREE_NODE_NUM and PARENT_NODE_NUM columns myself. The result was a tree with 20499 rows with 0 audit errors. -
Hi,
My current application contains a <mx:tree>
his dataprovider is an xml file loaded from a httpservice
this tree have a renderer extends TreeItemRenderer that allow me to add checkbox when node doesn't have childs.
When user check or uncheck a node, i put some information in a datagrid.
This datagrid is finally export to a file.
Now the question is how can i initialize the tree using the two file (the original and this saved) ?
See below my renderer code :
package manageCheckBox
import flash.events.Event;
import flash.events.MouseEvent;
import mx.collections.IViewCursor;
import mx.controls.Alert;
import mx.controls.CheckBox;
import mx.controls.DataGrid;
import mx.controls.treeClasses.*;
import mx.controls.treeClasses.TreeItemRenderer;
public class DisplayCheckBox extends TreeItemRenderer{
public var chk:CheckBox;
public var itemXml:XML; // original xml file
public var dg:DataGrid; // datagrid to put information on
public var myFields:XML; // saving file
public function DisplayCheckBox(){
super();
mouseEnabled = false;
override public function set data(value:Object):void{
if(value != null){
super.data = value;
this.itemXml = XML(value);
if(this.itemXml.@checked == "1"){
this.chk.selected = true;
}else{
this.chk.selected = false;
override protected function createChildren():void{
super.createChildren();
chk = new CheckBox();
chk.addEventListener(MouseEvent.CLICK, handleChkClick);
addChild(chk);
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
super.updateDisplayList(unscaledWidth,unscaledHeight);
if(super.data){
var tld:TreeListData = TreeListData(super.listData);
if(tld.hasChildren){
this.chk.visible = false;
}else{
this.chk.visible = true;
if(chk.visible){
this.chk.x = super.label.x
super.label.x = this.chk.x + 17;
this.chk.y = super.label.y+8;
private function handleChkClick(evt:MouseEvent):void{
if(this.chk.selected){
this.itemXml.@checked = "1";
// put information on the datagrid
dg.dataProvider.addItem(
"col1": this.itemXml.@label,
"col2": this.itemXml.@label,
"col3": this.itemXml.@resourceId
}else{
//this.checked = false;
this.itemXml.@checked = "0";
var vObject:Object = dg.dataProvider ;
var cursor:IViewCursor=vObject.createCursor();
while( !cursor.afterLast )
if(cursor.current.col1 == this.itemXml.@label) {
cursor.remove() ;
cursor.moveNext();
Thanks in advanc for your reply,
Regards,
HadanMarvA) The tree region is not refresh-enabled. If you want it to act on any change in session state the page will always have to be submitted/reloaded to reflect those changes.
B) Providing a where-clause to the tree query is not done. There is nothing to achieve by doing so because of the nature of the query: the connect by occurs before the where clause filtering. You will break any and all metadata for the whole tree construct to use.
Consider nodes which are from a different department than the one you filter on: how would the tree have to be constructed? What if a parent node misses because of that? How would it's child nodes match up? Worse: what if you select a dept which does not belong to the root node? The root node would not be displayed and subsequently no child nodes would be shown. Simply because the generated meta-data does not match up.
Eg if "BLAKE" would be "SALES" and "JAMES" would be "ACCOUNTING", and you filter on dept = "ACCOUNTING", then "BLAKE" would be gone... But "JAMES" too. Just to illustrate how the represented data would be wrong.
There is a reason the tree query requires the addition of the LEVEL pseudo-column, as this is used to iterate over the data to provide to the tree. You can see how horribly a where clause breaks that mechanism by simply running the query in sql developer or the sql workshop.
tldr; Don't. -
Data retrieval from a loaded tree in WD ABAP
Hi All,
I have a node 'ENTRY' and have a recursive sub node called 'SUB_ENTRY' now assume that i have created a 10 level tree by creating 9 recursive nodes. Now i would like to fetch or retrieve all the data from this tree.
So can you pls tell me if there exists a method to do it in one go or will i have to use GET_TABLE_FROM_NODE for every node ..
Thanks for your help.
Regards,
AnoopYes Thomas you are right about the use of ByKey and NestingColumn but the thing is that as far as application development is concerned then i am done with that .. but it was to improve the performance of this application that i needed to know if i can retrieve the already available data from this tree instead of calling the FMs again which is very costly ...
anyways thanks for your response.
Regards,
Anoop -
Connector Class Loader in OC4J Classloader Tree
Where does connector class loader fit in the OC4J class loader tree. Is it a parent to the EJB Classloader (as in SunOne) or does it use its own classloader to load classes (similar to weblogic). Becos it can impact visibility into resource adapter's classes.
The classloader tree in the ClassLoadingInOC4J_WP.pdf applies to 10.1.2 and 9.0.4, probably even earlier, where the connector classcloader is the root classloader of an application.
For 10.1.3, the root classloader of an application loads both connector jars and ejb jars. See chapter 3 of Oracle Containers for J2EE Developer's Guide(10.1.3 preview). -
I'm using the tree component for a little Windows Parody I'm making. In my .fla, There's a tree component that loads an external XML file. I can't figure out how to add custom icons to my component, though.
I know it's possible to set the icons for just the default folder and file icons, but since it's a Windows Parody, there'll be different icons for different file types, folder types, etc.
In other words, I'd like to have a different icon for every item in my Tree component.
How can I do this?
Here are the contents of my XML file:
<node>
<node label="Desktop">
</node>
<node label="Documents">
<node label="Pictures" isBranch="true" />
<node label="Movies" isBranch="true" />
<node label="Games" isBranch="true" />
<node label="Video" isBranch="true" />
</node>
<node label="Computer">
<node label="Local Disk (C:)" isBranch="true" />
<node label="Local Disk (D:)" isBranch="true" />
<node label="DVD-RAM Drive (E:)" isBranch="true" />
<node label="DVD/CD-RW Drive (F:)" isBranch="true" />
</node>
<node label="Readme.txt" isBranch="true" />
</node>
And the code on the first frame of my .fla file. The Tree's name is "fileTree", and the XML file is "doors_explorerXML.xml".
//Tree
var fileDP:XML = new XML();
fileDP.ignoreWhite = true;
fileDP.load("doors_explorerXML.xml");
fileDP.onLoad = function() {
fileTree.dataProvider = this.firstChild;
Also, I don't need to have an XML file loaded. If there's an easy way that does it all within Flash, please tell me. I just need to be able to handle events from the Tree.Im having the same issue. I dont know how to change the tree icons separately with the xml. Is there anyone who knows how to do it?
This is what I got so far. However, i can only get my first branch to show custom icons. I tried ALOT, but i guess I´m doing something completely wrong.
Here is the code for my tree so far:
my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.load("tree.xml");
my_xml.onLoad = function(){
myTree.dataProvider = this.firstChild;
var folders = my_xml.firstChild.firstChild;
var docs = folders.childNodes;
for (var i=0; i < docs.length; i++){
currDoc = docs[i];
trace(docs[i]);
var docIcon = currDoc.attributes.pic;
switch(docIcon){
case "pdf":
myTree.setIcon(currDoc, "pdfIcon");
break;
case "word":
myTree.setIcon(currDoc, "wordIcon");
break;
case "excel":
myTree.setIcon(currDoc, "excelIcon");
break;
case "ie":
myTree.setIcon(currDoc, "ieIcon");
break;
}//switch
} //for
};//onLoad
And here is the XML I used:
<node label="» Dokument typer">
<node label="» links - document">
<node label="test.url" url="http://www." pic="ie" info="test text" />
<node label="test.doc" url="test.doc" pic="word" info="test text" />
<node label="test.excel" url="test.xls" pic="excel" info="test text" />
<node label="test.pdf" url="test.pdf" pic="pdf" info="test text." />
</node>
<node label="» Links - document">
<node label="test URL" url="http://www." pic="ie" info="test text." />
<node label="test URL" url="http://www." pic="ie" info="test text." />
</node>
</node> -
Populate Flex Tree from Java Code (Database)
Hi
Can someone please help me? I'm very new to using flex. I'm
basically trying to create a tree that is populated from data in my
database. I am using hibernate to fetch that data.
The plan is to basically create the tree in Java code (since
I don't want any processing done on the client PC) and then pass
this to the flex tree (or an actionscript data structure that is
compatible as the tree datasource)
I am creating the java tree using DocumentImpl. Is this
correct? What class would work?
Element e = null;
Node n = null;
Document xmldoc= new DocumentImpl();
Element root = xmldoc.createElement("USERS");quote:
Originally posted by:
ntsiii
Stop running and get a map (read the documents)
This is hardly a useful comment and must discourage new users
from asking questions. If you think the documentation relating to
the use of the tree control is straightforward then I beg to
differ.
If you are aware of a clear example of how to use the data
tree with a php backend returning a remote data object please
enlighten me. Meanwhile I continue my search but not within the
livedocs.
One site I have found that may be of use is
http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html
Not everyone is an expert. -
Need help regarding tree control
hello guys,
i m working on one Flex slideshow application and i m using Xml loaded tree control with swf loader for this. i want to create next previus button for nevigate this slideshow but i dont know much about action script... please help me
i will provide u code of my script if you need to correct it or suggest me how to make it.
thanks in advance
sagarhere is sourcecode of my file
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" showCloseButton="true" close="PopUpManager.removePopUp(this);" width="1366" height="768" title="Promotions" fontFamily="Verdana" fontSize="13">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
private function processLogin():void {
// Check credentials (not shown) then remove pop up.
PopUpManager.removePopUp(this);
import mx.effects.easing.*;
//index button script
private function toggleBtn(e:MouseEvent):void{
if(e.currentTarget.label== 'Open')
panelOut.play();
else
panelIn.play();
import mx.collections.ICollectionView;
import mx.events.ListEvent;
// tree control script
private function tree_itemClick(evt:ListEvent):void {
var t:Tree = evt.currentTarget as Tree;
var dataObj:Object = evt.itemRenderer.data;
var item:Object = Tree(evt.currentTarget).selectedItem;
if (dataObj.hasOwnProperty("@src")) {
swfLoader.source = dataObj.@src;
} else if (t.dataDescriptor.isBranch(t.selectedItem)) {
swfLoader.source = null;
tree.expandItem(item, !tree.isItemOpen(item), true);
panel1.status = "";
private function tree_labelFunc(item:Object):String {
var children:ICollectionView;
var suffix:String = "";
if (tree.dataDescriptor.isBranch(item)) {
children = tree.dataDescriptor.getChildren(item);
suffix = " (" + item.children().length() + ")";
return item.@label + suffix;
private function swfLoader_complete(evt:Event):void {
panel1.status = (swfLoader.bytesTotal/1024).toFixed(2) + 'KB';
private function init():void
systemManager.stage.displayState=flash.display.StageDisplayState.FULL_SCREEN;
]]>
</mx:Script>
<mx:XML id="dp" source="data/dp.xml" />
<mx:Canvas x="30" y="-1" width="1315" height="725">
<mx:Panel id="panel1"
width="1310"
height="712"
backgroundColor="white"
borderThickness="0"
borderThicknessBottom="0"
borderThicknessLeft="0"
borderThicknessRight="0"
borderStyle="none" cornerRadius="0"
headerHeight="0" left="2" y="3">
<mx:SWFLoader id="swfLoader"
scaleContent="true"
complete="swfLoader_complete(event);" />
<mx:ControlBar>
</mx:ControlBar>
</mx:Panel>
</mx:Canvas>
<mx:Move id="panelOut" target="{panel}" xTo="0" effectEnd="btn.label='Close'"
duration="500"/>
<mx:Move id="panelIn" target="{panel}" xTo="-283" effectEnd="btn.label='Open'"
duration="500"/>
<mx:Canvas id="panel" width="314" height="725" x="-283" backgroundColor="#00A2FF" verticalCenter="-1">
<mx:Grid x="10" y="10" width="299">
<mx:GridRow width="100%" height="707">
<mx:GridItem width="100%" height="100%">
<mx:Tree id="tree"
dataProvider="{dp}"
labelFunction="tree_labelFunc"
showRoot="false"
width="269"
height="706"
itemClick="tree_itemClick(event);" alpha="0.85" backgroundColor="#C0E1FF"/>
</mx:GridItem>
<mx:GridItem width="22" height="100%" verticalAlign="middle">
<mx:LinkButton label="" id="btn" width="22" height="707"
click="toggleBtn(event)" icon="@Embed(source='assets/index.png')" enabled="true"/>
</mx:GridItem>
</mx:GridRow>
</mx:Grid>
<!--Add the content of your sliding panel here -->
</mx:Canvas>
</mx:TitleWindow> -
Tree slow and bug with Add Multiple Items to End
Hello,
I use "Add Multiple Items to End" to fill a tree quickly in Labview 8.5.
In my test example, It's possible to choise an array of 100, 255 or 1000. parents.
Each parent has 10 children
100 is correctly, 255 is slowly an 1000 is big bug !
Y does a solution, or it has Labview major weaknesses with the function tree.
Thanks for you help.
A. Carbonnel
AC
Attachments:
Load Tree.vi 37 KBHere is the response of France rupport labview
Sir,
The behavior you observed beyond 1000 elements vi Tree is a known bug of R & D LabVIEW. Pending that it is corrected in a future version, I invite you to use the ActiveX Treeview. He should be able to meet your expectations in terms of number of elements.
You can see an example of the use of the ActiveX in attachments.
Sincerely,
AC
Attachments:
Tree view.zip 48 KB -
How to drag and drop nodes in Tree?
Hi,
I want to drag and drop nodes in the tree. For example a tree represents the hierarchy of employees reporting in an organization by using tree.I want to change the reporting an employee visible in the tree by simple drag and drop operation in place of going to another form for updating each employee record indiviually.
Regards
PiyushRon,
I looked into implementing drag / drop in one of the apex trees I created today and ran across this thread. Thank you Ron for the links, it helped a lot.
I added the code below to my page's "Execute when Page Loads" (tree region id is "tree_reg") and the tree is now drag/drop enabled.
It did break the [+] icon from collapsing the tree though ... but the apex.widget.tree buttons still work
var regTree = apex.jQuery("#tree_reg").find("div.tree");
regTree.tree({
callback : {
onmove: function(NODE, TREE_OBJ, REF_NODE, TYPE)
{alert(NODE.id+" "+TREE_OBJ.id+" "+ REF_NODE);}
});Next, I plan on creating a AJAX call using NODE.id, TREE_OBJ.id, and REF_NODE
V/R
Ricker
Maybe you are looking for
-
Sales analysis report by warehouse?
Hi there, Is there a way to run the standard sales analysis report in SAP B1 by warehouse? Or is it just able to run at company level? If it can't be run over a specific warehouse would a query have to be written? Regards Steve Lowery
-
Suggestions for fixing a problem?
My boyfriend is having an unusual problem with his iPod (30 GB w/ color display). Whenever he attempts to skip over several tracks, the iPod suddenly just resets itself. I tried to fix it by restoring it to factory settings and having him start fresh
-
Syn-Asyn Bridge and correlation
Regarding Sync-Asyn ,I have gone thru these blogs... Demonstrating Use of Synchronous-Asynchronous Bridge to Integrate Synchronous and Asynchronous systems using ccBPM in SAP Xi - Use of Synch - Asynch bridge in ccBPM https://www.sdn.sap.com/irj/sdn/
-
Default value for af:richTextEditor
Hi Whenever nothing is written in af:richTextEditor null is displyed on screen. Is there any way to specify, black space or any default value if nothing is entered in af:richTextEditor. I tried doing it with required="true immediate="true" but in my
-
Title needs render on FCP4.1
Hi there guys ! I am sub titling a short film that I've done but I started to develop this rendering problem. I might have the settings wrong and that's why is asking me to render. I would understand if I had a lot of efx on the film or three or four