Tree component event action

Hello
There's a page which contains the following 3 components: Input textfield, Button, Tree
I made the following settings of them:
I set the "event action" at the tree node, and so did I at the button properties.
When I click on the button, the action runs and set the value of the Input textfield:
�this.i_textField1.setValue("something");� - the Input textfield display it as it should.
When I click on the tree node and the event action runs (it can be tracked in debug mode) which runs �this.i_textField1.setValue('something');�, but the textfield doesn't display it.
Any suggestions?
Thanks

The root problem is that the tree node component always behaves as though it had an immediate property set to "true". You'll get the same behavior from button or hyperlink or any other action component is you set immediate="true". The text field submitted values are not cleared, and so the text field redisplays them instead of the value that is set in code or obtained by evaluating the binding on the session bean.
There is a work-around. There is a page bean method, erase(), which will clear all submitted values. Call this before you set the new values, e.g.:
    public String treeNode1_action() {
        this.erase();
     textField2.setValue("Tree Node");
        staticText2.setValue("Tree Node");
     getSessionBean1().setTemp("Tree Node");
        return null;
[/code
// Gregory                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Tree component events

    Given there is no tree component in Flash CS3, I used the following tutorial http://developer.yahoo.com/flash/astra-flash/tree/ and managed to populate the tree from an xml file.  However I am now finding it difficult to perform certain actions such as:
    - adding/deleting items from the tree
    - save tree back to xml format
    - copy child nodes from one tree to another
    Can someone help me please, as I've been going round in circles this whole day without success

    try making changes to the underlying data itself (ie the xml) rather than the tree
    look at the inherited public methods here: http://developer.yahoo.com/flash/astra-flash/classreference/com/yahoo/astra/fl/controls/Tr ee.html#methodSummary

  • Transparency in Tree component and actions in its sheets

    Hello people
    I'm doing a kind of catalog, and I'm using a component "tree" for listing.
    But here's the problem: I need to use the background I have in the scene, and the component has a white background I need to remove. The workaround I've found is to give 0 _alpha property to the instance of the tree I have in the scene, but it also hides its  icons, and I need those visible.
    The other thing is that I need that when you run over a leaf, multimedia displays a small view of an image, and when you click-go to a specific frame where I have the large image with description.
    If anyone knows how can help me I would be greatly appreciated.
    I searched the online help that Adobe is now, and I found these properties of the tree but there is no way to work (at least I need):
    themeColor
    backgroundColor
    backgroundDisabledColor
    depthColors
    borderStyle
    color
    disabledColor
    embedFonts
    Thanks in advance.
    P.S: Sorry my bad english

    Use xml. Resistance is futile.
    Tracy

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

  • Tree Component as swf

    I have a swf file that is a Tree Component... (So when it
    diplays it looks like a Directory structure with folders and files)
    Some nodes access url links... And some access .doc files on
    the network... This works fine when I run it from my local site,
    but when I run it on the remote site (Intranet server) the nodes
    that reference file paths so nothing, instead of opening the file,
    the url type links do work fine on the remote site.
    Any thoughts on why this might be occurring ? I am putting
    the swf and the associated xml file and html page on the remote
    site... Am I missing a file or setting on the server that I have
    locally? I am also including my .as file and xml file for review.
    Any help would be greatly appeciated.
    xml code:
    <node>
    <node label="Training Information" data="">
    <node label="HP Learning Center" url="
    http://h30187.www3.hp.com"
    />
    <node label="HP Class Schedule" url="
    http://h30187.www3.hp.com/all_courses.jsp"/>
    <node label="Excel Charting Tips" data="IT Web
    Docs/Advanced Tips and Tricks for Excel Charting.wmv" />
    <node label="Email Contacts" data="file:///P|/IT
    information/Tips/Contacts - Keeping track.doc" />
    <node label="Assigning Tasks in Outlook" data="IT Web
    Docs/Assigning and tracking tasks in Outlook.doc" />
    </node>
    <node label="Technical Documentation" data="">
    <node label="myMCC Info Guide" data="IT Web
    Docs/MyMccIntro.pdf" />
    <node label="MCC Webex Guide" data="IT Web
    Docs/MCCWebex.pdf" />
    <node label="Scudder Access Guide " data="IT Web
    Docs/AccessDWS-Scudder.pdf" />
    <node label="VPN Install Guide" data="IT Web
    Docs/MCCCitrixAccessGatewayVPN-Install.pdf" />
    <node label="VPN User Guide" data="IT Web
    Docs/MCCCitrixAccessGatewayVPN-Use.pdf" />
    <node label="Samsung i830 Guide" data="IT Web
    Docs/Samsung_i830_User_Guide.pdf" />
    <node label="Treo 700w Guide" data="IT Web
    Docs/treo_700w_user_manual.pdf" />
    </node>
    </node>
    Action Script code:
    import mx.controls.Tree;
    class TreeNavMenu extends MovieClip {
    var menuXML:XML;
    var menuTree:Tree;
    function TreeNavMenu() {
    // Set up the appearance of the tree and event handlers.
    menuTree.setStyle("fontFamily", "_sans");
    //menuTree.setStyle("fontSize", 6);
    menuTree.fontSize = 14;
    menuTree.setSize(250, 300);
    menuTree.move(0,0);
    // Load the menu XML.
    var treeNavMenu = this;
    menuXML = new XML();
    menuXML.ignoreWhite = true;
    menuXML.load("TreeNavMenu.xml");
    menuXML.onLoad = function() {
    treeNavMenu.onMenuLoaded();
    function change(event:Object) {
    if (menuTree == event.target) {
    var node = menuTree.selectedItem;
    // If this is a branch, expand/collapse it.
    if (menuTree.getIsBranch(node)) {
    menuTree.setIsOpen(node, !menuTree.getIsOpen(node), true);
    // If this is a hyperlink, jump to it.
    var url = node.attributes.url;
    var file = node.attributes.data;
    if (url) {
    getURL(url, "_blank");
    else {
    getURL(file, "_blank");
    // Clear any selection.
    menuTree.selectedNode = null;
    function onMenuLoaded() {
    menuTree.dataProvider = menuXML.firstChild;
    menuTree.addEventListener("change", this);
    This does work fine locally... But the file paths node do not
    work when I publish to the Intranet server.
    Thanks-Dave

    It is quite a pain in the rear to skin the AS2 components.
    And I don't know of many 3rd party components for AS2. I know of
    plenty AS3 3rd party components, but if you were using AS3
    components you wouldn't need a Tree to replicate the adobe video
    workshop type navigation, all you would need is the built in List
    component. If you can go sans icons, I would suggest using the AS2
    List to get the feel you're looking for.

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

  • ADF Tree Component Iterating through all nodes upon ONE node click...

    Hi to all !. My name is Agustin and I live far away... In Cordoba Argentina to be specific !. My doubt would be the following one: I wanted the other day to build a af:tree component and put in the NodeStamp an commandLink with a setActionListener... So as to get the selected Node... In this case, I have category of books... Let say DataBase, Cloud Computing, Web Development and so on... But the misterious thing happens when I click on one node, and the action method in my backing bean is executed one time per each node the Tree has... I notices this coz I made a System.out.println()... My idea would be to detect the user click event so as to update a Table... My code is as follows !...
    <af:tree value="#{backManager.listaCategoria}" var="cat"
    binding="#{backManager.tree1}" id="tree1">
    <f:facet name="nodeStamp">
    <h:commandLink binding="#{backManager.outputText1}" action="#{backManager.outputText1_action}" >
    <af:setActionListener from="#{cat}" to="#{backManager.selectedItem}" />
    <h:outputText value="#{cat.label}"
    binding="#{backManager.outputText2}"
    id="outputText2"/>
    </h:commandLink>
    </f:facet>
    </af:tree>
    and my backing bean is:
    public String ejecutarSeleccion()
    Categoria cat = (Categoria) this.selectedItem.getValue();
    System.out.println("Nombre: " + cat.getNombre());
    return null;
    This method is the action attribute from the command link !.
    the selectedItem is an attribute of the type SelectItem !.
    Where I would be making the mistake ?... Or should I implement the thing in a different way ?... Thankx ! :D

    Hi,
    its strange when you say it executes the action per each node in the tree. One thing tough I would change is to go from h:commandLink to af:commandLink as it allows you to set partialSubmit=true in which case a click on the tree doesn't refresh the whole tree. I then would add an f:attribute tag to the command link
    <f:attribute name="cat" value="#{cat.id}"/>
    On the command link I had the actionListener property pointing to a managed bean with a method like
    public void onTreeNodeAction(ActioneEvent actionEvent){
    RichCommandLink link = (RichCommandLink ) actionEvent.getUIComponent();
    Object catId = link.getAttributes().get("cat");
    // ... cast the catalog id to its type and you are ready to go
    Another option would be to use the SelectListener of the tree and don't use a command link at all. You respond to tree node selection similar to here
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/83-bidi-synchronization-tree-form-401841.pdf
    Frank

  • Garbage Collection Issue for Tree Component

    Dear:
    When I created a new Tree instance dynamically by following code, and clicked any tree node randomly and then I removed it via another button, but I found this instance couldn’t be removed by GC, if I just created this tree without mouse action, it can be removed by GC.
    Tree Component:
    -- TreeView
    <mx:canvas>
    <mx:Tree dataProvider="{data}"  />   // data is a XML staments
    </mx:canvas>
    Create Tree:
               public function createView(event:Event):void{
                  var view:TreeView = new TreeView ();
                  view.name="myTree";
                  addChild(view);
                  view=null;
    Remove Tree:
               public function deleteView(event:Event):void{
                  var view:TreeView= TreeView( _con.getChildByName("myTree"));
                  removeChild(view);
    Could someone give me some suggestion?
    Thanks a lot

    Hi ajmcfarlane,
    This is my first post here. I'm fairly new to AS3 still and
    have been getting my education from a number of places. The best
    education i have found is from the book located at
    http://www.learningactionscript3.com/
    Rich Shupe address this problem of removing the child from
    memory. I Downloaded your file and found 2 problems and resolved
    one of them. By now you might have already solved this anyway.
    To remove the child from the Display List use -->
    removeChild(myChildObject);
    To remove the object from memory use --> myChildObject =
    null;
    You did these two steps but in the incorrect order, just by
    moving the 'myChildObject = null' under the removeChild code makes
    it work.
    I found running a few trace statements after fixing the first
    problem, i found the second problem. The error of trying to remove
    a child when it is no longer there.
    You just need to rework the design so that the order of
    events fires as you want. Below is the traces i used and the output
    that is received.
    function Click1(e:MouseEvent){
    trace("four ", loadedcontent);
    modLoader.unload();
    modLoader = null;
    function unloadCompleteHandler(event:Event):void{
    trace("one ", loadedcontent);
    removeChild(loadedcontent);
    trace("two ", loadedcontent);
    loadedcontent = null;
    trace("three ", loadedcontent);
    output
    Loaded mem: 20668 KB
    four [object MainTimeline]
    one [object MainTimeline]
    two [object MainTimeline]
    three null
    unLoaded mem: 23352 KB
    So you can see the click event is firing of the unload first,
    when i think you want that last.
    I hope this has been of some help :)

  • ADF UIX Tree Component

    Hi
    I have created ADF UIX Tree Component on my screen and i want to have button expand all / collapse all for my tree .
    Can i create event for expand all / collapse all ADF UIX Tree ?
    If i can ,could you please advise how i should to do ?
    Thanks

    Hi Daniel,
    Are there any one can tell me when the new ADF UIX
    demo based on uix 2.2 be released?I'm not sure when any sample applications will be released, but there is an ADF UIX tutorial available here:
    http://otn.oracle.com/products/jdev/collateral/tutorials/9050/adfuix_tut.html
    I want to know if we can get databind uix tree
    component (or other ui components) from ADF data
    action control which return dataobject and something
    else.I'm not sure about the tree component - I'll try to find out whether that is/will be supported. Once your data controls are available in the Data Control Palette, you can bind them to components in your UIX page by:
    1. Selecting the data control that you want to bind.
    2. Selecting a component type from the "Drop As" choice.
    3. Dragging the data control onto the UIX page.
    This process is illustrated in the tutorial above.
    Andy

  • 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

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

  • How to get the table Event action in the controller???

    HI
    Based on my requirement i have extended my controller,but i want to perform some validation like ,,,,
    i have table in one region ,in which one column is having a Button (flex field) action with image,
    i want to write the code in the controller according to the validation ,,,,but i am unable to find the event action in the main controller,
    how to get the event action ?,,,,, of the item type as image
    thanks in advance
    Kash

    If not you can use image component with clientListener and serverListener to preform your requirement set clientListener click event and then inside clientListener java script method call the
    serverListener then will execute serverListener method.

  • On click at tree component it has to call SWF using XML

    Hi,
    I have created a flash file with name xmltoflash_tree.
    Incules a Tree component named "tree01". On my first frame of
    actions i have included "#include "test.as"". This is about my
    flash file
    In my Test.as :
    import mx.controls.Tree;
    var xmlLoader:XML = new XML();
    xmlLoader.ignoreWhite = true;
    xmlLoader.load("list.xml");
    xmlLoader.onLoad = function(success:Boolean):Void {
    tree01.dataProvider = this;
    tree01.initBranches();
    tree01.vScrollPolicy = "auto";
    Tree.prototype.initBranches = function(node:XMLNode):Void {
    if (node == undefined) {
    for (var i = 0; i < this.dataProvider.childNodes.length;
    i++) {
    this.initBranches(this.dataProvider.childNodes
    } else {
    if ( (node.attributes.isBranch == "true") &&
    !(this.getIsBranch(node)) ) {
    this.setIsBranch(node, true);
    if ( (node.attributes.isOpen == "true") &&
    !(this.getIsOpen(node)) ) {
    this.setIsOpen(node, true);
    for (var i = 0; i < node.childNodes.length; i++) {
    this.initBranches(node.childNodes);
    I created an XML file named as "list.xml" :
    Script inside this xml is :
    <?xml version="1.0" encoding="iso-8859-1"?>
    <node label="Select Application" isOpen="true">
    <node label="Application1" isBranch="true">
    <node label="Introduction to Application1"
    isBranch="true" >
    <node label="Testing1" />
    <node label="Testing2" />
    <node label="Testing3" />
    </node>
    </node>
    <node label="Application2" isBranch="true">
    <node label="Introduction to Application2"
    isBranch="true" >
    <node label="Testing1" />
    <node label="Testing2" />
    <node label="Testing3" />
    </node>
    </node>
    I have folder with name Treehelp. All my files are in this
    folder.
    xmltoflash_tree.fla
    test.as
    list.xml
    linktesting.swf
    I have SWF in the same folder named "linktesting.swf".
    I need to call "linktesting.swf" or any other swf files
    included in the same folder. when i click on "Testing1/ or any
    othe".
    Have to write the script in XML to call the swf file. Help me
    in this.
    Regards
    Ranjith Kumar. Bandi

    Add oneMore attribute in the XML Nodes,
    When selecting a Node in a Tree component you will recieve
    all the data of that particular xml node. using that you can load
    the Files
    <node label="Testing1" filePath="MyFirstSWF.swf"/>

  • Tree Component ... getting crazy !

    So tree component is terrible , every thing is gone , trying
    all day to get directly to tree component and no result ,and there
    is no basic explanation and no examples , i tried to search in Flex
    Help Content , but I get more Cold Fusion tree help than Flex tree
    .. spend 800 dollar for flex and get CFHelp , I don’t think
    is good idea , so pleas help me , how can i add simple tree node
    with out XML , I hate XML , and i know some how we can work with
    Tree component directly though ITreeDataDescriptor , but how ..?
    In As2 it was simple and easy, now how to do this I
    don’t know and I am not only one!
    I am not a specialist in Action Script but in AS2 I never had
    a problem, and if I did, we have a lot of documentation about AS2
    and examples, but Flex trying to sell a product that not supports
    any examples and documentation... Write in search content
    ‘tree’ and you get cf tree examples and structures, but
    I don’t need cftree information, I need flex tree exemplas,
    but there is few... Working with flex all week I get more tired and
    depressed.. Any thing I trying to do is going wrong, AS2 is not
    there any more and I understand that I have to learn AS3 from
    beginning to understand it... I hate it!!!!!!
    Flex - Rich Application for users and Rich work for
    Developers!

    Eddy, chill out man.
    How can you say, "I hate XML," and really even try to learn
    Flex? Flex is based on XML, MXML is XML, any services you call
    (HTTP or WEB) are XML. I think it's time for change and time you
    picked up XML. It's actually very, very simple.
    You don't have to learn AS3 from the ground up. There are a
    lot of similarities between AS2 and AS3.
    You just need to write a simple function which goes through
    the array and converts it to xml. While I could program that for
    you, I think you could probably figure it out yourself.
    But why even bother? Using an XMLList is just as easy.
    Behold:
    <mx:XMLList id="treeData">
    <node label="Mail Box">
    <node label="Inbox">
    <node label="Marketing"/>
    <node label="Product Management"/>
    <node label="Personal"/>
    </node>
    <node label="Outbox">
    <node label="Professional"/>
    <node label="Personal"/>
    </node>
    <node label="Spam"/>
    <node label="Sent"/>
    </node>
    </mx:XMLList>
    XML is composed of parents and children. You can do much more
    with XML than you can with plain old arrays, plus, when's the last
    time you saw a 10-tiered multi-dimensional array? It's not possible
    to do something like that without XML.
    Over and out - Taka.

Maybe you are looking for

  • Open a Document in SharePoint website

    Hi, I got a big problem. I am working with an website witch has a sharePoint 2013. I can open the website and log me in, but I am not able to open any document with my office 2011. Can anyone help me?

  • WPS security

    This is a question generally regarding the WPS protocol security issue. I have  acquired a pair of TP-Link powerline plugs,( TL-WPA4220KIT) also capable of extending the WiFi signal. In order to clone my existing Wi-Fi network; run by a 3rd party rou

  • Customer Master changes

    Hello All, Are there any standard reports available for tracking the changes to the Master data (Customer, Vendor)? Thanks, Ramesh

  • I'm trying to find a reasonable amount for a computer to play Sims however.......

    on the Sims 3 website, it only let's you play the game with a good video card/graphic card. I have been trying for months to find good graphic cards and laptops and computers when I remembered that Apple might have a computer that is just right for m

  • Midi connect to macbook air

    I bought a keyboard that has a midi connection. Is there a cord I can use to connect the piano to the macbook air to use with garageband?