Sei se ajuda muito nao mas eu crirei um componente que ja faz isso e
ainda coloca em portugues
nome do meu componente DataFieldBR
segue codigo:
<?xml version="1.0" encoding="iso-8859-1"?>
<mx:DateField xmlns:mx="
http://www.adobe.com/2006/mxml"
dayNames="{dias}"
monthNames="{meses}"
formatString="DD/MM/YYYY"
yearNavigationEnabled="true"
editable="true"
restrict="0-9"
width="94"
valueCommit="validar(event);">
<mx:Script>
<![CDATA[
import mx.events.FlexEvent;
private function configApp():void {
this.selectedDate = new Date();
}
private function validar(event:FlexEvent):void {
var str:String = event.target.text as String;
if ( str.charAt(2) != "/" || str.charAt(5) != "/" ) {
var mask:String;
if ( str.length == 6 ) {
mask = str.substr(0, 2) + "/" +
str.substr(2,2) + "/" + str.substr(4, 4);
event.target.text = mask;
} else if ( str.length == 8 ) {
mask = str.substr(0, 2) + "/" +
str.substr(2,2) + "/" + str.substr(4, 4);
event.target.text = mask;
}
}
}
]]>
</mx:Script>
<mx:Array id="dias">
<mx:String>D</mx:String>
<mx:String>S</mx:String>
<mx:String>T</mx:String>
<mx:String>Q</mx:String>
<mx:String>Q</mx:String>
<mx:String>S</mx:String>
<mx:String>S</mx:String>
</mx:Array>
<mx:Array id="meses">
<mx:String>Janeiro</mx:String>
<mx:String>Fevereiro</mx:String>
<mx:String>Março</mx:String>
<mx:String>Abril</mx:String>
<mx:String>Maio</mx:String>
<mx:String>Junho</mx:String>
<mx:String>Julho</mx:String>
<mx:String>Agosto</mx:String>
<mx:String>Setembro</mx:String>
<mx:String>Outubro</mx:String>
<mx:String>Novembro</mx:String>
<mx:String>Dezembro</mx:String>
</mx:Array>
</mx:DateField>
logicamente que o que o helio e bruno colocaram tb funciona
perfeitamente.
Abraço.
Luiz Nogueira
On 20 out, 11:44, Helio Antonio Francisco Silva
> 2010/10/20 bruno bg <
bruno...@ig.com.br>
>
>
>
> > já tentou a propriedade editable="true".
>
> > --
> > ****************************************************
> >
www.brunobg.com
> >
bruno...@ig.com.br (MSN & Skype)
> >
blogflex.brunobg.com
> > @brunogrohs
> > (21) 9913-2397
>
> > Em 20 de outubro de 2010 09:01, Bruno Carneiro <
> >
guimaraescarne...@gmail.com> escreveu:
>
> > Galera, estive pensando em alguma solução no qual o usuário possa
> >> entrar com a data pelo teclado. O componente padrão do flex só
> >> seleciona a data pelo mouse.
>
> >> Existe algum componente free ( ou pago ) deste tipo?
>
> >> --
> >> Você recebeu esta mensagem porque está inscrito na lista "flexdev"
> >> Para enviar uma mensagem, envie um e-mail para
fle...@googlegroups.com
> >> Para sair da lista, envie um email em branco para
> >>
flexdev-u...@googlegroups.com
> >> Mais opções estão disponíveis emhttp://
groups.google.com/group/flexdev
> *Hélio Antonio Fransico Silva*