I have an editable advanceddatagrid (editable column). I am providing the arraycollection as a dataprovider. (fname(string), lname(string), bdate(Date)). (3 columns)
I have created the VO for fname, lname, and bdate. Whenever I edit bdate and focus out , it will try to get saved the string value as a Date and got failed (which is obvious). By default, editor consider “TextInput” as an itemeditor and save the inserted date as a text and that text value getting refused by the VO which is expecting behavior.
- I tried to update the value in “ItemEditEnd” event handler but it wont allow me to do that.
- I also tried to put a check at VO but it never reached there. (I am not sure why)
I have to strictly keep the VO as Date instead of text.
Is there anyway we can convert string into Date ? Any other place ? Is there anything I can do at collection change ?
Please help me if possible.
thanks,
For this, I would use another approach than the one you are suggesting.
In this example I am using an ItemRenderer which will also function as the ItemEditor.
In this case it is a DateField, which will be able to cope with the date property you have in your VO without the need to be parsing dates manually.
Suggested for you to read up: