I have a little issue when using custom components and localization. I
have a TabNavigator component, which has as children some custom
components which are containers:

<mx:TabNavigator>
    <custom:MyContainer/>
</mx:TabNavigator>


MyContainer:

<mx:HBox>
   <mx:DataGrid/>
   <mx:Label/> 
</mx:HBox>

The bug appears when i want to set the label property like this:

<mx:TabNavigator>
  <custom:MyContainer id="myC" label="{resource.getString('hello')}"/>
</mx:TabNavigator>

<mx:Script>
<![CDATA[
import mx.resources.ResourceBundle;

[ResourceBundle("PersonaFlex")]
private static var resource : ResourceBundle;

]]>
</mx:Script>

If i test my application the label on the tab appears empty, as if i
didn't set the label property. As you can see i am using a
localization file.
The funny thing is that if i do this:

<mx:TabNavigator>
  <custom:MyContainer id="myC" label="{resource.getString('hello')}"/>
  <mx:HBox label="{resource.getString('hello')}"/>
</mx:TabNavigator>

the second tab label does appear but the first one still appears emtpy.
Furthermore, if i set the label inside my custom component instead of
doing it in the tabNavigator like this:

<mx:TabNavigator>
  <custom:MyContainer id="myC"/>
  <mx:HBox label="{resource.getString('hello')}"/>
</mx:TabNavigator>


MyContainer:

<mx:HBox label="{resource.getString('hello')}">
   <mx:DataGrid/>
   <mx:Label/> 
</mx:HBox>

This one works, both tabs' labels appear.

So why is this happening? Why can't i set the label property of a
custom container from the main application? Why if i set it to a
non-custom component does work?

Thanks


Reply via email to