Connecting a Tree to a ViewStack


so have tree, each node in tree represents view, , these views can arranged hierarchically.

- view 1
- view 2
- view 3
- view 4

i have viewstack includes corresponding display items each view.

<viewstack id="viewcontentstack">
<panel id="v1" />
<panel id="v2" />
<panel id="v3" />
<panel id="v4" />
</viewstack>

to connect two, created xml list collection defined tree items, , contained references panels in viewcontentstack so...

<mx:xmllistcollection id="viewtreedata">
<mx:xmllist xmlns="">
<viewname label="view 1" viewstack="v1">
<viewname label="view 2" viewstack="v2" />
<viewname label="view 3" viewstack="v3" />
</viewname>
<viewname label="view 4" viewstack="v4" />
</mx:xmllist>
</mx:xmllistcollection>

my problem this. tried link 2 using change event on tree so:

change="viewcontentstack.selectedchild=this[viewtreedata.getitemat(viewtree.selectedindex ).@viewstack]"/>

but problem takes consideration index of selected tree item, changes based on whether tree expanded or not. (if tree collapsed, view 4 index 2, if tree open, it's index 4.) there better way extract viewstack data xml selected view, won't change based on state of tree?

can explain how link display of viewstacks tree without keying off index of selection in tree? or missing simple here?


More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support