Hi Everyone,
I have a sub-component which uses a String binding on a Label. The bindings
works fine if I do not use a skinClass on the host component. If I do use a
SparkSkin, my bindings do not execute on the sub-component. Instead, I get the
value which I initialized it to.
Am I doing something wrong, or is this expected behavior?
If this is expected behavior, then what is the purpose of a SparkSkin if I have
to explicitly redeclare all my control code in the skin?
I could just be misunderstanding the intended usage, but from what I understood
in the docs it seems like a very powerful new feature.
Would anyone be able to enlighten me on the topic a bit more?
Here is the trimmed code for my host/sub
Host Component
----
<s:SkinnableContainer skinClass="demand.skins.DSDoc" >
<fx:Metadata>
[SkinState("normal")]
</fx:Metadata>
<fx:Script>
<![CDATA[
[SkinPart(required="false")]
public var titleBar:IReportTitleBar
override protected function createChildren():void
{
if (!_titleBar)
{
_titleBar = new DCDocTitleBar();
this.addElementAt(IVisualElement(_titleBar), 0);
}
super.createChildren();
}
]]>
</fx:Script>
</s:SkinnableContainer>
---
The title bar sub-component
----
<s:SkinnableContainer >
<fx:Script>
<![CDATA[
[Bindable]
public var label:String="Incorrect Label";
]]>
</fx:Script>
<s:Label text="{this.label}"/>
</s:SkinnableContainer>
----
The host component skin
----
<s:SparkSkin >
<fx:Metadata>
[HostComponent("demand.reports.DRDoc")]
</fx:Metadata>
<s:states>
<s:State name="normal"/>
</s:states>
<controls:DCDocTitleBar id="titleBar" />
</s:SparkSkin>
----
Thanks in advance!
~Aaron