Flex 3 - Wednesday: Components and SDK Enhancement

Flex 3 - Wednesday: Components and SDK Enhancements

 

 
There are some wide ranging changes within the Flex SDK and components within Flex. These new classes/components/features include AdvancedDataGrid, new Collection classes, Deep Linking API (BrowserManager), Resource Bundles, Runtime Localization, and Container support in Flex Component Kit for Flash CS3. These features broaden the capabilities of Flex in providing deeper integration with AJAX, advanced visualization, and support for complex resource management/localization. Lets take a deeper look:

Advanced DataGrid:
The AdvancedDataGrid support complex views of both hierarchical and tabular data. In supporting these new types of data new collection classes where required. Also included are some helper classes to organize columns into groups and provide support for SummaryObjects and SummaryRows. Here are the new collection classes that were added:

mx.collections.HierarchicalData
mx.collections.Grouping
mx.collections.GroupingCollection
mx.collections.GroupingField
mx.collections.HierarchicalCollectionView
mx.collections.HierarchicalCollectionViewCursor
mx.collections.ListCollectionView
mx.collections.SummaryField
mx.collections.SummaryObject
mx.collections.SummaryRow

Here are some images of the AdvancedDataGrid in action:














Deep Linking:
The deep linking feature of Flex 3 allows a Flex application to manage data within a URL using the HTML Anchor(#) feature. Using the new BrowserManager a Flex application can bind to data within the URL to both set and detect changes in the URL. This feature makes it easy to persist data in the URL for bookmarking and provide a new way to input data into a Flex application. The new classes added include:

mx.events.BrowserChangeEvent;
mx.managers.IBrowserManager;
mx.managers.BrowserManager;
mx.utils.URLUtil;
Application.historyManagementEnabled

The cool part is that this API is open and can be used for many purposes outside of the deep linking feature. It allows the URL of the browser to be in sync with the context of a Flex application.

Deep Link 1
Deep Link 2


Resource Bundles and Runtime Localization:
The MXML compiler supports the creation of resource bundles (SWF) files. These bundles are created from java .properties files using the property sheets format like so:

YES_LABEL = Yes
DATE_FORMAT = MM/DD/YYYY
AGE_OF_CONSENT = 16
SOME_FLAG = true


These values are compiled into objects within a SWF file so they load quickly and are highly compressed. The key is that they allow you to create large sets of data that can be loaded in and out of the ResourceManager within Flex 3 like so:

//create a resource bundle in AS3 and add to Resource Manager
var newBundle:ResourceBundle = new ResourceBundle("fr_FR", "myBundle");
newBundle.content["OPEN"] = "Ouvrir";
newBundle.content["CLOSE"] = "Ferme";
resourceManager.addResourceBundle(newBundle);


With resource bundles it becomes easy to provide support for Localization so that you can build resource that support different languages within your application but are switchable at runtime. Within your application binding to a resource is simple and abstracts which resources are loaded into the ResourceManager. When writing your application, you bind to resource values and all strings are stored within resources that are easily recompiled and loaded.

Binding to Resource values
<mx:Button label="@Resource(bundle='controls', key='OK_LABEL')"/>

Obtaining a Resource typed value using ActionScript 3
fooBundle.getNumber("AGE_OF_CONSENT")

Loading a Resource Bundle via url
resourceManager.loadResourceBundles(url);

Flex Component Kit for Flash CS3:

Although we have released an early build of the Flex component kit for Flash CS3, we will be updating it for the Flex 3 release. We are adding support for container creation and support for more fine grained animation.

Sample





I ran out of time for todays update and could not cover the SQLLite implementation for Apollo, Chart enhancements, and FABridge integration. I will be covering all Flex 3 enhancements for Apollo on Friday.

Tomorrow I am covering my favorite feature in Flex 3. This feature will forever alter how Flex is deployed and I am pretty confident that you will be shocked. Flex is about to become much more distributed. :)

Until tomorrow's episode!

Cheers,

Ted :)

Share

0 条评论

留下评论