You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Harbs <ha...@gmail.com> on 2016/11/29 14:52:49 UTC
Subclassing js:List
I just tried making an mxml component based off js:List in FlexJS and it doesn’t seem to work.
I get an error when the js code tries to execute:
this.generateMXMLAttributes
([0,
0,
1,
'initComplete',
this.$EH0
]);
TypeError: undefined is not a function
I searched the asjs files for this function and it looks like only components which implement IMXMLDocument have this function. List, ListBase and UIBase all do not seem to implement this. Is this an oversight, am I missing something, or what?
Thanks,
Harbs
Re: Subclassing js:List
Posted by Alex Harui <ah...@adobe.com>.
On 11/29/16, 8:59 AM, "Harbs" <ha...@gmail.com> wrote:
>ContainerBase already implements IMXMLDocument.
>
>That’s why I was assuming that any non-trivial components should do the
>same.
Right, I meant that probably ContainerBase shouldn't implement
IMXMLDocument and we should have an MXMLContainerBase instead that does.
In the Basic set we don't want to make everyone pay for stuff they don't
need. I still think there will be some fatter component set that
composites more stuff that will be the more popular starting point for
most people.
-Alex
>
>On Nov 29, 2016, at 6:21 PM, Alex Harui <ah...@adobe.com> wrote:
>
>> We might want to do the same for Container.
>
Re: Subclassing js:List
Posted by Harbs <ha...@gmail.com>.
ContainerBase already implements IMXMLDocument.
That’s why I was assuming that any non-trivial components should do the same.
On Nov 29, 2016, at 6:21 PM, Alex Harui <ah...@adobe.com> wrote:
> We might want to do the same for Container.
Re: Subclassing js:List
Posted by Alex Harui <ah...@adobe.com>.
On 11/29/16, 6:52 AM, "Harbs" <ha...@gmail.com> wrote:
>I just tried making an mxml component based off js:List in FlexJS and it
>doesn’t seem to work.
>
>I get an error when the js code tries to execute:
>
>I searched the asjs files for this function and it looks like only
>components which implement IMXMLDocument have this function. List,
>ListBase and UIBase all do not seem to implement this. Is this an
>oversight, am I missing something, or what?
Because of pay-as-you-go, the controls do not carry the overhead of being
MXML base classes. Also, because we don't want the compiler to be tied to
a specific framework/lifecycle, we haven't taught Falcon to generate
FlexJS-specific code that could theoretically wrap any component and make
it MXML-capable. So for now at least, you will have to make MXML-capable
subclasses if you want to use controls as the top tag in an MXML file. We
might want to do the same for Container.
I think you can follow the example of MXMLBeadView (which extends
ContainerView which extends BeadViewBase).
-Alex