|
If myModel.cardType is undefined it sure seems like it's not getting set J Put a change handler on your ComboBox and see if that is getting executed when you reach that page. Also maybe put some button on there next the combobox that will change the selectedIndex so you can test this after the page has loaded too and see if that makes any difference. All that fails try to post a working sample so we can see what's up.
Matt
-----Original Message-----
Ok, I have a little dilemma
Say you have a ComboBox which has a list of credit card type, which is populate via a remote call: myCombo.dataProvider = myCCList; No problem, that works and it is populated. Each element in the list is an object with two fields, "id" and "name". Except the first element is empty, id=0 and name="".
And this combo is tied to a validation, like so:
<mx:Model id="myModel'> <cardType>{myCombo.selectedItem.id}</cardType> </mx:Model>
<mx:NumberValidation field="myModel.cardType" notANumber="Please select an item in the list."/>
Say, I want to set the selected item of the combo once the user comes to that screen: myCombo.selectedIndex = 4; All good up to now.
Except, the red validation indication will be set around the ComboBox, which is incorrect, I have selected a valid element in the combo by the (myCombo.selectedIndex = 4) code. Once I set change the selected item to another value, all is good.
What I noticed, is that if I retrieve the folowing value:
- myCombo.selectedItem.id is equal to "5" let's say - myModel.cardType is equal to "undefined".
So some databinding is not executing? Is that it?
Jimmy Gianninas - Software Developer Optimal Payments Inc.
|
- RE: [flexcoders] Combo Boxes, Validation and Binding Clint Modien
- RE: [flexcoders] Combo Boxes, Validation and Bind... Matt Chotin
- RE: [flexcoders] Combo Boxes, Validation and Bind... Dimitrios Gianninas

