Flex 3 - Issue with selecting an item in the list as default


how select item in list default

default selected item of index 0

i tried stuff --

listid.selectedindex = somevalueinmyprogram - 1; // 0

but when debug get
_selectedindex = 0 selectedindex = -1

and default value not selected why so? [i have checked obvious somevaluefrommyprogram not equal 0]

help!

try this

 

<mx:script>           <![cdata[                import mx.collections.arraycollection;                [bindable]                public var expenses:arraycollection = new arraycollection([                     {month:"jan", profit:2000, expenses:120, amount:45},                     {month:"feb", profit:1000, expenses:200, amount:60},                     {month:"mar", profit:1500, expenses:500, amount:30}                     ]);            ]]>      </mx:script>       <mx:list dataprovider="{expenses}" labelfield="month" id="mylist" creationcomplete="mylist.selectedindex=2;" /> 

probably moment when try set selectedindex isn't right one.



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Installation database is corrupt

Error compiling for board Arduino/Genuino Uno.

Nogen der kender et simpelt hvidt template med topmenu kun - Joomla! Forum - community, help and support