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.

Similar Messages

  • Tree Component and as3

    Hello ..
    my problem is tree component and AS3 , before we hade such
    easy time with tree component in as2 but now i founded that we cant
    talk directly to tree component and we have to use API and XML ,
    well i never liked XML and before i worked with tree component
    directly and no problem but now , Flex force me to work with XML or
    API(well I don’t know what dose it mean ) and I was tiring to
    find any way to get directly to tree component in Flex2 and no
    result … so my question , do I have use XML ? Is there any
    another way to get to Tree Component ? I was looking in Flex help ,
    and I find the help content is really bad . pleas help , I get
    crazy about this problem …….
    BWY this form work terrible on my PC ….. anyone have
    same problem ?

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

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

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

  • A question about the Tree Component

    I have try to use the tree component i a flash page, and
    it´s going allright until I´ll want to link the content
    to a page... WHY??
    I have tried a lot of different codes here are those I tried:
    <tree>
    <folder label="Mine own">
    <link label="My page" url="
    http://www.mickesei.se" />
    </folder>
    </tree>
    Nr2:
    <tree>
    <folder label="Mine own">
    <link label="My page" link="
    http://www.mickesei.se" />
    </folder>
    </tree>
    nr3:
    <tree>
    <folder label="Mine own">
    <link label="My page" href="
    http://www.mickesei.se" />
    </folder>
    </tree>
    nr4:
    <tree>
    <folder label="Mine own">
    <link label="My page" get URL="
    http://www.mickesei.se" />
    </folder>
    </tree>
    But nothing seems to work, when I go mouse over it still a
    arrow should it?
    HELP ME PLEASE!!! Micke

    Thanx Jeanne,
    You brought me on a idea with the UIX Developer's Guide and EXPANDABLE_EXPANDED value.
    I couldn't figure out how the expand property was filled, because it wasn't done in the ADF BC ViewObject. We have a Utility class that creates a DataObject from the ViewObject Data and here the expand property was set.
    Now it was easy to build a ExpandAll option. It is possible to access the HttpServletRequest object were the DataObject is created. By setting a attribute in the request I could react on that and give the expand property indeed the value EXPANDABLE_EXPANDED.
    Dennis

  • Tree component not working in a mask

    I have been having problems displaying the labels on tree
    component , I have now found the cause it was in a mask.
    Once I moved it out of the mask it worked fine!!. But the
    thing is now how do I get it to work in a mask????
    You can test this for yourself by opening the
    gallery_tree.fla in \Flash 8\Samples and adding a layer making it a
    mask (and making a box around the whole thing).
    I need to use the tree in a mask as it is part of a bigger
    picture.
    Thanks for the help
    BP

    I'm not sure if that will help, but you can try to set the
    mak at runtime (MovieClip.setMask()) - I'm not even sure if that is
    "leagal" with components, but setting a (rectangular) mask wia
    actionscript is the only way to mask device text, and that should
    be part of your component.
    Watch out rot problems of depths-order though, as depth
    management with component (v2) is different from "normal" depth
    management.

  • 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

    Hi ye,
    The code on my Flash tree component has:
    var treeL:Object = new Object();
    treeL.change = function() {
    var item = theTree.selectedItem;
    var earl = item.attributes.url;
    if(earl) {
    getURL(earl ,target=myIframe);
    the xml file it reads from has eg.
    <tree>
    <folder label="Test">
    <link label="TSample" url="one.html" />
    </tree>
    The myIframe target above is on the same html page as the
    tree component, but instead of loading the file "one.html" into
    the target myIframe, it gets loaded as a separate one.html
    page.
    The question is, how do I target an Iframe named myIframe
    with its layout controlled by a content id, from a Flash tree
    component on same html page, and get my one.html file to load into
    it??
    The one.html file currently loads as a separate hml page.
    thanks
    Colm

    Although tree component is not currently part of the reference implementation, example under EA3 release, contains a simple Tree implementation(included under example/components)that you can use as a starting point.
    -Jayashri

  • Tree component - can I declaratively hide the disclosure icon

    I have just started working with the tree component. Within the data model that I am working with, I've got branches that may or may not contain children. The child nodes are lazily fetched (which is good, for performance), but this results in the tree not knowing if children exist until the disclosure icon (the arrow) is clicked. This means that when the branch contains no children, the user has to click the arrow, and the arrow just disappears without anything on the tree changing. Because of the nature of the legacy data model that I am working with, I actually have an attribute that indicates if children exist (and I could have created a formula based attribute if no such indicator existed in the data model). I would like to be able to check this attribute (via EL or some other method) and suppress the disclosure icon if no children exist, but I have not found a way of doing it. Is this possible?

    I was able to get this to work using the following disclosure listener:
      public void testDisclosureListener(RowDisclosureEvent rowDisclosureEvent) {
        Object rowKey = null;
        FacesCtrlHierNodeBinding rowData = null;
        RichTree tree = (RichTree)rowDisclosureEvent.getSource();
        RowKeySet rks = rowDisclosureEvent.getAddedSet();
        if (rks != null && rks.size() == 1) {
           rowKey = rks.iterator().next();
           tree.setRowKey(rowKey);
           rowData = (FacesCtrlHierNodeBinding)tree.getRowData();
           if ( rowData != null && rowData.getChildren() != null ) {
             // Iterate through the children of the expanded node and check if they have children
             for ( Object child : rowData.getChildren() ) {
               FacesCtrlHierNodeBinding childNode = (FacesCtrlHierNodeBinding)child;
               if ( childNode.getChildren() == null || childNode.getChildren().size() == 0 ) {
                 // Child node is a leaf.  Add it to the disclosed rows, to that the ADF tree will not display a disclosure icon
                 tree.getDisclosedRowKeys().add(childNode.getKeyPath());            
      }

  • Tree Component Background Color

    Hi,
    I am using the Tree Component, it has 3 nodes.
    - Is there a way I could change the background color when
      I open each node.
    - Is there a way to change the font of the text
      associated to each node.
    Any Help would be appreciated.
    NAC

    Hi SAP Partner,
    What I have understood from your question is :
    1) you want to display the selected node in a different color than the rest of the nodes
    2) You need to change the text style of the tree as a whole(but not dynamically)
    If this is your requirement, you can make use of themes either in WebDynpro itself or Portal themes if you are embedding your application into portal.
    For applying webdynpro themes this link may help you
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/colourful webdynpro applications.pdf
    But I feel it is much more easier to do it from portal side if you have some portal knowledge. I cannot offer you any document saying how to do it from portal. But you might get some help from EP forum.
    Hope this helps,
    Best Regards,
    Nibu.

  • Tree component index confusion

    Hello,
    I have a Tree component and need to access some nodes by its
    index. This is to make a "move up/down" control. My idea, after
    trying many, is to duplicate the selected (current) node up or
    down, then replace the content of the original with the previous
    node content.
    I wish not to use previousSibling or nextSibling since, as it
    seems, it doesn't recognizes either the origin and destination
    nodes are in the same hierarchical level.
    Working with some
    index function doesn't works as I would expect when in 2nd
    level nodes (that is, some child nodes of the first nodes) ; for
    example:
    -- node (index 1)
    -- node (index 2)
    -- child (index 3)
    -- child (index 4)
    -- node (index 5)
    if the selected node is the second child of the second node,
    index = 4, and then I substract this number to get the (supposedly)
    previous child,, that is, in index 3, then I get the node in index
    5.... my thought is that, when closed, the node in index 5 was
    actually index 3.
    Any clarification on how this could be happening is greatly
    appreciated. Thanks,
    Alvaro Medina

    I also need to get a exact position in the nodes for a
    selected item, such as in the following format
    getTreeNodeAt(0).getTreeNodeAt(5)
    in order to delete certain folders
    thisTree.getTreeNodeAt(0).getTreeNodeAt(5).removeTreeAt(2)
    How can I do this?? All i can get so far is node object by
    thisTree.selectedNode ...

  • Tree Component AS3 Error

    When I click a leaf in the Tree Component I have a function
    called using the itemClick Property. When I click a node (the
    folder icons) I get the AS3 error below. Does this only show up
    with Debug versions of Flash Player. Plus how do I stop this error
    from occurring if the user happens to have the debug version
    installed?
    Error #2044: Unhandled ioError:. text=Error #2032: Stream
    Error.
    at main/loadMyXML()
    at main/collectionSelect()
    at main/__gTree_itemClick()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()
    at mx.controls.listClasses::ListBase/mouseClickHandler()
    at mx.controls::Tree/mouseClickHandler()

    ORA-00600 internal errors should be reported to Oracle Support by SR. If you don't have a support contract try searching the web for more information and possible fixes or workarounds.
    From the information available on MOS, if the type of the PG.ID_PAR_PLANO_GER column is not VARCHAR2, then try converting P22_ID_PAR_PLANO_GER to the same type.

  • Tree component bug

    We use a tree component on client side with several tree nodes.
    We have a tree action for them.
    It usually works fine, but randomly getCookieSelectedTreeNode() method returns null (empty string). Sometimes no error after 10 clicks, but sometimes it returns null after a few click.
    If somebody have a solution for this, please let us know.

    I have a solution for my problem now. It turns out that my issue wasn't quite the same as the original problem cited by K_Gabor.
    Our issue was machine specific and was down to the fact that getCookieSelectedTreeNode() will return null if cookies are blocked by the browser. Not really surprising given the name of the method, but it is something that should be kept in mind when using this method.
    Given that cookies are frequently blocked, is there an alternative method for getting the selected node that doesn't rely on cookies?
    Cheers,
    Chris.

Maybe you are looking for

  • Services for Objects will not display attachments

    Hi Gurus, we are currently set up to display attached documents using IXOS Live Viewer, but only a select number of users have this viewer due to licensing, etc. The problem is, we have requirements for other users to display attachments in FI docume

  • Magic wand selection tool misbehaving

    Help..  I've been having this problem almost everytime I use Photoshop CS5 and previously with CS4. (never a problem with CS or CS2). When trying to make selections based on color or contrast with the "magic wand" tool, I find it develops totally err

  • The iPod touch 5g already avaible?

    Hello, I have an iPod touch. The question is whether the 5th generation is already available. Can you help me please?

  • One of the SAP client got an error message

    Dear all, I got an error message 'connect to license server failed 60070-15' Others are fine. I have the service manager up and running on the server. Any idea? Thanks. Regards, Yuka

  • Bug when searching array of refnum

    This one just bit me so I thought I should share.  It looks like the Search 1D Array function behaves unexpectedly when used with an array of VI refnums.  So far I have only reproduced it in LabVIEW 2009 SP1, but I ran some code in 8.6.1 that seemed