Halo Navigators and Spark Containers SpecificationAlex Harui (Dev) Functional and Design SpecificationGlossary | Summary and Background | Usage Scenarios | Detailed Description | API Description | B Features | Examples and Usage | Additional Implementation Details | Prototype Work | Compiler Work | Web Tier Compiler Impact | Flex Feature Dependencies | Backwards Compatibility | Accessibility | Performance | Globalization | Localization | Issues and Recommendations | Documentation | QA
GlossaryDI - Deferred Instantation - In DeferredInstantiation, a container's children are not always created at the usual point in the component lifecycle (when addChild'd to the parent). Summary and BackgroundHalo Navigators (ViewStack, TabNavigator, Accordion) are highly useful and popular controls in existing Flex applications. Unfortunately, there is no time on the schedule for a Spark-based equivalent. Currently, Spark Containers cannot be used in Halo Navigators. The compiler checks to see if Navigator children extend mx.core.Container. The navigators have APIs like selectedChild that assume the child extends Container. There has been considerable feedback from customers to allow Spark Containers to work in Halo Navigators. Usage ScenariosJane wants to use the new Spark GraphicElements on every view in a TabNavigator. Unfortunately, she gets an error trying to put GraphicElements in Halo Containers and different errors trying to put the Graphic Elements in a Spark Container and putting the Spark Container in a Halo Navigator. Detailed DescriptionThe changes required to allow Spark Containers in Halo Navigators are:
API Descriptionpackage mx.core
{
/**
* NavigatorContent is an IDeferredContentOwner with label and icon properties
* that dispatch notifications when those properties change
*/
public interface INavigatorContent extends IDeferredContentOwner, IToolTipManagerClient
{
[Bindable("labelChanged")]
function get label():String;
[Bindable("iconChanged")]
function get icon():Class;
}
}
ViewStack and Accordion selectedChild properties change signature to be of type INavigatorContent public function get selectedChild():INavigatorContent
public function set selectedChild(value:INavigatorContent):void
IDeferredContentOwner gets a new deferredContentCreated flag /**
* A flag that indicates whether the deferred content has been created.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
function get deferredContentCreated():Boolean;
mx.core.Container gets a createDeferredContent method that calls the old createComponentsFromDescriptor /**
* IDeferredContentOwner equivalent of createComponentsFromDescriptor(true)
*
* @see createComponentsFromDescriptors
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4
*/
public function createDeferredContent():void
B FeaturesIt has surprised many that Group can't and still won't be usable as a Navigator child container. The primary reason is that it isn't a DI container. If we get serious pushback from the community we can consider allowing Group in even if it doesn't handle DI, but the performance implications of effectively having creationPolicy="all" must be considered. Examples and UsageMXML now allowed: <mx:ViewStack id="vs" selectedIndex="{tb.selectedIndex}">
<s:NavigatorContent label="bar">
<s:layout>
<s:VerticalLayout />
</s:layout>
<s:SimpleText text="bar" />
<s:TextInput />
</s:NavigatorContent>
</mx:ViewStack>
ActionScript now allowed: var newContainer:NavigatorContent = new NavigatorContent();
newContainer.label = tiName.text;
newContainer.layout = new VerticalLayout();
var st:SimpleText = new SimpleText();
st.text = tiName.text;
var ti:spark.components.TextInput = new spark.components.TextInput();
newContainer.mxmlContent = [ st, ti ];
vs.addChild(newContainer);
Additional Implementation DetailsNone Prototype WorkPrototype complete Compiler WorkDescribed in detailed description Web Tier Compiler ImpactNone Flex Feature DependenciesNone Backwards CompatibilitySyntax changesViewStack and Accordion selectedChild properties change signature to be of type INavigatorContent public function get selectedChild():INavigatorContent
public function set selectedChild(value:INavigatorContent):void
BehaviorNone Warnings/DeprecationNone AccessibilityNone PerformanceNone GlobalizationNone LocalizationCompiler Featuresmxml.builder.ComponentBuilder.HaloNavigatorsRequireHaloContainerChildren warning message updated Framework FeaturesNone Issues and RecommendationsNone DocumentationNeed examples of using NavigatorContent in a ViewStack QANone |
|
| You must be logged in to comment. |
|---|
