5/29/2010 8:39:45 AM
Title:
DateField Change Event
Hi,
I have two labels and one date field.
Label 1: " Rama"
Label 2: "Krishna"
Date : 29/05/2007
Whenever i change the date , the lables will be empty, I done it.
but my question is
Whenever i click the datefield it is empty, and When i select the same date , the labels will be empty, Whenever i select the date , it is not empty. How to do it, I want the condition? please provide the Condition?
Thanks
Rama
5/29/2010 11:25:29 AM
if you implement empty on click then there is no way to do not empty label on selection, because to select you first have to click.
If you implement empty label on release then you can check on release of textbox that if some text is selected then do not empty label , and if nothing selected then empty it.
5/30/2010 12:57:46 AM
If previous selected date is same as the new selected then the label won't get empty.
private var previousDate:Date;
protected function datefield1_changeHandler(event:CalendarLayoutChangeEvent):void
{
if(event.newDate != previousDate && previousDate !=null ){
myLabel.text="";
}
previousDate=event.newDate;
}
]]>
</mx:Script>
<mx:DateField id="myDateField" showToday="true" x="90" y="261" change="datefield1_changeHandler(event)"/>
<mx:Label id="myLabel" x="75" y="193" text="Label" />