I prepared an example for this, so it would be easy for anyone to
reproduce this bug:

1. Create a custom TabNavigator like this: (in this example i will
call it TabN)
<?xml version="1.0" encoding="utf-8"?>
<mx:TabNavigator xmlns:mx="http://www.adobe.com/2006/mxml";>
</mx:TabNavigator>
As you can see, there's nothing weird with this one, just a custom bar

2. Create a custom Container like this: (in this example named reportGrid)
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml";
<mx:DataGrid id="telefonosDG" dataProvider="{dataGridList}" width="100%"/>
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;

[Bindable]
public var dataGridList: ArrayCollection;
]]>
</mx:Script>
</mx:HBox>
As you can see it only has a dataGrid whose dataProvider is binded to
an arrayCollection.

3. In your application do this:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
xmlns:custom="custom.*"
creationComplete="inicializar()" width="100%" height="100%"
layout="absolute">

<mx:ArrayCollection id="testList"/>
<custom:TabN width="100%">
<custom:reportGrid id="telefonos" dataGridList="{testList}"
width="100%" height="100%"/>
</custom:TabN>

<mx:Script>
<![CDATA[
private function inicializar() : void
{
var prod1:Object = {};
var prod2:Object = {};
prod1.Qty = 1;
prod1.Index = 1;
prod2.Qty = 2;
prod2.Index = 2;
testList.addItem(prod1);
testList.addItem(prod2);
}
]]>
</mx:Script>
</mx:Application>

In theory, when you modify the testList those changes should appear in
the DataGrid, but it fails, the DataGrid remains empty.

Now instead of using the custom TabNavigator (TabN) use a normal
<mx:TabNavigator> component and see what happens, it works perfectly
fine, the DataGrid is filled with the two elements that i added.

SO, What's the deal here???? Is this a bug?


--- In [email protected], "dmiramontesval"
<[EMAIL PROTECTED]> wrote:
>
> I forgot an important detail and now that i tested it i kinda know why
> it fails.
> 
> The TabNavigator is also a custom TabNavigator, and when using it is
> when the bug appears, if i use the normal TabNavigator then it works. 
> I also noticed that if i use the custom TabNavigator every property
> that i try to set in the custom component fails.
> 
> Why is that? there is nothing weird with my custom TabNavigator, i
> only added code to handle an custom event i dispatch.
> 
> 
> 
> 
> --- In [email protected], "dmiramontesval"
> <dmiramontesval@> wrote:
> >
> > 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