CheckBox Tree Component

Hye guys,
I need a custom tree component for some xml elements that represent some files and their attributes. I have written one such component but what I need now to add to this component is Checkboxes.
The user is supposed to select files from this Tree component via these chk boxes.
Can someone point me in the direction of such an existing Tree component.
Or if I have to write one how do I go about it.
Pls donot point me to the Java tutorial. I read it but I still have a very very vague idea, if any idea at all, of doing this.
Regards

worth a look
http://forum.java.sun.com/thread.jsp?forum=57&thread=122006

Similar Messages

  • 3 State CheckBox Tree

    I just downloaded the 3 State CheckBox Tree custom control
    from the Flex dev exchange a few moments ago. I put the code into a
    Flex prject, compiled it and ran it pretty much unchanged. When I
    click on any of the tree controls I get the error message:
    ArgumentError: Error #2025: The supplied DisplayObject must
    be a child of the caller.
    at flash.display::DisplayObjectContainer/getChildIndex()
    at mx.managers::SystemManager/getChildIndex()
    at mx.managers::SystemManager/::mouseDownHandler()
    Anybody else download this tag and have a problem like
    this???
    Have an Ordinary Day...
    KomputerMan ~|:-)

    O.K. I pulled the downloaded component inside an existing
    application and ran it from there. The problem was that the
    downloaded component had a <mx:Application...> tag in it
    which gave me two templates with the <mx:Application ...>
    tag. Flex didn't like this too much. After I renamed the
    <mx:Application...> tag in the downloaded component to
    <mx:Canvas...> life was good. One of those duh moments...
    DUH!!! :)
    Have an Ordinary Day...
    KomputerMan ~|:-)

  • A tree component

    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 ?
    AlienQueen

    below 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;//&#20195;&#29702;&#32534;&#30721;&#38271;&#24230;
              long agencyId = Loginer.getCurLogin().getUserclerk().getAgency().getId();
              TreeNode treeData = null;
              //&#39318;&#20808;&#24471;&#21040;&#20013;&#28207;&#36890;&#30340;&#25968;&#25454;.
              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);
                        //&#21435;&#25214;&#21040;&#25152;&#26377;&#23646;&#20110;&#23427;&#30340;&#38144;&#21806;&#28857;
                        //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

  • Checkbox Tree in JavaFX

    Does anybody has an idea where I find an example for a checkbox Tree? Thx

    There is no Checkbox Tree control in JavaFX (as of now). I've written one long time back in Java. You could adopt it to use in JavaFX as a swing component.
    [http://winstonprakash.com/sources/java2html/tree/JCheckBoxTree.java.html]
    [http://winstonprakash.com/sources/java2html/tree/JCheckBoxTreeTester.java.html|http://winstonprakash.com/sources/java2html/tree/JCheckBoxTree.java.html]

  • 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(){ 

  • Label display issue in Tree component when it is having vertical scrollbar

    I am using tree component as dropdown factory for combo box. When i open dropdown, it doesn't have vertical scrollbar and all the root nodes are getting displayed correctly(in closed mode). Now if i try to open any node, i am getting vertical scrollbar as the child nodes are more. Now the problem is if scroll down, some of the nodes(labels) are not getting displayed but i am able to see the icon. If i keep on scrolling bottom to top and top to bottom, some of the nodes are showing labels and some are not(It is inconsistant).
    I have not used any custom item renderer for tree control. I used my custom dataDescriptor which i have implemented from ITreeDataDescriptor. Also I tried extending DefalutDataDescriptor, but no luck.

    Does it work if the tree is not in a combobox?

  • Layout issue with af:tree component

    I am using af:tree component but I am finding layout issue with it. I have a requirement where in I need the tree to stretch to the available space but a horizontal and a vertical scrollbar comes up automatically. Is there a way to handle this issue?

    User, without your jdev version it's hard to help.
    Have you embedded the tree component in a stretch layout?
    Timo

  • [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?
    Thanks

    You 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/

  • Tree Component Icons

    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>

  • Questions about AS2 Tree Component (Flash CS3)

    I have Flash application with a Tree component on the Stage. I'm using an XML file to create the structure of the Tree component.
    Each entry on my XML has the attributes id, label, heading, desc, and icon.
    My problem is that I can't seem to be able to set the Tree to default with the first node open.
    My code is:
    var xmlTreeData:XML = new XML();
    xmlTreeData.onLoad = function() {
    mTree.dataProvider = this.firstChild;
    xmlTreeData.ignoreWhite = true;
    xmlTreeData.load("xml/treeValues1.xml");
    mTree.setStyle("fontSize","11");
    mTree.setStyle("selectionColor","0xE0E0E0");
    mTree.setStyle("useRollOver",false);
    mTree.setIsOpen(mTree.getTreeNodeAt(0), true);
    My tree populates fine, and the handler I retrieve whatever item is clicked works great. However, the tree refuses to default to having that first node open.
    I'm also interested in placing custom icons into certain nodes via the icon attribute I've set in the XML, but that will have to come later I guess.

    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(){ 

  • Ext. data source and Tree component

    Im using tree component and XMLConnector here.
    as far as i can see results in my tree (when testing my
    movie) it ouputs data thats loaded fom ext. XML file.
    But the problem is that it publishes [type Function] in the
    tree.
    no actual xml nodes are visible, just bunch of [type
    Function]
    ive also searched for info / tutorial how to publish actual
    xml data in the tree component but without any luck.
    So what should i do and how ?

    Solved
    xml tags needed just a label with attributes

  • Tree component and loading xml files into text field

    Hello and thank you for taking the time to read my issue....
    I am making a simple self help application.  I have a tree component that loads the different catagories and topics for my help app dynamically via an xml file...no issues there.
    I then want it so that when the user cliecks on the actual topic that the TextArea component will load the info from another xml file using the name of the topic as the name of the xml file to make it that much easier for anyone to maintain this program.
    So far the code i have is this.
    myTreeListener.change = function(eventObject)
        var theSelectedNode = eventObject.target.selectedNode;
        var theSelectedNodeLabel = theSelectedNode.attributes.label;
        topicTextArea.text +=
    I am a little fuzzy when it comes to loading the xml file in.  Should i be loading html instead of xml is my other question as well?
    Thanks in advance for your help
    FG

    Check out the Oracle XDB Developer's Guide, Chapter 3. There is an example of using BFileName function to load the xml files from a directory object created using create or replace directory. It works really well.
    Ben

  • Tree component display problem when text too long???

    hi all
    whenever i use a tree component to display some sort of text, i run into problems when the width of the text being display for a node is larger than the width of the tree component.
    Given: Tree tree1 with Node node1 and Child Node child1
    When the text of either node1 or child1 is longer than the width of tree1, the text is displayed on its own single line UNDERNEATH the node images. this makes the text look like it does not belong to the group of children of a given node.
    is there anyway to add maybe a text area or some sort of scrolling region to allow for any length of text for any node??
    thanks everyone!

    Yes, you can change the size of the tree node text field. Please see the "Tree Node Component Properties Window" section in the Help Contents within the IDE. Look at the info under the "Appearance" section.

  • How to build a form with a tree component

    Hi, i'd like to know if it's posssible to build a form with
    the Flash 8 Tree component.
    My menu looks like a tree but the childnodes of this tree are
    some form criteria that you can aditionate and post to a serveur.
    I try to use the accordeon menu, and it works but my menu
    must have dynamic heigth, and open all the boxes like the tree
    component...
    I'm in a hole... please healp me...
    Thinks

    Sans,
    I am no Apex expert, but with a situation as "complex" as yours, have you thought about creating a VIEW that joins these 7/8 tables, placing an INSTEAD OF trigger on that view to do all the business logic in the database, and base your application on the view?
    This is the "thick-database" approach that has been gaining momentum of late. The idea is to put your business logic in the database wherever possible, and let the application (Form, Apex, J2EE, whatever) concentrate on UI issues,

  • Incremental Loading of a Tree Component

    I'm working on an explorer-type interface in Flex 2 for
    browsing a remote file repository. It's a standard split-pane
    affair with a directory tree on the left and a listing on the
    right.
    Because the entire directory tree can be rather large, I need
    to load it incrementally as the user expands nodes rather than all
    at once. I failed to find a relevant example so I wrote my own. It
    works, but I'm new to Flex and am not sure if there's an easier way
    or if there are any pitfalls to the way I did it.
    I posted my code here:
    http://xocoatl.blogspot.com/2007/01/incremental-loading-of-tree-in-flex-2.html
    Any comments here or on the blog are appreciated; I'm
    guessing that having a good example of the "right" way to do this
    will be useful to many others.
    Thanks.

    i am also using another workaround using CSS trick(inlineStyle). if #{node.children} is null, i am placing an empty 10x10 white png image file over expand icon on tree node.
    following code is nodeStamp of tree component.
    <f:facet name="nodeStamp">
      <af:group id="g1">
        <af:image source="/images/spacer.png" id="i1" inlineStyle="border: 2px solid white; position: absolute; margin-left:-14px;" rendered="#{node.children == null}"/>
        <af:commandLink text="#{node.name}" id="cl1" partialSubmit="true"/>
      </af:group>
    </f:facet>

Maybe you are looking for

  • Permission denied error while CBS is building DCs

    Hi, from time to time we get an permission denied error when activating changes. The CBS server tries to check out files into the temporary build folders at the server and cannot do that for one file (see following error message). As already said thi

  • Xine and divx filename extension

    I am trying without much luck to get my mediaPC to play divx files. The problem is they never show up in the videos list in oxine. Playing the files with xine from xfce on the same PC is working fine. If I rename the files to have an extension of avi

  • Siteminder and KM Access

    Hello, We use Siteminder for authentication to our Portal.  When a user is sent a link to a document in KM they are prompted by Siteminder and then they are prompted again by KM.  Does anyone know how to remove the second prompt? If the user logs int

  • File Size & Export Problems

    Hi, my name's Jorge and I have a couple of questions. First, is I make machinima movies and my latest movie is 21:48 long. In order for it to be uploaded to a certain website, it needs to be under 200 MB's. I'd like the visual quality to at least be

  • How an Event (0BUSEVENT) works

    Hi, I would like to know what an event is and how it works. In Production Planning Standard Flow i could see a routine for 0MATERIAL Field in which 0BUSEVENT is used. 0BUSEVENT has values like PA,PB,PC,PD etc.. i would like to know what these values