Hi,

There are a few ways that you can keep your different list controls in
sync; concerning the selectedItem or selectedIndex.  Probably the
easiest way is to create a variable for the selectedIndex, updated on
the change event of the three controls, and bound to the selectedIndex
property of the three controls:

[Bindable]
private var mySelectedIndex : int = -1;

<mx:TileList id="myTileList"
     selectedIndex="{ mySelectedIndex }"
     change="mySelectedIndex=myTileList.selectedIndex"/>



<mx:DataGrid id="myDataGrid"
     selectedIndex="{ mySelectedIndex }"
     change="mySelectedIndex=myDataGrid.selectedIndex"/>



<mx:HorizontalList id="myHorizontalListControl"
     selectedIndex="{ mySelectedIndex }"
     change="mySelectedIndex=myHorizontalListControl.selectedIndex"/>

It's better to use a function and event.currentTarget.selectedIndex, to
set the mySelectedIndex; but you get the idea.

-TH

--- In [email protected], "pioplacz" <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have a question regarding viewstate. I have three different view
states, in those three states
> i have TileList in the first, DataGrid in the second and
HorizontalList in the third. All those
> use the same arrayCollection. What I'm trying to achieve is: when user
selects an item in the
> first view and then switches to second view then item should get
selected in the new view. Is
> it possible? of course it's possible, but what's the easiest way?
>


Reply via email to