MACROMEDIA FLEX BUILDER-USING FLEX BUILDER Manuale Utente Pagina 26

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 39
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 25
16. Create the event handlers for the Save, Delete, and Cancel buttons that display when the user edits an account record Use the
following functions:
onEditSaveClickCommits the updated object to the local database.
onEditDeleteClickDeletes the record from the local database, updates the status, and displays a toaster alert.
onEditCancelClickCancels the current edit operation.
The code should like this:
protected function onEditSaveClick() : void {
_app.setStatus( null );
// The existing account object has been updated in memory.
// Now commit the updated object to the database.
_editFieldContainer.fieldCollection.updateObject(
new mx.rpc.Responder( commitToDB, saveFaultHandler )
);
}
protected function onEditDeleteClick() : void {
_app.setStatus( null );
var account : Account = Account(
_editFieldContainer.fieldCollection.managedObject
);
// clear and go back to empty mode
_editFieldContainer.fieldCollection.clear();
currentState = "default";
_desktopWrapper.deleteItem( account )
var status : F3Message = new F3Message(
F3Message.STATUS_INFO,
"Account deleted"
);
// Show the message in the status bar.
_app.setStatus( status );
// Show the toaster.
_app.showToaster(
new Toaster(
StaticAssets.REPORT_IMAGE_32,
"Account deleted",
status.description
)
);
}
protected function onEditCancel() : void {
_app.setStatus( null );
// clear and go back to empty mode
_editFieldContainer.fieldCollection.clear();
22
Step 8: Create the Account Manager User Interface and
Application Logic
Vedere la pagina 25
1 2 ... 21 22 23 24 25 26 27 28 29 30 31 ... 38 39

Commenti su questo manuale

Nessun commento