• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Specific Tree nodes not getting selected (while the tree is a part of mxml Module)

Community Beginner ,
May 06, 2013 May 06, 2013

Copy link to clipboard

Copied

I'm using mx:Tree component to load a static xml data to bring it in the tree form. I'm having a HDivided box where my left side portion will have the tree and the right side major portion will be a border container with Flex IFrame component in it.

On creationComplete event, I'm assigning the dataprovider of the Tree component with the static xml data. The tree is loaded with the xml data. If I select any particular leaf node in the tree, the right side portion(i.e IFrame inside a Border Container) should be loaded with the html content corresponding to the selected node data. No issues in that.

The problem I have is after I load the flex module,

Step 1 :

Without selecting any of the top nodes, I'm selecting (clicking) the node E1 under E. The corresponding HTML content is loaded smoothly.

Step 2:

Then, If I select the D2 node under D branch, the selection of D2 is not happening and it is retaining with E1 itself. Obviously, the itemClick handler will have the selected item as E1 and the same E1 content is loaded again.

The selection is not changing to D2.

Rather, If I select any other node than D2, like D1, C1, C2 etc, the selection of the node changes and the corresponding node's HTML content is loaded properly.

Why the selection does not change ? Does the last node in the tree is having any issue ?

This is the actual code I used in my application. To identify the issue, I have removed all other components excluding the Tree component.

TestModule.mxml


<?xml version="1.0" encoding="utf-8"?>

<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009"

           xmlns:s="library://ns.adobe.com/flex/spark"

           xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute" width="100%" height="100%">

    <fx:Declarations>

        <fx:XML id="data" source="/xml/Test.xml"/>

    </fx:Declarations>

    <fx:Script>

        <![CDATA[

            import mx.collections.XMLListCollection;

            import mx.events.FlexEvent;

            [Bindable]

            private var treeData:XMLListCollection;

        ]]>

    </fx:Script>

        <mx:Tree id="trendsTree"

                 width="50%" height="50%"

                 labelField="@label"

                 dataProvider="{data}"

                 horizontalCenter="0" verticalCenter="0"

                 showRoot="false"/>

</mx:Module>

Test.xml


<root>

    <A label="A">

        <menu label="A1" />

        <menu label="A2" />

        <menu label="A3" />

        <menu label="A4" />

    </A>

    <B label="B">

        <menu label="B1" />

        <menu label="B2" />

        <menu label="B3" />

    </B>

    <C label="C">

        <menu label="C1" />

        <menu label="C2" />

        <menu label="C3" />

    </C>

    <D label="D">

        <menu label="D1" />

        <menu label="D2" />

    </D>

    <E label="E">

        <menu label="E1" />

    </E>

</root>

TOPICS
Flex SDK

Views

2.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 09, 2013 May 09, 2013

Copy link to clipboard

Copied

LATEST

Is this forum actively being used by experts / developers / public ???

Anyone Kindly Please let me know via the same post.

I have posted 4-5 questions... out of that 5, I got answer for only one question.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines