Hi, Attached is the code to reproduce the bug... the change handler does not get executed when the selected item of the combo box is changed via AS. Time to get a bug fixin! :) I've already sumitted the bug. Jimmy Gianninas - Software Developer Optimal Payments Inc.
_____ From: Matt Chotin [mailto:[EMAIL PROTECTED] Sent: Saturday, June 05, 2004 1:23 AM To: '[email protected]' Subject: RE: [flexcoders] Combo Boxes, Validation and Binding If myModel.cardType is undefined it sure seems like it's not getting set :-) 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----- From: Dimitrios Gianninas [mailto:[EMAIL PROTECTED] Sent: Friday, June 04, 2004 2:12 PM To: [email protected] Subject: [flexcoders] Combo Boxes, Validation and Binding 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. AVIS IMPORTANT WARNING Les informations contenues dans le present document et ses pieces jointes sont strictement confidentielles et reservees a l'usage de la (des) personne(s) a qui il est adresse. Si vous n'etes pas le destinataire, soyez avise que toute divulgation, distribution, copie, ou autre utilisation de ces informations est strictement prohibee. Si vous avez recu ce document par erreur, veuillez s'il vous plait communiquer immediatement avec l'expediteur et detruire ce document sans en faire de copie sous quelque forme. The information contained in this document and attachments is confidential and intended only for the person(s) named above. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution, or any other use of the information is strictly prohibited. If you have received this document by mistake, please notify the sender immediately and destroy this document and attachments without making any copy of any kind. Yahoo! Groups Sponsor ADVERTISEMENT click here <http://rd.yahoo.com/SIG=129c50jcu/M=298184.5022502.6152625.3001176/D=gr oups/S=1705007207:HM/EXP=1086499402/A=2164330/R=0/SIG=11eamf8g4/*http:// www.netflix.com/Default?mqso=60183350> <http://us.adserver.yahoo.com/l?M=298184.5022502.6152625.3001176/D=group s/S=:HM/A=2164330/rand=343620849> _____ Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . ------_=_NextPart_002_01C44BCD.A960E280 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=us-ascii"> <META content="MSHTML 6.00.2800.1400" name=GENERATOR> <STYLE>@font-face { font-family: Wingdings; } @font-face { font-family: Tahoma; } @font-face { font-family: Verdana; } @page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; } P.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" } LI.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" } DIV.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" } A:link { COLOR: blue; TEXT-DECORATION: underline } SPAN.MsoHyperlink { COLOR: blue; TEXT-DECORATION: underline } A:visited { COLOR: blue; TEXT-DECORATION: underline } SPAN.MsoHyperlinkFollowed { COLOR: blue; TEXT-DECORATION: underline } P { FONT-SIZE: 12pt; MARGIN-LEFT: 0in; MARGIN-RIGHT: 0in; FONT-FAMILY: "Times New Roman" } TT { FONT-FAMILY: "Courier New" } SPAN.EmailStyle20 { COLOR: navy; FONT-FAMILY: Arial } DIV.Section1 { page: Section1 } OL { MARGIN-BOTTOM: 0in } UL { MARGIN-BOTTOM: 0in } </STYLE> </HEAD> <BODY lang=EN-US vLink=blue link=blue> <DIV dir=ltr align=left><SPAN class=920584413-06062004><FONT face=Arial color=#0000ff size=2>Hi,</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=920584413-06062004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV dir=ltr align=left><SPAN class=920584413-06062004><FONT face=Arial color=#0000ff size=2>Attached is the code to reproduce the bug... the change handler does not get executed when the selected item of the combo box is changed via AS. Time to get a bug fixin! :)</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=920584413-06062004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV dir=ltr align=left><SPAN class=920584413-06062004><FONT face=Arial color=#0000ff size=2>I've already sumitted the bug.</FONT></SPAN></DIV> <DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV> <DIV align=left><FONT face=Arial size=2>Jimmy Gianninas - Software Developer</FONT></DIV> <DIV align=left><FONT face=Arial size=2><STRONG>Optimal Payments Inc.</STRONG></FONT></DIV> <DIV> </DIV><BR> <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left> <HR tabIndex=-1> <FONT face=Tahoma size=2><B>From:</B> Matt Chotin [mailto:[EMAIL PROTECTED] <BR><B>Sent:</B> Saturday, June 05, 2004 1:23 AM<BR><B>To:</B> '[email protected]'<BR><B>Subject:</B> RE: [flexcoders] Combo Boxes, Validation and Binding<BR></FONT><BR></DIV> <DIV></DIV> <DIV class=Section1> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">If myModel.cardType is undefined it sure seems like it's not getting set </SPAN></FONT><FONT face=Wingdings color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Wingdings">J</SPAN></FONT><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> Put a change handler on your ComboBox and see if that is getting executed when you reachthat 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 tooand see if that makes any difference. All that fails try to post a working sample so we can see what's up.</SPAN></FONT></P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Matt</SPAN></FONT></P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Dimitrios Gianninas [mailto:[EMAIL PROTECTED] <BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, June 04, 2004 2:12 PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> [email protected]<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> [flexcoders] Combo Boxes, Validation and Binding</SPAN></FONT></P> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Ok, I have a little dilemma</SPAN></FONT></P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Say you have a ComboBox whichhas a list of credit card type, which is populate via a remote call: <STRONG><B><FONT face=Arial><SPAN style="FONT-FAMILY: Arial">myCombo.dataProvider = myCCList;</SPAN></FONT></B></STRONG></SPAN></FONT></P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">No problem, that works and itis 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="".</SPAN></FONT></P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">And this combo is tied to a validation, like so:</SPAN></FONT></P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><mx:Model id="myModel'></SPAN></FONT></P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> <cardType>{myCombo.selectedItem.id}</cardType></SPAN></FONT></P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></mx:Model></SPAN></FONT></P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><mx:NumberValidation field="myModel.cardType" notANumber="Please select an item in the list."/></SPAN></FONT></P></DIV></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Say, I want to set the selected item of the combo once the user comes to that screen: <STRONG><B><FONT face=Arial><SPAN style="FONT-FAMILY: Arial">myCombo.selectedIndex = 4;</SPAN></FONT></B></STRONG></SPAN></FONT></P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">All good up to now.</SPAN></FONT></P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">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 (<STRONG><B><FONT face=Arial><SPAN style="FONT-FAMILY: Arial">myCombo.selectedIndex = 4</SPAN></FONT></B></STRONG>) code. Once I set change the selected item to another value, all is good.</SPAN></FONT></P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">What I noticed, is that if I retrieve the folowing value:</SPAN></FONT></P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><STRONG><B><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">- <FONT color=navy><SPAN style="COLOR: navy">myCombo.selectedItem.id</SPAN></FONT></SPAN></FONT></B></STRONG><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> is equal to "<STRONG><B><FONT face=Arial color=red><SPAN style="COLOR: red; FONT-FAMILY: Arial">5</SPAN></FONT></B></STRONG>" let's say</SPAN></FONT></P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">- <STRONG><B><FONT face=Arial color=navy><SPAN style="COLOR: navy; FONT-FAMILY: Arial">myModel.cardType</SPAN></FONT></B></STRONG> is equal to "<STRONG><B><FONT face=Arial color=red><SPAN style="COLOR: red; FONT-FAMILY: Arial">undefined</SPAN></FONT></B></STRONG>".</SPAN></FONT></P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">So some databinding is not executing? Is that it?</SPAN></FONT></P></DIV> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Jimmy Gianninas - Software Developer</SPAN></FONT></P> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><STRONG><B><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Optimal Payments Inc.</SPAN></FONT></B></STRONG></P> <DIV> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <P class=MsoNormal style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 0.5in; MARGIN-RIGHT: 0in"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P> <TABLE class=MsoNormalTable style="MARGIN-LEFT: 0.5in; WIDTH: 600pt" cellSpacing=10 cellPadding=0 width=800 border=0> <TBODY> <TR> <TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #bdbdbd; PADDING-BOTTOM: 3pt; WIDTH: 289pt; PADDING-TOP: 3pt" vAlign=top width=385 bgColor=#bdbdbd> <P class=MsoNormal><B><FONT face=Verdana color=white size=2><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: white; FONT-FAMILY: Verdana">AVIS IMPORTANT</SPAN></FONT></B></P></TD> <TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #bdbdbd; PADDING-BOTTOM: 3pt; WIDTH: 288.5pt; PADDING-TOP: 3pt" vAlign=top width=385 bgColor=#bdbdbd> <P class=MsoNormal><B><FONT face=Verdana color=white size=2><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: white; FONT-FAMILY: Verdana">WARNING</SPAN></FONT></B></P></TD></TR> <TR> <TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; WIDTH: 289pt; PADDING-TOP: 3pt" vAlign=top width=385> <P><FONT face=Verdana color=gray size=1><SPAN style="FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: Verdana">Les informations contenues dans le present document et ses pieces jointessont strictement confidentielles et reservees a l'usage de la (des) personne(s) a qui il est adresse. Si vous n'etes pas le destinataire, soyez aviseque toute divulgation, distribution, copie, ou autre utilisation de ces informations est strictement prohibee. Si vous avez recu ce document par erreur, veuillez s'il vous plait communiquer immediatement avec l'expediteur et detruire ce document sans en faire de copie sous quelque forme.</SPAN></FONT></P></TD> <TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; WIDTH: 288.5pt; PADDING-TOP: 3pt" vAlign=top width=385> <P><FONT face=Verdana color=gray size=1><SPAN style="FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: Verdana">The information contained in this document and attachments is confidential and intended only for the person(s) named above. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution, or any other use of the information is strictly prohibited. If you have received this document by mistake, please notify the sender immediately and destroy this document and attachments without making any copy of any kind.</SPAN></FONT></P></TD></TR></TBODY></TABLE> <P class=MsoNormal style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><BR><BR><BR></SPAN></FONT></P><BR></DIV></BODY></HTML> ------_=_NextPart_002_01C44BCD.A960E280--
binWrHTJLT8By.bin
Description: dropdown.mxml

