Try subclassing and overriding the measure() method to return a greater 
measuredWidth.

Gordon Smith
Adobe Flex SDK Team

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of aceoohay
Sent: Friday, October 17, 2008 12:25 PM
To: [email protected]
Subject: [flexcoders] Overriding width of DateField


One anomaly I've found in flex is the width of the DateField. It's
width is about 90px. If you use it with no width, and make it
editable, when the user puts in a date in mm/dd/yyyy format it will
move the left 2 characters out of the box to the left.

To correct this issue, I would like to create a version of the
DateField and override the width, if not provided by the developer to
be 94px. I can easily do that by putting;

if (!this.width)this.width = 94;

in the initialize method. The problem is this does not display the
correct size object in flexbuilder during design mode.

My question is, how can I subclass the object in such a way as to have
it display properly (the enhanced width attribute) in design mode?

Paul

Reply via email to