You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Carlos Rovira <ca...@apache.org> on 2020/08/11 11:50:12 UTC

Declaring ArrayList in mxml

Hi,

I was trying to declare Arrayist in the following way like we used to do in
Flex for ArrayCollection [1] was I think is not possible:

<j:TabBar width="100%" selectedIndex="0"
itemRenderer="itemRenderers.TabBarVerticalIconItemRenderer"
sameWidths="true">
<j:dataProvider>
<js:ArrayList>
<vos:TabBarButtonVO label="Tile Container" hash="sec1" icon=
"{FontAwesome5IconType.TH_LARGE}"/>
<vos:TabBarButtonVO label="Tile List" hash="sec2" icon=
"{FontAwesome5IconType.TH_LIST}"/>
</js:ArrayList>
</j:dataProvider>
</j:TabBar>

Do you know if this is possible and maybe I'm doing something wrong in the
declaration? or maybe we have support in compiler for this?

Thanks

[1]
http://www.java2s.com/Code/Flex/Data-Model/InitializinganArrayCollectionusingMXMLwithembeddeddata.htm
-- 
Carlos Rovira
http://about.me/carlosrovira

Re: Declaring ArrayList in mxml

Posted by Harbs <ha...@gmail.com>.
Cool. :-)

defaultProperty is one of those really useful, not-very-well-known features on MXML… ;-)

Harbs

> On Aug 11, 2020, at 9:33 PM, Carlos Rovira <ca...@apache.org> wrote:
> 
> Hi Harbs,
> 
> I added DefaultProperty to ArrayList (source) and Jewel List (dataProvider)
> and now next code is working.
> So cool :)
> 
> <j:TabBar width="100%" selectedIndex="0"
> itemRenderer="itemRenderers.TabBarVerticalIconItemRenderer"
> sameWidths="true">
> <js:ArrayList>
> <fx:Array>
> <vos:TabBarButtonVO label="Tile Container" hash="sec1" icon=
> "{FontAwesome5IconType.TH_LARGE}"/>
> <vos:TabBarButtonVO label="Tile List" hash="sec2" icon=
> "{FontAwesome5IconType.TH_LIST}"/>
> </fx:Array>
> </js:ArrayList>
> </j:TabBar>
> 
> El mar., 11 ago. 2020 a las 19:36, Harbs (<ha...@gmail.com>) escribió:
> 
>> ArrayList does not declare a default property, so that’s not going to
>> work. It could be we should add that, but in the meantime, you probably
>> need something like this (completely untested and probably has typos):
>> 
>> <js:ArrayList>
>> <js:source>
>> <Array>
>> <vos:TabBarButtonVO label="Tile Container" hash="sec1" icon=
>> "{FontAwesome5IconType.TH_LARGE}"/>
>> <vos:TabBarButtonVO label="Tile List" hash="sec2" icon=
>> "{FontAwesome5IconType.TH_LIST}"/>
>> </Array>
>> </js:source>
>> </js:ArrayList>
>> 
>> 
>> 
>>> On Aug 11, 2020, at 2:50 PM, Carlos Rovira <ca...@apache.org>
>> wrote:
>>> 
>>> Hi,
>>> 
>>> I was trying to declare Arrayist in the following way like we used to do
>> in
>>> Flex for ArrayCollection [1] was I think is not possible:
>>> 
>>> <j:TabBar width="100%" selectedIndex="0"
>>> itemRenderer="itemRenderers.TabBarVerticalIconItemRenderer"
>>> sameWidths="true">
>>> <j:dataProvider>
>>> <js:ArrayList>
>>> <vos:TabBarButtonVO label="Tile Container" hash="sec1" icon=
>>> "{FontAwesome5IconType.TH_LARGE}"/>
>>> <vos:TabBarButtonVO label="Tile List" hash="sec2" icon=
>>> "{FontAwesome5IconType.TH_LIST}"/>
>>> </js:ArrayList>
>>> </j:dataProvider>
>>> </j:TabBar>
>>> 
>>> Do you know if this is possible and maybe I'm doing something wrong in
>> the
>>> declaration? or maybe we have support in compiler for this?
>>> 
>>> Thanks
>>> 
>>> [1]
>>> 
>> http://www.java2s.com/Code/Flex/Data-Model/InitializinganArrayCollectionusingMXMLwithembeddeddata.htm
>>> --
>>> Carlos Rovira
>>> http://about.me/carlosrovira
>> 
>> 
> 
> -- 
> Carlos Rovira
> http://about.me/carlosrovira


Re: Declaring ArrayList in mxml

Posted by Carlos Rovira <ca...@apache.org>.
Hi Harbs,

I added DefaultProperty to ArrayList (source) and Jewel List (dataProvider)
and now next code is working.
So cool :)

<j:TabBar width="100%" selectedIndex="0"
itemRenderer="itemRenderers.TabBarVerticalIconItemRenderer"
sameWidths="true">
<js:ArrayList>
<fx:Array>
<vos:TabBarButtonVO label="Tile Container" hash="sec1" icon=
"{FontAwesome5IconType.TH_LARGE}"/>
<vos:TabBarButtonVO label="Tile List" hash="sec2" icon=
"{FontAwesome5IconType.TH_LIST}"/>
</fx:Array>
</js:ArrayList>
</j:TabBar>

El mar., 11 ago. 2020 a las 19:36, Harbs (<ha...@gmail.com>) escribió:

> ArrayList does not declare a default property, so that’s not going to
> work. It could be we should add that, but in the meantime, you probably
> need something like this (completely untested and probably has typos):
>
> <js:ArrayList>
> <js:source>
> <Array>
> <vos:TabBarButtonVO label="Tile Container" hash="sec1" icon=
> "{FontAwesome5IconType.TH_LARGE}"/>
> <vos:TabBarButtonVO label="Tile List" hash="sec2" icon=
> "{FontAwesome5IconType.TH_LIST}"/>
> </Array>
> </js:source>
> </js:ArrayList>
>
>
>
> > On Aug 11, 2020, at 2:50 PM, Carlos Rovira <ca...@apache.org>
> wrote:
> >
> > Hi,
> >
> > I was trying to declare Arrayist in the following way like we used to do
> in
> > Flex for ArrayCollection [1] was I think is not possible:
> >
> > <j:TabBar width="100%" selectedIndex="0"
> > itemRenderer="itemRenderers.TabBarVerticalIconItemRenderer"
> > sameWidths="true">
> > <j:dataProvider>
> > <js:ArrayList>
> > <vos:TabBarButtonVO label="Tile Container" hash="sec1" icon=
> > "{FontAwesome5IconType.TH_LARGE}"/>
> > <vos:TabBarButtonVO label="Tile List" hash="sec2" icon=
> > "{FontAwesome5IconType.TH_LIST}"/>
> > </js:ArrayList>
> > </j:dataProvider>
> > </j:TabBar>
> >
> > Do you know if this is possible and maybe I'm doing something wrong in
> the
> > declaration? or maybe we have support in compiler for this?
> >
> > Thanks
> >
> > [1]
> >
> http://www.java2s.com/Code/Flex/Data-Model/InitializinganArrayCollectionusingMXMLwithembeddeddata.htm
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: Declaring ArrayList in mxml

Posted by Harbs <ha...@gmail.com>.
ArrayList does not declare a default property, so that’s not going to work. It could be we should add that, but in the meantime, you probably need something like this (completely untested and probably has typos):

<js:ArrayList>
<js:source>
<Array>
<vos:TabBarButtonVO label="Tile Container" hash="sec1" icon=
"{FontAwesome5IconType.TH_LARGE}"/>
<vos:TabBarButtonVO label="Tile List" hash="sec2" icon=
"{FontAwesome5IconType.TH_LIST}"/>
</Array>
</js:source>
</js:ArrayList>



> On Aug 11, 2020, at 2:50 PM, Carlos Rovira <ca...@apache.org> wrote:
> 
> Hi,
> 
> I was trying to declare Arrayist in the following way like we used to do in
> Flex for ArrayCollection [1] was I think is not possible:
> 
> <j:TabBar width="100%" selectedIndex="0"
> itemRenderer="itemRenderers.TabBarVerticalIconItemRenderer"
> sameWidths="true">
> <j:dataProvider>
> <js:ArrayList>
> <vos:TabBarButtonVO label="Tile Container" hash="sec1" icon=
> "{FontAwesome5IconType.TH_LARGE}"/>
> <vos:TabBarButtonVO label="Tile List" hash="sec2" icon=
> "{FontAwesome5IconType.TH_LIST}"/>
> </js:ArrayList>
> </j:dataProvider>
> </j:TabBar>
> 
> Do you know if this is possible and maybe I'm doing something wrong in the
> declaration? or maybe we have support in compiler for this?
> 
> Thanks
> 
> [1]
> http://www.java2s.com/Code/Flex/Data-Model/InitializinganArrayCollectionusingMXMLwithembeddeddata.htm
> -- 
> Carlos Rovira
> http://about.me/carlosrovira