[flexcoders] Bidirectional binding on a DateField hangs the player
sdk: 3.2 or 3.3 player: 9 or 10 I believe that there are two bugs when binding a value object to a date field, and the date field back to the value object. I'd like to receive some opinions. Say we have a value object: vo = {date:some date} When we instantiate a new form for editing, we put in the createComplete event this: originalDate = vo.date; BindingUtils.bindProperty(dateField, 'selectedDate', vo, 'date'); BindingUtils.bindProperty(vo, 'date', dateField, 'selectedDate'); vo.date = originalDate; First, I had to save the date properties, otherwise the bidirectional binding would clear it with the empty content of the date field. But perhaps here I'm doing something wrong. Second, when we run the form two or three times, the player hangs, probably in an infinite loop. I will debug DateField.as, but I'd appreciate any comment before doing so. Enri
[flexcoders] bidirectional binding
I find myself wanting to do bidirectional binding, but I have the feeling there may be some drawbacks to this. I want a screen's controls to be initialized (bound to) a data model. As the user changes the controls' values, I want the data model to reflect this. In this case the data model is basically a VO. Is there a best practice for this? thanks Jeremy Yahoo! Groups Sponsor ~-- Check out the new improvements in Yahoo! Groups email. http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/nhFolB/TM ~- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 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] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] bidirectional binding
It works like this...// --- myVO.as ---package {public class myVO { public var name:String; public var phone:String;}// -- SampleForm.mxml -mx:Script ![CDATA[ public var vo:myVO; ]]/mx:Script mx:Form mx:FormItem label=Name mx:TextInput id=nameTextInput text={ vo.name} / /mx:FormItem mx:FormItem label=Phone mx:TextInput id=phoneTextInput text={vo.phone} / /mx:FormItem/mx:Form// - here's how to create two way binding mx:Binding source=nameTextInput.text destination=vo.name / mx:Binding source=phoneTextInput.text desitnation=vo.phone /On 7/14/06, jrjazzman23 [EMAIL PROTECTED] wrote: I find myself wanting to do bidirectional binding, but I have the feeling there may be some drawbacks to this. I want a screen's controls to be initialized (bound to) a data model. As the user changes the controls' values, I want the data model to reflect this. In this case the data model is basically a VO. Is there a best practice for this? thanks Jeremy __._,_.___ -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
Re: [flexcoders] bidirectional binding
Clint, you missing some curlies in there? Another way is to use two binding tagsmx:Binding source={nameTextInput.text} destination= vo.name / mx:Binding source={vo.name} destination=nameTextInput.text / mx:TextInput id=nameTextInput /yet another is mx:TextInput id=nameTextInput text={ vo.name} change=vo.name =nameTextInput.text / which is best? you like swiss or cheddar?DKOn 7/14/06, Clint Modien [EMAIL PROTECTED] wrote: It works like this...// --- myVO.as ---package {public class myVO { public var name:String; public var phone:String;}// -- SampleForm.mxml -mx:Script ![CDATA[ public var vo:myVO; ]]/mx:Script mx:Form mx:FormItem label=Name mx:TextInput id=nameTextInput text={ vo.name} / /mx:FormItem mx:FormItem label=Phone mx:TextInput id=phoneTextInput text={vo.phone} / /mx:FormItem/mx:Form// - here's how to create two way binding mx:Binding source=nameTextInput.text destination= vo.name / mx:Binding source=phoneTextInput.text desitnation=vo.phone /On 7/14/06, jrjazzman23 [EMAIL PROTECTED] wrote: I find myself wanting to do bidirectional binding, but I have the feeling there may be some drawbacks to this. I want a screen's controls to be initialized (bound to) a data model. As the user changes the controls' values, I want the data model to reflect this. In this case the data model is basically a VO. Is there a best practice for this? thanks Jeremy -- Douglas Knudsenhttp://www.cubicleman.comthis is my signature, like it? __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___