Are you running the initialize combobox code in a result event handler?

Tracy

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Ghislain Simard
Sent: Thursday, July 13, 2006 11:38 AM
To: [email protected]
Subject: [flexcoders] Flex 1.5 : initializing a ComboBox Heeelp!!

 

Hi,
This is a very strange behavior and I don't know if someone can help
me to resolve this.

On the first load of the application, I select an item in a mx:Tree
which is triggering a function which is populating a combobox from a
RemoteObject call. The result of the call give me back the selected
value to display.

Now here is the catch: the value is coming back from the server but
the combobox is not showing the selected value until a click again
the Tree item...than it works fine! Worst than that, I have it
working perfectly on my Windows 2000 Server but failed on Windows
2003 Server.

Here is the code that is chosing the right selection in the combobox:

var aDP:Array = mx.utils.ArrayUtil.toArray(myCombobox.dataProvider);
var sDataValueInit:String = iniVal.myValue;
var sDataValueCur:String;
for ( var i:Number=0; i<aDP.length; i++ ) { //loop
over the items in the dataProvider
sDataValueCur = aDP[i].data; //get the
current item.data value
if ( sDataValueCur == sDataValueInit )
{ //compare desired value to current item.data value
myCombo.selectedIndex = i; //set the
seletedIndex of the combo box
}
}

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to