i think i got a work around like this

private var asyncVal:Boolean=false;
function doValidate(event:DataGridEvent):void
{
  if(e.reason == DataGridEventReason.NEW_COLUMN && this.asyncVal)
  {
        e.preventDefault();
        this.asyncVal = false;
        return;
  }

  this.asyncVal=true;
  // code continued
}


--- In flexcoders@yahoogroups.com, "bhaq1972" <[EMAIL PROTECTED]> wrote:
>
> Hi
> 
> I have a datagrid itemEditEnd event, where i am doing an 
> asynchronous validation.
> 
> To prevent losing focus from the itemEditorInstance during the 
> asynchronous validation, i call event.preventDefault().
> 
> If the asynchronous validation is succesfull i want to cancel the 
> event.preventDefault().
> 
> How do i do this? 
> (i tried a couple of things but failed)
> 
> Code
> -----
> <mx:DataGrid id="dg" itemEditEnd="doValidation()">
> 
> private var eventObj:DataGridEvent;
> 
> function doValidation(event:DataGridEvent):void
> {
>   var newData:String= TextInput(dg.itemEditorInstance).text;
> 
>   event.preventDefault();
> 
>   this.eventObj = event;  
> 
>   validateClass.getInstance().validate(newData); 
>   // return handler below
> }
> 
> function validationReturnHandler(boolean1:Boolean):void
> {
>   if(boolean1)
>   {
>     if(this.eventObj.isDefaultPrevented())
>     {
>        // how do i reverse this.eventObj.preventDefault();
>     }
>   }
>   else
>   {
>     TextInput(dg.itemEditorInstance).errorString = "Failed";
>   }
> }
>







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Home is just a click away.  Make Yahoo! your home page now.
http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to