Customizing the Tree Component
Is there a way to set different font sizes and colors for
different levels of the tree menu?
I am guessing that you are using AS2 components, as there is
not a default Tree component for AS3...
I don't know about font sizes, but you can set depth colors
for the AS2 Tree.
The following will set the background colors to black, medium
grey, lighter grey for the Tree that is named "myTree":
var colorArray:Array = new Array();
colorArray.push(0x000000);
colorArray.push(0x555555);
colorArray.push(0x999999);
myTree.setStyle( "depthColors", colorArray );
Note that this is based on the depth. IE for the node
structure:
<node label="First Level">
<node label="Second Level">
<node label="Third Level">
</node>
</node>
</node>
First Level with have a black background, Second Level will
have a medium grey background and Third Level will have a lighter
grey background.
Similar Messages
-
Customizing the Tree Component inn ADF Faces..
HI,
I am using the ADF Faces Tree Component and was wondering wheteher we
can use a specific theme instead of the default one..
The scenario's i am looking at are
1) Changing the Style of the Selected Node
2) Programatically can i assign a different styling for a Specific
Node (Previously Selected) in the Tree ??
3) And any info reg Enabling the Drag and Drop functionality ?? As of
now i don't think it is supported. Are there any plans of it being
supported in the furture releases??
Thanks
SateeshHi,
1) See tree skin selectors: http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/skin-selectors.html
2) You can reference a managed bean for providing the inline style sheet on a component. This however only works when the tree is re-drawn and not dynamically
3) Drag and drop doesn't work in 10.1.3.x. In 11 this may work - havent tested yet - using a client listener component
Frank -
A question about the Tree Component
I have try to use the tree component i a flash page, and
it´s going allright until I´ll want to link the content
to a page... WHY??
I have tried a lot of different codes here are those I tried:
<tree>
<folder label="Mine own">
<link label="My page" url="
http://www.mickesei.se" />
</folder>
</tree>
Nr2:
<tree>
<folder label="Mine own">
<link label="My page" link="
http://www.mickesei.se" />
</folder>
</tree>
nr3:
<tree>
<folder label="Mine own">
<link label="My page" href="
http://www.mickesei.se" />
</folder>
</tree>
nr4:
<tree>
<folder label="Mine own">
<link label="My page" get URL="
http://www.mickesei.se" />
</folder>
</tree>
But nothing seems to work, when I go mouse over it still a
arrow should it?
HELP ME PLEASE!!! MickeThanx Jeanne,
You brought me on a idea with the UIX Developer's Guide and EXPANDABLE_EXPANDED value.
I couldn't figure out how the expand property was filled, because it wasn't done in the ADF BC ViewObject. We have a Utility class that creates a DataObject from the ViewObject Data and here the expand property was set.
Now it was easy to build a ExpandAll option. It is possible to access the HttpServletRequest object were the DataObject is created. By setting a attribute in the request I could react on that and give the expand property indeed the value EXPANDABLE_EXPANDED.
Dennis -
How do you change the Tree Component Icons?
Hi,
I have been trying to get to grips with the tree component. I
want to
customise it so that I can have a different icon for each
different link.
E.g. a QT logo for a video etc. If no valuse is found for the
'icon'
attribute it will just display the default.
Within my XML file I have created a new attribute for each
link called
'icon' and has a value of 'movie.gif' or something similar.
In my flash file, I have created the following code:
theTree.iconFunction = function (node:XMLNode) {
var iconNode:String = item.attributes.icon;
if (iconNode != undefined) {
return iconNode;
However, it does not seem to work. My knowledge of
ActionScript is pretty
poor so I assume I have made a mistake in there somewhere.
Can anyone help
me with this?
Thanks!Check out the Component Reference... you change the icon for
a single node, as far as I know there's no automated process beyond
that. So assuming your tree component instance is named "theTree"
you might do this to change the icon of the first node:
theTree.dataProvider = yourXML; // make sure you don't try to
change the icon before you load data into the tree
var theNode = theTree.getTreeNodeAt(0); // the first node in
your tree
theTree.setIcon(theNode,'myIcon'); // set the icon
Where "myIcon" is a MovieClip you have in your library that
you have set the "linkage identifier" as "myIcon".
That iconFunction doesn't make a whole lot of sense to me,
because first of all I don't know why it would be attached to
theTree, and second it's referring to "item" which is not defined,
and third its taking the parameter "node" and not doing anything
with it. But perhaps there is some cool way to make a single
function which handles icons for your entire tree automatically,
that would certainly be nice.
However, like I said, as far as I know that function will do
nothing without calling tree.setIcon() in some way. I just made a
function which might do what you want -- it recursively loops
through an entire tree and sets it's icon based on the XML
attribute "icon":
function setAllIcons(branch){
for(var i in branch.childNodes){
var node = branch.getTreeNodeAt(i);
theTree.setIcon(node,node.attributes['icon']);
if(node.hasChildNodes){
setAllIcons(node);
So basically, you run setAllIcons(theTree.dataProvider) after
you have loaded and applied the XML. -
Do any one know how to make the tree component transparent?
I´ve tried a lot of different things but it doesn´t seem
to work. I´ve tried to make it to a moviclip and drag the
Alpha to 0 but then it doesn´t work at all. You can´t see
the nodes..
Please..
[email protected]I have achieved this by placing the tree and data components
within a container movie clip, and then changing the alpha of that
container.
It worked for me. -
Change the Tree Component background
Does anyone know how can i change the Tree Component
background ?
PLS HELPCheck out the Component Reference... you change the icon for
a single node, as far as I know there's no automated process beyond
that. So assuming your tree component instance is named "theTree"
you might do this to change the icon of the first node:
theTree.dataProvider = yourXML; // make sure you don't try to
change the icon before you load data into the tree
var theNode = theTree.getTreeNodeAt(0); // the first node in
your tree
theTree.setIcon(theNode,'myIcon'); // set the icon
Where "myIcon" is a MovieClip you have in your library that
you have set the "linkage identifier" as "myIcon".
That iconFunction doesn't make a whole lot of sense to me,
because first of all I don't know why it would be attached to
theTree, and second it's referring to "item" which is not defined,
and third its taking the parameter "node" and not doing anything
with it. But perhaps there is some cool way to make a single
function which handles icons for your entire tree automatically,
that would certainly be nice.
However, like I said, as far as I know that function will do
nothing without calling tree.setIcon() in some way. I just made a
function which might do what you want -- it recursively loops
through an entire tree and sets it's icon based on the XML
attribute "icon":
function setAllIcons(branch){
for(var i in branch.childNodes){
var node = branch.getTreeNodeAt(i);
theTree.setIcon(node,node.attributes['icon']);
if(node.hasChildNodes){
setAllIcons(node);
So basically, you run setAllIcons(theTree.dataProvider) after
you have loaded and applied the XML. -
Using the Tree component of ADF
Hi!
I am wondering if someone could show me a small example of a tree component with pre-defined columns.
Thank you in advance for your assistance!Would you be able to provide an example or a couple of links to resources about how to do so?
I've looked at http://download.oracle.com/docs/cd/E12839_01/web.1111/b31973/af_table.htm#CIADBJCJ, but it doesn't quite explain enough for me.
The example of a treemodel provided there is:
List<TreeNode> root = new ArrayList<TreeNode>();
for(int i = 0; i < firstLevelSize; i++)
List<TreeNode> level1 = new ArrayList<TreeNode>();
for(int j = 0; j < i; j++)
List<TreeNode> level2 = new ArrayList<TreeNode>();
for(int k=0; k<j; k++)
TreeNode z = new TreeNode(null, _nodeVal(i,j,k));
level2.add(z);
TreeNode c = new TreeNode(level2, _nodeVal(i,j));
level1.add(c);
TreeNode n = new TreeNode(level1, _nodeVal(i));
root.add(n);
ChildPropertyTreeModel model = new ChildPropertyTreeModel(root, "children");
private String _nodeVal(Integer... args)
StringBuilder s = new StringBuilder();
for(Integer i : args)
s.append(i);
return s.toString();
}Is a TreeNode a custom class that contains the fields for the tree? -
Hi All,
For example, consider a book shop,where the different types
book are available written by different authors.
here is the my problem statement........................
Am using the tree controls to display book name as parent
node,author names as a child nodes to it.for example assume that
there are 3 books available on Java written by 3 different
authors.Now the display should look like, Java as the parent node
and the author names with check box as the child node to it and i
want make the author name collapsible i.e when i click on the
author name it should show me the details about the author.
If there is any book with only one author then it should be
displayed as a child node(not under the any of the parent node)
is it possible?Any help can be appreciated.
Thanks in Advance."sankar83" <[email protected]> wrote in
message
news:gmh3nd$dmo$[email protected]..
> Hi All,
> For example, consider a book shop,where the different
> types
> book are available written by different authors.
>
> here is the my problem statement........................
>
> Am using the tree controls to display book
> name
> as parent node,author names as a child nodes to it.for
example assume that
> there are 3 books available on Java written by 3
different authors.Now the
> display should look like, Java as the parent node and
the author names as
> the
> child node to it and i want make the author name
collapsible i.e when i
> click
> on the author name it should show me the details about
the author.
>
> If there is any book with only one author then it should
be
> displayed as
> a child node(not under the any of the parent node)
>
> is it possible?Any help can be appreciated.
You can probably do it with a custom DataDescriptor -
Problem refreshing the Tree Component icons
Hello,
I'm using the Tree, adding the nodes dinamically, following the example: http://www.netbeans.org/kb/55/vwp-databasetree.html
This Tree shows the access permissions from the users, and show a red icon on the itens without permissions and a green icon on the itens with permissions.
In the nodes, I add an action that change this permissions when the user click.
If the permission is Ok on the clicked item, the action remove this permission and vice-versa.
The action is working fine, but the problem is the refresh of the tree after click. The icons stay like before the click. It is refreshed only if I navigate to another page and return after. Then the icons are showed correct.
In the method that add the nodes, I select the node icons like this:
if (havePermissionModulo(grupo, modulo)){
moduloNode.setImageURL(imgPermissaoOk);
}else{
moduloNode.setImageURL(imgPermissaoNegada);
Where imgPermissaoOk and imgPermissaoNegada have the path to the images.
Sorry by my english :)It is hard to tell
When the user clicks on an icon, is the page submitted to the server and the page redisplaying itself?
Is the tree's clientSide property cleared (that is, false).
Is the browser caching the images? What if you hit a Shift-Reload? -
Customizing the calendar component
hi,
I am using jdev 11.1.2.0
In calendar component when in the list mode. we are having one button name "Today" and along with date range. My requirment is to display today date when clicking of today button in list mode.
Is it possible.How can i customize the the toolbar.
Any help would appreciated.Hi,
Check this out: http://jdevadf.oracle.com/adf-richclient-demo/faces/components/skinningKeys/calendar.jspx
AP -
Custom icon per entry in the AS2 Tree Component (using CS3)
I have a tree component that loads its data from an XML file and I wonder if I can customize every entry to have its own icon by adding an icon attribute to every entry in the XML and giving the tree an action to read that icon (which would exist in the library of the Flash file). My goal is to reproduce a tree within an application that my company is developing (it's for a training tool related to that application).
My XML says something like <node label = 'Label' heading = 'LABEL' desc = 'Description' icon = 'icon1' />
My label is what the tree displays, the heading is what the information dialog in the training tool displays as a title bar, the desc is what the training tool displays within the body of the text for the function description and the icon is what I want to be a reference to the graphic in the library to place as an icon in front of the item rather than use setStyle with the properties for disclosure, leaf, and folder icons.
Is that possible? I haven't found a solution for it yet.I've never used the Tree component, so I'm just guessing here....
There is a slight delay before the xml file loads and your tree has its data provider.
Perhaps during that time there is no node at mTree.getTreeNodeAt(0) to open? Try adding this just before the last line of your code:
trace("the node is: "+mTree.getTreeNodeAt(0));
What do you get?
You might need to move that code inside the xml's load event handler.
Another thing is that the Flash components tend to work on an invalidate-then-wait-one-frame-to-redraw kind of model. So it is possible you will need to wait one frame after the xml has loaded and then tell it to open that node.
The doLater method might help with that.
var home:MovieClip=this;
var xmlTreeData:XML = new XML();
xmlTreeData.onLoad = function() {
mTree.dataProvider = this.firstChild;
mTree.doLater(home,"delay");
xmlTreeData.ignoreWhite = true;
xmlTreeData.load("xml/treeValues1.xml");
mTree.setStyle("fontSize","11");
mTree.setStyle("selectionColor","0xE0E0E0");
mTree.setStyle("useRollOver",false);
function delay(){ -
hey guys... i've run into yet another problem...
i have a tree component that gets its data from a httpservice.. xml file.
i then pasrse thru the recieved xml to create a dataprovider for the tree component. the code for that is below...
<mx:Tree id="tree" dataProvider="{treeData2}" showRoot="false" width="50%" height="100%" />
[Bindable] public var treeData2:ArrayCollection = new ArrayCollection;
[Bindable] public var treeData:Object;
public var resultArr:Object;
public function initNavTab():void{
var navService:HTTPService = new HTTPService();
navService.url = "http://www.apxalarm.com/pages/getnav";
navService.method = "POST";
navService.useProxy = false;
navService.resultFormat = "e4x";
//navService.resultFormat = "array";
navService.addEventListener(ResultEvent.RESULT, returnNavData);
navService.addEventListener(FaultEvent.FAULT, navDataFault);
navService.send();
public function returnNavData(event:ResultEvent):void{
navData = event.result;
//resultArr = event.result;
Alert.show("load complete");
tree_labelFunc(navData);
public function navDataFault(event:FaultEvent):void{
Alert.show(event.fault.faultDetail);
public function tree_labelFunc(item:Object):void{
var node:XML = XML(item);
var nav:XMLList = new XMLList();
nav = node.sections;
var i:Number = 0;
for each (var section:XML in nav.section){
var obj:Object = new Object();
obj.label = section.name;
obj.urlName = section.urlName;
obj.children = new ArrayCollection;
for each(var nav1:XML in section.navs.nav){
obj.children.addItem([{label: nav1.name}]);
treeData2.addItem(obj);
the tree_labelFunc parces thru the xml and creates the appropriate structure i need to be displayed in the tree component... but unfortunately the children of the tree component only shows [Object, Object]
can someone show me how to display the labels instead of the Object???
thank you soo much in advace guys!!! i really appretiate it!!!
oh and this is part of the xml that it is pulling
<siteMap>
<sections>
<section>
<name>About APX</name>
<urlName>about</urlName>
<position>1</position>
<defaultaction>/about/mission</defaultaction>
<navs>
<nav>
<name>Our Mission</name>
<urlName>mission</urlName>
<position>1</position>
<defaultaction>13</defaultaction>
<subNavs/>
</nav>
<nav>
<name>Links</name>
<urlName>links</urlName>
<position>4</position>
<subNavs>
<nav>
<name>iamapx.com</name>
<urlName>iamapx</urlName>
<position>1</position>
<defaultaction>http://www.iamapx.com</defaultaction>
<subNavs/>
</nav>
<nav>
<name>apxgivesback.com</name>
<urlName>agb</urlName>
<position>2</position>
<defaultaction>http://www.apxgivesback.com</defaultaction>
<subNavs/>
</nav>
</subNavs>
</nav>
<nav>
<name>Newsletter</name>
<urlName>newsletter</urlName>
<position>3</position>
<defaultaction>37</defaultaction>
<subNavs/>
</nav>
</navs>
</section>
<section>
</section>
<section>
</section>
<section>
</section>
<section>
</section>
<section>
</section>
</sections>
</siteMap>
i need the name tags in the xml to be displayed in the tree component....
again thank you soo much in advace for your help!!thank you soo much for your quick responce alex!!
the toXMLString is exactly like the xml
<siteMap>
<sections>
<section>
<name>About APX</name>
<urlName>about</urlName>
<position>1</position>
<defaultaction>/about/mission</defaultaction>
<navs>
<nav>
<name>Our Mission</name>
<urlName>mission</urlName>
<position>1</position>
<defaultaction>13</defaultaction>
<subNavs/>
</nav>
<nav>
<name>Links</name>
<urlName>links</urlName>
<position>4</position>
<subNavs>
<nav>
<name>iamapx.com</name>
<urlName>iamapx</urlName>
<position>1</position>
<defaultaction>http://www.iamapx.com</defaultaction>
<subNavs/>
</nav>
<nav>
<name>apxgivesback.com</name>
<urlName>agb</urlName>
<position>2</position>
<defaultaction>http://www.apxgivesback.com</defaultaction>
<subNavs/>
</nav>
</subNavs>
</nav>
<nav>
<name>Newsletter</name>
<urlName>newsletter</urlName>
<position>3</position>
<defaultaction>37</defaultaction>
<subNavs/>
</nav>
</navs>
</section>
<section>
<name>APX Security Systems</name>
<urlName>apxsystems</urlName>
<position>2</position>
<defaultaction>/apxsystems/systems/products</defaultaction>
<navs>
<nav>
<name>Service Areas</name>
<urlName>serviceareas</urlName>
<position>1</position>
<defaultaction>25</defaultaction>
<subNavs/>
</nav>
<nav>
<name>Systems</name>
<urlName>systems</urlName>
<position>2</position>
<defaultaction>27</defaultaction>
<subNavs>
<nav>
<name>Get A System</name>
<urlName>get</urlName>
<position>2</position>
<defaultaction>27</defaultaction>
<subNavs/>
</nav>
<nav>
<name>Browse Products</name>
<urlName>products</urlName>
<position>1</position>
<defaultaction>28</defaultaction>
<subNavs/>
</nav>
<nav>
<name>Refer A Friend</name>
<urlName>refer</urlName>
<position>3</position>
<defaultaction>38</defaultaction>
<subNavs/>
</nav>
</subNavs>
</nav>
</navs>
</section>
<section>
<name>Customer Support</name>
<urlName>support</urlName>
<position>3</position>
<defaultaction>/support/specialist</defaultaction>
<navs>
<nav>
<name>Technical Support</name>
<urlName>tech</urlName>
<position>2</position>
<defaultaction>32</defaultaction>
<subNavs>
<nav>
<name>Troubleshooting</name>
<urlName>troubleshooting</urlName>
<position>2</position>
<defaultaction>32</defaultaction>
<subNavs/>
</nav>
</subNavs>
</nav>
<nav>
<name>Speak To A Specialist</name>
<urlName>specialist</urlName>
<position>1</position>
<defaultaction>30</defaultaction>
<subNavs/>
</nav>
<nav>
<name>Move Options</name>
<urlName>moves</urlName>
<position>3</position>
<defaultaction>35</defaultaction>
<subNavs/>
</nav>
</navs>
</section>
<section>
<name>Home Safety</name>
<urlName>safety</urlName>
<position>4</position>
<defaultaction>/safety/outside</defaultaction>
<navs>
<nav>
<name>Indoor Tips</name>
<urlName>inside</urlName>
<position>1</position>
<defaultaction>17</defaultaction>
<subNavs/>
</nav>
<nav>
<name>Outdoor Tips</name>
<urlName>outside</urlName>
<position>2</position>
<defaultaction>18</defaultaction>
<subNavs/>
</nav>
</navs>
</section>
<section>
<name>Customer Stories</name>
<urlName>stories</urlName>
<position>5</position>
<defaultaction>/stories/videos</defaultaction>
<navs>
<nav>
<name>Videos</name>
<urlName>videos</urlName>
<position>3</position>
<defaultaction>15</defaultaction>
<subNavs/>
</nav>
<nav>
<name>Read Stories</name>
<urlName>read</urlName>
<position>1</position>
<defaultaction>19</defaultaction>
<subNavs/>
</nav>
<nav>
<name>Tell Your Story</name>
<urlName>tell</urlName>
<position>2</position>
<defaultaction>20</defaultaction>
<subNavs/>
</nav>
</navs>
</section>
<section>
<name>Newsroom</name>
<urlName>press</urlName>
<position>6</position>
<defaultaction>/press/compprofile</defaultaction>
<navs>
<nav>
<name>Press Releases</name>
<urlName>pr</urlName>
<position>2</position>
<defaultaction>21</defaultaction>
<subNavs/>
</nav>
<nav>
<name>Media Kit</name>
<urlName>media</urlName>
<position>3</position>
<defaultaction>22</defaultaction>
<subNavs/>
</nav>
<nav>
<name>Company Profile</name>
<urlName>compprofile</urlName>
<position>1</position>
<defaultaction>34</defaultaction>
<subNavs/>
</nav>
<nav>
<name>Contact Us</name>
<urlName>contact</urlName>
<position>4</position>
<defaultaction>39</defaultaction>
<subNavs/>
</nav>
</navs>
</section>
</sections>
</siteMap>
i need to subNavs to be available within the tree dropdown... -
Custom background Colour of tree component
I want to set custom background to each node of the tree
component.
I've tried
myTree.setPropertiesAt(2, {backgroundColor:0x000000});
or
myTree.getTreeNodeAt(2).setStyle("backgroundColor",
0x000000);
but also not working
how could I do this?
pls help.From the API docu
Further, if you do not invoker super's implementation you must honor the opaque property, that is if this component is opaque, you must completely fill in the background in a non-opaque color. If you do not honor the opaque property you will likely see visual artifacts.
I read this as either call super.paintComponent() or you must draw a filled rectangle of the background color yourself, but that whether it changes the background color or not, also depends on the setOpaque(true).
Reading that it seems as though it is a combination of our suggestions. -
Clicking a tree node does not refresh the fields in the table component
hi all,
I am using a tree component along with a table component in my page.so whenever i am clicking on a node it should display the relevant information of that node in the table from the database.But whenever i am doing the page is not refreshing and the old values of the textfields in the table still exist.i have written the code to populate the table in a button click event.It is working fine but the same is not working when i am clicking any node in the tree component.Can anyone provide a solution to this problem.
Thanks and regards,
Prasant KumarNever mind... I actually found something that works...
treeModel.nodeStructureChanged(leadSelection); -
[F8] Tree Component: How can I hide/remove the scrollbar and border?
I'm using the Tree Component in my Flash 8 Pro - Project. I'm
trying to customize the look of the Tree component in two ways:
1. Is there any way to remove the scrollbar from the Tree
Component?
2. Can I also remove the Border from the Tree Component?
I checked the Component Inspector and couldn't find any
options for the scrollbar nor the border.
Does anyone know how to do this or could you point me in the
right direction?
ThanksYou can use the Status-4-Evar extension to replace some functionality that was lost withthe removal of the Status bar in Firefox 4.
Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout" after you have installed the Status-4-Evar extension and drag the items (Status Text, Progress Meter, Download Status) upon the Add-ons Bar (View > Toolbars > [X] Add-on Bar)
* Status-4-Evar: https://addons.mozilla.org/firefox/addon/235283/
Maybe you are looking for
-
I would like to use Formcentral form data to populate a pdf with the same fields. Is that possible?
-
Confirmation of delivery via EDI (SHPCON) incl. actual pick quantity & GI
My client makes use of a logistics service provider. Based on the delivery a dispatch order is sent (SHPORD) Idoc type DELVRY03. The logistics service provider receives the dispatch order, picks the materials and confirms the actual picked quantities
-
Delete folder in a particular scenario using batch file
How to achieve this using a batch file? The batch file should check if inside this folder "c:\test\", a directory named "temp1" only is present. If so then delete the folder test, but if the folder test contains more directories and files other than
-
Export a presentation in quicktime with a long video
Hello, I have the latest revamped Keynote program. I have two slides, on the second I've put a video hai is about 30 minutes. When I export it on quicktime the second slide with the video only last 5 seconds and so the video is cut at the beginning.
-
Help!..Urgentfixed Screen Resolution with Graphics Configuration
Hello, i am try to make our swing application resolution fixed. whatever is system resolution does't matter. my application always running on 1024 *768 mode. But i face some problem when i run the project with is feature and open any dialog by clicki