0

I have 2 TileList component in my Flex application.

1 tilelist is filled with data much like following xml sample:

<person name="Test">
<likes>Flex</likes>
<likes>PHP</likes>
</person>
<person name="test2">
<likes>HTML</likes>
<likes>CSS</likes>
</person>

the data shown in that tilelist is the name.

my second tilelist:

<items>
<preference>Flex</preference>
<preference>Flash</preference>
<preference>HTML</preference>
<preference>CSS</preference>
<preference>PHP</preference>
<preference>CMS</preference>
<preference>ASP</preference>
<preference>C</preference>
</items>

data shown is the preference.

The user can click the first tilelist and then the items that person "likes" should be selected in the second tilelist (in other words they lit up).

click event on my first tilelist

private function highlightPreferences(e:ListEvent):void{
trace(e.currentTarget);
//and now I'm stuck
}

Is there any way to achieve this?

4

1 に答える 1

1

特定の人の selectedIndices を返す関数を作成するだけです。次に、2 番目の TileList の selectedIndices を次のようにバインドしますselectedIndices="{findLikes(firstList.selectedItem)}"。firstList.selectedItem が変更されると、バインディングが起動します。

あ、リピーターはご遠慮ください。リストは、リピーターができるすべてのことを行うことができます。

于 2009-09-03T20:45:29.970 に答える