function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MaxploreMaxplore 

Datefield control in Flex

Anyone knows how to allow the user to manually type the date in DateField control in Flex?
The moment we click on the DateField control, it popups the date chooser control. But we want to provide the user the ability to type in the date manually instead of choosing it.
 
Or is there any other control for this?
Ron HessRon Hess
you have to build it, something like this
Code:
<mx:GridItem xmlns:mx="http://www.adobe.com/2006/mxml" 
 xmlns:inputs="com.salesforce.controls.inputs.*" >
 <mx:states>
  <mx:State name="readonly">
   <mx:RemoveChild target="{datefield1}"/>
   <mx:AddChild position="lastChild">
    <mx:Label text="Label" id="dateStr" minWidth="120"/>
   </mx:AddChild>
  </mx:State>
 </mx:states>
 
 <inputs:ApexLabel id="fieldLabel" />
 <mx:DateField width="35%" textAlign="left"  id="datefield1"/> 
</mx:GridItem>

 
and here is ApexLabel

Code:
<mx:Label xmlns:mx="http://www.adobe.com/2006/mxml" 
 text="Label" width="45%" textAlign="right" 
  fontWeight="bold" 
  fontFamily="Arial" 
  fontSize="12" 
   minWidth="190"
   >
</mx:Label>

 

this is all in the src tree on sourceforge :
http://sforce.svn.sourceforge.net/viewvc/sforce/mavericks/examples/flex/com/salesforce/controls/inputs/

MaxploreMaxplore

I found a simpler way.

set the editable property of DateField to be true

Ron HessRon Hess
Nice,
Clearly, it pays to read the class documentation...