This content has been marked as final. Show 6 replies
I've had the same problem before and solved it by supplying a set method that received a string as the parameter. Convert the string date in the set method.
thanks for the suggestion, but where should I put the set method? The PersonVO class simply define some public variables, and the "birthDate" one is of flex standard Date class.
Change your PersonVO class from public variables to set/get methods.
public var birthDate : Date;
use something like:
protected var _birthDate: Date;
public function get birthDate() : Date
public function set birthDate( value : String ) : void
_birthDate = <conversion of value to date>;
public function set birthDate( value : Date ) : void
_birthdate = value;
I'm just slapping this out and didn't bother to look up a conversion routine for the date, but it is not difficult. If you need one let me know and I'll get it to you.
Thanks very much joe, I'll try this tomorrow.
The funny thing is that the field indeed was a String, I had to switch to a Date due to an error happening when the DateField editor *received* the focus.. :-)
I managed to make it works adding the editorDataField="selectedDate" attribute to the DataGridColumn element, even leaving the birthDate attribute on the VO as a public Date variable.
Thank you anyway for the help.
Thanks for pointing out your solution - three years later and you just saved me!