u can disabled the grid to waiting the httpservice return, then if
httpservice return ok ,goto ok status,if not,enabled the grid edit it again!

12 Mar 2007 00:05:00 -0700, Alex <[EMAIL PROTECTED]>:

  Quick question,


  I'm trying to devise a table-edit view of a set of database tables, and
am successfully pulling records using e4x etc.

  At the cell-edition stage, I'm capturing an "itemEditEnd" event on my
DataGrid, and that's going well also.

  My question however, surrounds actual edition, and the cancellation of
an edit event.

  The code should look like this:

private function editHandler( e:DataGRidEvent ):void{
  if( e.reason == DataGridEventReason.CANCELLED )
      return;

   // get the new input
  var newData:String = TextInput( e.currentTarget.itemEditorInstance
).text;

   // request the edit
   ??

   if( "edit was bad" ){
    e.preventDefault();
    // TextInput( dataGrid.itemEditorInstance ).errorString = "Invalid
input";
   }
}


"Requesting the edit" above, involves using HTTPService to send the edit
request to the server, which will respond with OK, or NOT OK.  How can I
"wait" for an HTTPService request inside of that function, so that I can
call e.preventDefault() if required?  AFAIK, the HTTPService only works
with a callback-type model?

Can I synchronize and wait on a lock like in Java in this case?

Much appreciated.
Alex



--
闲云孤鹤 - 清冷香中抱膝吟

Reply via email to