Open tree component in expanded state

I have built a small framework to display demos -- and use an
XML-driven tree component to provide access to demo segments and
published files.
I would like the TOC in the Tree component to open in
expanded state, but am having no luck with myTree.setIsOpen.
The tree connects to the XML OK -- I can expand/collapse,
etc... and it all looks great. But I cannlt get the tree to open
expanded.
The code I'm trying to open the TOC expanded:
this.demoTOC.setIsOpen(this.demoTOC.getTreeNodeAt(0), true);
OR
this.demoTOC.setIsOpen(this.demoTOC.getTreeNodeAt(0).getTreeNodeAt(0),
true);
The XML that's connected to the tree:
<?xml version="1.0" encoding="UTF-8"?>
<toc>
<demosection label="MY TITLE" >
<demo ID="00demo.flv" label="title01" isBranch="true"
/>
<demo ID="01demo.flv" label="title02" isBranch="true"
/>
<demo ID="02demo.flv" label="title03" isBranch="true"
/>
<demo ID="03demo.flv" label="title04" isBranch="true"
/>
</demosection>
</toc>
If anyone can point out what I'm doing wrong, I am ready to
learn.
Thx.

Never mind -- figured it out.
It was a scoping issue -- calling the setIsOpen form inside
the XML loader function.

Similar Messages

  • Open Tree control in expanded state

    I have built a small framework to display demos -- and use an
    XML-driven tree component to provide access to demo segments and
    published files.
    I would like the TOC in the Tree component to open in
    expanded state, but am having no luck with myTree.setIsOpen.
    The tree connects to the XML OK -- I can expand/collapse,
    etc... and it all looks great. But I cannlt get the tree to open
    expanded.
    The code I'm trying to open the TOC expanded:
    this.demoTOC.setIsOpen(this.demoTOC.getTreeNodeAt(0), true);
    The XML that's connected to the tree:
    <?xml version="1.0" encoding="UTF-8"?>
    <toc>
    <demosection label="MY TITLE" >
    <demo ID="00demo.flv" label="title01" isBranch="true"
    />
    <demo ID="01demo.flv" label="title02" isBranch="true"
    />
    <demo ID="02demo.flv" label="title03" isBranch="true"
    />
    <demo ID="03demo.flv" label="title04" isBranch="true"
    />
    </demosection>
    </toc>
    If anyone can point out what I'm doing wrong, I am ready to
    learn.
    Thx.

    Never mind -- figured it out.
    It was a scoping issue -- calling the setIsOpen form inside
    the XML loader function.

  • Save last selected and state for Tree Component?

    I have a Tree component that refreshes its data everytime I
    open the Tab containing it (doing a SQL call to return an index of
    models). The problem is that everytime the dataProvider changes (a
    new one overwrites the old one) with databinding, even if the data
    is exactly the same, it loses its old state and selected node. Is
    there any way to save this state/selected node when the
    dataProvider updates?

    good article on all aspects of trees including your issue.
    http://www.adobe.com/devnet/flex/quickstart/working_with_tree/

  • [UIX] Tree - expanded state problem

    Hi,
    I'm experiencing problemswith my UIX Tree.
    In my tree I expanded some nodes (so I can view its contents :))
    Normally when I browse to some other pages and come back to the page containing the tree, it remembered the state in which I left it (same nodes still expanded). When I decide to insert new data (through a form page)to the database of which the tree 'feeds' itself, I get errors when browsing back to the page containing the tree, because it remembers its last state (which is nolonger valid, because of new records).
    What I want is that I can go back to the page containing my tree, with the tree refreshed (containing my newly inserted data) and still leave those nodes expanded that expanded earlier.
    Is this possible? (And is my problem clear? ;) )
    Gr.
    Philip

    I'm afraid our proxy does not support mutable trees. The only way to have it work at all is to create a new proxy when you mutate the tree data, which means you will not be able to save the expanded/collapsed state.
    This won't help you now, but ADF UIX is being migrated to ADF Faces which is based on JSF. In that realease mutable trees will be supported. There are early access releases of ADF Faces available here if you're interested:
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/index.html

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

  • Migration problem with Tree component (10.1.3.3 - 11.1.1.0)

    Hello,
    I'm trying to migrate an application from Jdev10.3.3 to Jdev11. In this application I wanted to handle the Tree State (tree navigation to a defined node) and persist it if needed (keep the tree to a certain state). To do this, I developed logic using:
    1) TreeModel class to handle the information of the tree (oracle.adf.view.faces.model)
    2) CoreTree class to handle the view part of the tree (oracle.adf.view.faces.component.core.data)
    3) PathSet class to build the navigation to the node I need (oracle.adf.view.faces.model)
    In the migration to Jdev11 I converted to this components:
    1) org.apache.myfaces.trinidad.model.TreeModel
    2) org.apache.myfaces.trinidad.component.core.data.CoreTree
    3) ?
    I don't know how to migrate the PathSet logic. In the Trinidad docs I didn't see a PathSet class neither a method like CoreTree.getTreeState(), so I suppose that this part of the Api has changed.
    Thanks for your attention.
    Antonio.

    I found an hint in the new WebDeveloper guide, section "10.5.4 What You May Need to Know About Programmatically Expanding and Collapsing
    Nodes".
    Apparently the class I need in the new version of the Tree is "oracle.adf.view.rich.model.RowKeySet".
    Probably, for migrating my application, I will have to rewrite my logic for handling the tree:(.
    Antonio

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

  • [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/

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

  • Tree component bug (?) and some questions

    Hi! I have some problems and questions about tree component.
    Problems:
    1. I have an expanded tree with ~300 items. Each item label
    displayed in 2-3 strings. After QUICK tree scrolling using mouse
    wheel (I make 3-5 scrolls) for most of items displayed only last
    string and one empty string :(
    Bug of tree renderer? Is it fixable?
    Questions:
    1. Can I have font color X for tree item 1 and font color Y
    for tree item 2?
    2. I have a tree with ~300 items. Expand/Collapse tree
    operations takes 5 to 10 seconds on Core2Duo. Is it possible to
    speed up this operations?
    Code:

    Hello.
    About problem 1.
    I faced this problem several times, cann't understand the
    problem. May be it's a bug.
    Questions.
    1. Of course you can. Write itemRenderer for this.
    2. Tree has effects for expanding and collapse events, you
    can reduce times for them.

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

Maybe you are looking for