|
Shlomi,
One possibility is that you are setting the index of the combobox before
the databinding fires. Thus:
1. It attempts to set the index to 2.
2. It sees the dataprovider has length 0.
3. It silently fails at runtime.
some time goes by
4. The dataprovider is populated by
databinding.
You might want to try this:
private function getMySelectedIndex(intervals:Object):Number
{
return(2);
}
<mx:ComboBox id="intervalCMB" dataProvider="{intervals}" selectedIndex="{getMySelectedIndex(intervals)}"/>
When 'intervals' changes it fires off a call to the local function
getMySelectedIndex via databinding.
HTH,
Allen
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Sreejith Unnikrishnan Sent: 17 May 2005 14:34 To: [email protected] Subject: Re: [flexcoders] combobox selectedIndex There's nothing wrong with the code that you have posted below. Only reason why I think this would not work is if you have only 2 items in the ComboBox! If not, try this as well <mx:ComboBox id="intervalCMB" dataProvider="{intervals}" initialize="intervalCMB.selectedIndex="2" /> Sree Shlomi Cohen wrote:
Yahoo! Groups Links
|
Title: Mercury Email Signature
- RE: [flexcoders] combobox selectedIndex Allen Manning
- [flexcoders] Re: combobox selectedIndex alex_harui

