I have a strange problem. Setting the text property of a flex DateField makes the selectedDate property of that DateField go to null.
I need to set the text property so that I can use a particular format (DD-MMM-YYYY).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Whilst in the middle of typing my question, I did some more investigations and a bit of googling and finally came across the answer.
http://www.cubicleman.com/2008/02/12/flex-datefield-and-formats/
I spent the best part of a day trying to find the solution to this and had already googled a good bit so thought that it might be a good idea to put it on stackoverflow to make it more likely that someone else will find the solution in the future.
The answer, essentially, is as follows.
You need to use a combination of a date formatter and a label function to have the date showing correctly. Then, to be able to set the date programmatically without Flex “messing with your head”, you need to set the parseFunction on the dateField to null.
Code: