JSF tree component
Hello,
I am using JSF 1.1
+ looking to add tree functionality to a couple of rows.
I know that myfaces has it but would like to know if JSF 1.1 also have something similar to tree2 from myfaces.
Thanks!
The Sun RI of JSF does not have a tree component like MyFaces.
You will either have to create your own custom tree component using the Sun JSF RI (could be a lot of work, especially if you've never created a custom component before), or use the MyFaces one.
CowKing
Similar Messages
-
Jdeveleoper- JSF- Tree component
Hi,
I am new to JSF and JDeveloper. I want to have a tree component using JSF. Any suggestions on how to create a tree component??
regards,
Meenakshi.SHi, currently there is no JSF tree componenet. You can use ADF faces tree or
myfaces tree2. -
Tree Component with incremental auto-refresh?
Is there a free (preferably) or commercial JSF tree component with a general AJAX-based incremental auto-refresh?
Essentially when dealing with a tree of data which can lose or add nodes at any time, it would be nice to have an optional polling mechanism built into the tree that would check the server for tree insertion and removal events and handle any such events whenever they're found via incremental AJAX-based modifications to the tree -- not a full refresh. The same is true for tree node change events.
To be clear this is not a substitute for handling client events -- the tree data is indicative of shared state and changes independently from user actions.I was following instructions from [http://niallcblogs.blogspot.nl/2009/06/auto-refreshing-adf-chart-objects-in.html]
But I got it to work the way you say.
But setting refresh="always" generates exceptions in even simple cases. Is it because I am using MySQL which does not have event notification support? -
JSF Tree Node -Removing Green Patch
Dear Everyone, Anyone, Someone
I want to remove the green patch from the jsf tree component, it appears whenever we select the tree node, if we have given link from treenode, Can anyone suggest me some way.
Please do the needful help as soon as possible.
Regards,
Ashish Samantwant to remove the green patch from the jsf tree componentas u said ,, it is COMPONENET so this is a pre-made creator component that u cant chnage its attributes ,,
instead u can extract Theam.jar file and change the icons ,, u i didnt do it before ,, but u may be find what u want there,
hope this will help
good luck
Mohammed -
Hello,
I'm presently looking for a JSF tree component. I need one which not only would allow me to display a little icon next to my leaves names, but which would allow me to display a checkbox too.
I've tried the Apache MyFaces tree, in the Tomahawk sub-project. But it looks like I won't manage to add a checkbox without changing its code.
A clue, anyone ? With MyFaces or anything else ?
AlienQueenbelow is my code from my project
perhaps it is useful for your problem
* Copyright 2005 The Apache Software Foundation.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
package com.itlt.clb.action;
import org.apache.myfaces.custom.tree2.HtmlTree;
import org.apache.myfaces.custom.tree2.TreeNode;
import org.apache.myfaces.custom.tree2.TreeNodeBase;
import org.apache.myfaces.custom.tree2.TreeModel;
import org.apache.myfaces.custom.tree2.TreeModelBase;
import com.itlt.clb.entity.Agency;
import com.itlt.clb.util.HibDb;
import com.itlt.clb.util.Loginer;
import com.itlt.clb.util.constant.ConstParas;
import javax.faces.context.FacesContext;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.validator.ValidatorException;
import javax.faces.event.ActionEvent;
import java.io.Serializable;
import java.util.List;
* Backer bean for use in example. Basically makes a TreeNode available.
* @author Sean Schofield
* @version $Revision: 1.9 $ $Date: 2007-05-31 09:17:44 $
public class TreeBacker implements Serializable
private TreeModelBase _treeModel;
private HtmlTree _tree;
private boolean select;
public boolean isSelect() {
return select;
public void setSelect(boolean select) {
this.select = select;
public TreeNode getTreeData()
String formatFolder = "foo-folder";
int agencyCodeLen = 5;//代理编码长度
long agencyId = Loginer.getCurLogin().getUserclerk().getAgency().getId();
TreeNode treeData = null;
//首先得到中港通的数据.
List chinaLinkList = HibDb.queryHQL("from Agency a where a.id ='"+agencyId+"' and a.status = '"+ConstParas.common3Status.ACTIVE.getStatus()+"'", 0, 0);
Agency chinaLinkAgency = null;
if(chinaLinkList != null && chinaLinkList.size() > 0){
chinaLinkAgency = (Agency)chinaLinkList.get(0);
if(chinaLinkAgency.getCode().length()==agencyCodeLen)
formatFolder = "foo-folder";
else
formatFolder = "bar-folder";
treeData = new TreeNodeBase(formatFolder, "<input type='checkbox' id='agency_"+chinaLinkAgency.getId()+"' value='"+chinaLinkAgency.getId()+"' onclick='getSelectAgency(this)'>"+chinaLinkAgency.getName()+"", false);
// construct a set of fake data (normally your data would come from a database)
List list = HibDb.queryHQL("from Agency a where a.agency.id='"+chinaLinkAgency.getId()+"' and a.status = 'A'", 0, 0);
Agency agency = null;
Agency subAgency = null;
Agency subAgencyPoint = null;
TreeNodeBase personNode = null;
TreeNodeBase folderNode = null;
TreeNodeBase folderNodePoint = null;
for(int i=0;i<list.size();i++){
agency = (Agency)list.get(i);
if(agency.getAgency() != null){
if(agency.getCode().length()==agencyCodeLen)
formatFolder = "foo-folder";
else
formatFolder = "bar-folder";
personNode= new TreeNodeBase(formatFolder, "<input type='checkbox' id='agency_"+chinaLinkAgency.getId()+"_"+agency.getId()+"' value='"+agency.getId()+"'onclick='getSelectAgency(this)'>"+agency.getName()+"", false);
//去找到所有属于它的销售点
//System.out.println(" agency.getId() = "+agency.getId());
List subList = HibDb.queryHQL("from Agency a where a.agency.id = '"+agency.getId()+"'and a.status ='"+ConstParas.common3Status.ACTIVE.getStatus()+"'", 0, 0);
for(int k=0;k<subList.size();k++){
subAgency = (Agency)subList.get(k);
if(subAgency.getCode().length()==agencyCodeLen)
formatFolder = "foo-folder";
else
formatFolder = "bar-folder";
folderNode = new TreeNodeBase(formatFolder, "<input type='checkbox' id='agency_"+chinaLinkAgency.getId()+"_"+agency.getId()+"_"+subAgency.getId()+"' value='"+subAgency.getId()+"'onclick='getSelectAgency(this)'>"+subAgency.getName()+"", false);
// folderNode.getChildren().add(new TreeNodeBase("document", "X050001", true));
// personNode.getChildren().add(folderNode);
List subListPoint = HibDb.queryHQL("from Agency a where a.agency.id = '"+subAgency.getId()+"' and a.status = '"+ConstParas.common3Status.ACTIVE.getStatus()+"'", 0, 0);
for(int l=0;l<subListPoint.size();l++){
subAgencyPoint = (Agency)subListPoint.get(l);
if(subAgencyPoint.getCode().length()==agencyCodeLen)
formatFolder = "foo-folder";
else
formatFolder = "bar-folder";
folderNodePoint = new TreeNodeBase(formatFolder, "<input type='checkbox' id='agency_"+chinaLinkAgency.getId()+"_"+agency.getId()+"_"+subAgency.getId()+"_"+subAgencyPoint.getId()+"' value='"+subAgencyPoint.getId()+"'onclick='getSelectAgency(this)'>"+subAgencyPoint.getName()+"", true);
folderNode.getChildren().add(folderNodePoint);
// personNode.getChildren().add(folderNode);
personNode.getChildren().add(folderNode);
treeData.getChildren().add(personNode);
return treeData;
* NOTE: This is just to show an alternative way of supplying tree data. You can supply either a
* TreeModel or TreeNode.
* @return TreeModel
public TreeModel getExpandedTreeData()
return new TreeModelBase(getTreeData());
public void setTree(HtmlTree tree)
_tree = tree;
public HtmlTree getTree()
return _tree;
public String expandAll()
_tree.expandAll();
return null;
private String _nodePath;
public void setNodePath(String nodePath)
_nodePath = nodePath;
public String getNodePath()
return _nodePath;
public void checkPath(FacesContext context, UIComponent component, java.lang.Object value)
// make sure path is valid (leaves cannot be expanded or renderer will complain)
FacesMessage message = null;
String[] path = _tree.getPathInformation(value.toString());
for (int i = 0; i < path.length; i++)
String nodeId = path;
try
_tree.setNodeId(nodeId);
catch (Exception e)
throw new ValidatorException(message, e);
if (_tree.getNode().isLeaf())
message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
"Invalid node path (cannot expand a leaf): " + nodeId,
"Invalid node path (cannot expand a leaf): " + nodeId);
throw new ValidatorException(message);
public void expandPath(ActionEvent event)
tree.expandPath(tree.getPathInformation(_nodePath));
it support your checkboxi
Message was edited by:
lysmart -
JSF tree view GUI component and tree node actions
Hi,
I am new in using JSF and have a problem with my simple test application.
The application contains a tree view control with one static tree node and a separate text area. Clicking on the tree node shall fill the text area with the string 'hello'. Seems to be very simple, but it doesn't work.
What did I do?
First of all I use the Sun Java Studio Creator 2.
By double clicking on the tree node in the design window of the IDE a method called treeNode1_action() was created. I also added the String text to the session bean. treeNode1_Action() does not more than setting text='hello' ( getSessionBean().setText('hello'); ).
The jsp file contains the line
<ui:textArea binding="#{Page1.textArea}" id="textArea" style="height: 192px; left: 360px; top: 48px; position: absolute; width: 456px" text="#{SessionBean1.text}"/>, so the text of the text area is bound to the session property 'text'.
Running the application and clicking on the tree node does nothing except reloading the page (no 'hello' inside the text area).
Using the debugger showed me that the bean property text is set correctly to 'hello', also after reloading the page.
What did I do wrong?
What do I have to do to display 'hello' in the text area?
I would be glad for some good advice to solve my problem and looking forward for an answer.
Regards from germany
Matthiaswant to remove the green patch from the jsf tree componentas u said ,, it is COMPONENET so this is a pre-made creator component that u cant chnage its attributes ,,
instead u can extract Theam.jar file and change the icons ,, u i didnt do it before ,, but u may be find what u want there,
hope this will help
good luck
Mohammed -
JSF Tree construction - My Faces Tree2 Component development
Hi
I am planning to recommend JSF and MyFaces for the development of the application.
like Navigation Tree on the left side, header, footer and body ..
1) Can any one share a piece of code to develop Dynamic Navigation Tree(like ServerSideToggling ..I will get the data from backend based on the I will build the Tree with leafs, when we click on leafs we need to call action to redirect to other jsps ) we can achieve this using MyFaces Tree2 Component,Just wondering if anybody know some information, any info is appreciated.
Parent1
|
--Child1__
|--sub child 1
--Child2
--Child3
Parent2
|
--Child1__
|--sub child 1
--Child2
--Child3
Conditions:
1) Need to construct the Tree based on backend data.
2) All the Parents and Children should be links, like when I click on any link, I need to call an action and forward it some other page.
For testing I hardcoded and built one tree, which look similar...but the dynamic tree needs server side toggling..which requires...handling of backend data...constructing a tree...If you could share a sample, I will be appreciated...mean while I will try to do this...
thanks
jishHI jish,
A couple suggestions.
While the MyFaces (tomahawk) components may be very useful, I would encourage you to make sure you're using JSF from the Mojarra project. It is more stable and better supported: https://javaserverfaces.dev.java.net
Also, I would encourage you NOT to use JSPs. JSF 2.0 will favor a facelets-style syntax, so you should consider using Facelets or JSFTemplating instead. JSP is also slower and more cumbersome to work with. Try: https://jsftemplating.dev.java.net or https://facelets.dev.java.net . Either one of these projects replace JSP and provide "templating" support (which doesn't exist when using JSP) as well as many other features to help you (like JSFTemplating's factories for creating dynamic trees).
I don't use MyFaces Tree2 component (I use Woodstock's Tree component), however, I think the concepts should be the same. Here's some a link to a very complicated example (GlassFish Admin Console Tree code which is generated from several backend sources + updated via Ajax):
https://glassfish.dev.java.net/source/browse/glassfish/admin-gui/src/docroot/peTree.jsf?rev=1.12&view=markup
A more simple example:
<sun:tree text="Tree Example" clientSide="false" url="http://www.google.com">
<sun:treeNode text="Static Tree Node" actionExpression="#{some.thing}">
<dynamicTreeNode treeAdaptorClass="com.sun.enterprise.tools.admingui.tree.MBeanTreeAdaptor"
objectName="com.sun.appserv:type=applications,category=config"
methodName="getAllDeployedJ2EEApplications"
text="Dynamic Tree Node"
url="/applications/enterpriseApplications.jsf"
attributeName="name"
childURL="applications/enterpriseApplicationsEdit.jsf?appName=#{$this{valueBinding}.text}" />
</sun:treeNode>
</sun:tree>Another place to look is the scales project. The lead developer on that project is actively developing a Tree component that will have a very clean interface to interacting with dynamic trees.
Good luck!
Ken Paulsen
https://jsftemplating.dev.java.net -
Question on removing a child node in a tree component - JSF
When I m trying to delete a child node in a tree component the focus is not transfering to the parent node. I m using the setselected method to set the focus to the current node but not sure how to transfer the focus to parent node once I delete a child node. Please advice.
Doubleposted: [http://forums.sun.com/thread.jspa?threadID=5389876]. Please stick to one topic or use the edit button.
-
How to create dynamic tree component
I am using netbeans 5.5 and visual web pack to develop my jsf application.
I want to add a tree component that will be tied to a table with following columns:
id,parent_id,name
Actually the table stores data in tree structure with parent_id storing the parent of the row.
So a row with parent_id = 0 will be the root nodes of the tree.
When ever any root node is selected i want to fetch its children from the database and populate then as children of that parent node.
The tree can go to any depth so i want to make my tree component dynamic enough to handle this requirement.
How can i accomplish this.
I just want to add listerner for the plus sign of every node so that when the plus sign of that node is clicked i just want to get the id of the corresponding node.What i'm trying to do is create an organizational structure.
Global>Region>Plant-->Corporation
The output from the RFC is a structure containing every possible combination for orgazational hierarchy. Basically a flat table with record for every possible combinaton of Region-Plant-Corporation. This data needs to be bound to a tree structure so that we can call BW queries based on that level. For example: Give me aged inventory for the SAP corporation within the plant Berlin that is located in the Europe region.
Now that you understand the business reason will the nodes that represent Region and Plant and corporation be non-singleton nodes or recursive? I was thinking a hierarchy of non-singleton nodes.
I can bind these nodes to the Region - Plant - Corporation elements returned from in the flat table structure. I will probably get duplicates as a specific Region will be listed multiple times for every possible combination of the data beneath it. I'm not so concerned about that right now as I want to make sure I understand how in Web Dynpro to bind the data to the tree.
Hopefully this makes some sense. Can you elaborate on how this may be constructed in context of the view?
Would i create a model node for region (0..n), model node for plant (0..n), and a model node for Corporation (0..n)?
Or does this sound totally incorrect?
julian
We have 3 regions over 50 plants and probably around 500 corporations. -
JSF tree with radiobuttons support
Hi everybody,
I need to create JSF tree with possibility to select both nodes and leaves with radio button.
The only idea I have now is to create my own component, which will generate [BlueShoes JavaScript tree|http://www.blueshoes.org/_bsJavascript/components/tree/examples/example8.html]
Perhaps anyone has better idea? Maybe anyone has already met JSF trees with radiob uttons support?
Thanks beforehandunfortunately, the browser usually uses right click to bring up a browser's menu for copy/paste, etc. I don't think javascript can intercept that though I could be wrong.
-
Code for Tree component(tomahawk )
I am new to JSF,I want a tree component in my page and i want to construct the tree by retriving data from database.I searched most of materials but could'nt find any good one.
How would it match the trees? What have you done so far?
/Kaj -
Error in t:tree component of tomahawk
I am using tree component of tomahawk like this in my xhtml file
<t:tree id="tree" value="#{treeBean.tree}"
styleClass="tree"
nodeClass="treenode"
selectedNodeClass="treenodeSelected"
expandRoot="true">
</t:tree>
and this is my class file,
public class TreeBean
private DefaultTreeModel tree;
public DefaultTreeModel getTree() {
return tree;
public void setTree(DefaultTreeModel tree) {
this.tree = tree;
public TreeBean()
DefaultMutableTreeNode root = new DefaultMutableTreeNode("XY");
DefaultMutableTreeNode a = new DefaultMutableTreeNode("A");
root.insert(a);
DefaultMutableTreeNode b = new DefaultMutableTreeNode("B");
root.insert(b);
DefaultMutableTreeNode c = new DefaultMutableTreeNode("C");
root.insert(c);
DefaultMutableTreeNode node = new DefaultMutableTreeNode("a1");
a.insert(node);
node = new DefaultMutableTreeNode("a2 ");
a.insert(node);
node = new DefaultMutableTreeNode("b ");
b.insert(node);
a = node;
node = new DefaultMutableTreeNode("x1");
a.insert(node);
node = new DefaultMutableTreeNode("x2");
a.insert(node);
tree = new DefaultTreeModel(root);
but when i run my xhtml file, i am getting error like this,
java.lang.NullPointerException
at org.apache.myfaces.custom.tree.HtmlTree.addToModelListeners(HtmlTree.java:806)
at org.apache.myfaces.custom.tree.HtmlTree.encodeBegin(HtmlTree.java:683)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:232)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:217)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:197)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
at incture.view.SecurityFilter.doFilter(SecurityFilter.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:217)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:197)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
How to solve this,
Regars,
Vinutha.Hi i have the same problem, Did you found a solution ?
-
MyFaces Tree Component Rendering
Hi all,
I am adding myfaces client tree Component to my panel.Its not rendering and its throwing exception.
anyhelp would be appriciated
Thanks
SudhaHi,
I am trying to render myfaces client tree on faces portlet using RAD 6.0. As RAD does not support JSF 1.1, I have commented DOCTYPE from faces-config.xml in tomahawk.jar file.
Root of the tree is getting displayed without "+" sign. And when I click on it,
javascript error "Object Expected" occurs.
I am not able to figure out the problem from last 2 days. So, Please help me out if you can.
Thanks in anticipation.
~Madhura -
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 -
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(){
Maybe you are looking for
-
I cannot open any tabs on Firefox. It opens to my homepage, but there is no line for a URL address. Therefore, there is no way to type in a new URL address. I have uninstalled and reinstalled Firefox twice and it has not helped. I am a former PC user
-
How do I copy songs from one itunes library to another itunes library on the same computer?
I want to share some songs in my iTunes library with my granddaughter's iTunes library, both of which are located on the same computer. I managed to copy one of the songs through Finder to the location where the music resides, but it doesn't appear
-
Does the newest version work with Windows XP Professional
I have only a windows XP Professional. Is the "game" over?
-
Why are my external drives un-mounting themselves?
Since installing OS Lion, my external G-tech drives have un-mounted themselves at least twice. Anybody got any ideas as to why? Also, other than powering the external drives down, then re-powering them up again, so iMac can detect them, is there a wa
-
Cash Journal (Withholding tax)
Hi guru While making payment to vendor through cash journal i am unable to deduct the wihholding tax, the withholding tax screeen is in grey view. I have maintian W tax key for Inv and Pay and tick on liable but still i am unable to deduct the w tax