MACROMEDIA FLEX BUILDER-USING FLEX BUILDER User Manual Page 29

  • Download
  • Add to my manuals
  • Print
  • Page
    / 39
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 28
}
}
protected function onQueryResult( rows : ArrayCollection ) : void {
_desktopWrapper.releaseQueryResults( _gridDataProvider );
// populate datagrid
_gridDataProvider = rows;
if ( _gridDataProvider == null )
_gridDataProvider = new ArrayCollection();
var status : F3Message = new F3Message(
F3Message.STATUS_INFO,
"Query returned with " +
_gridDataProvider.length +
" accounts"
);
// show message in status bar
_app.setStatus( status );
// show toaster
_app.showToaster(
new Toaster(
StaticAssets.PRODUCT_IMAGE_32,
"Query Results",
status.description
)
);
}
protected function onToasterSelected( event : ToasterEvent ) : void {
var len : int = _gridDataProvider.length;
var context : String = Toaster( event.toaster ).context as String;
for ( var i : int = 0; i < len; i++ ) {
var entity : Object = _gridDataProvider.getItemAt( i );
if (
entity.hasOwnProperty( "Name" ) &&
entity.Name == context
) {
_dataGrid.selectedIndex = i;
break;
}
}
}
19. Save the file.
The final code for the AccountsView.mxml file should look like this:
<?xml version="1.0" encoding="utf-8"?>
<s:Group
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
25
Step 8: Create the Account Manager User Interface and
Application Logic
Page view 28
1 2 ... 24 25 26 27 28 29 30 31 32 33 34 ... 38 39

Comments to this Manuals

No comments