You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by yishayw <yi...@hotmail.com> on 2016/08/07 09:06:57 UTC

[FlexJS] numElements and contentView

We have code that removes all elements in a container. It does something like 

while (container.numElements) {container.removeElementAt(0)}

The problem was that ContainerBase.removeElementAt(0) actually did
ContainerBase.contentView.removeElementAt(0) while container.numElements was
returning ContainerBase.numElements, not
ContainerBase.contentView.numElements.

I fixed that, but I was wondering if ContainerBase.$numElements should be
fixed as well. I'm not sure exactly what the $ methods do in ContainerBase.
Are they meant to insure the contentview is not used as a delegate?



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-numElements-and-contentView-tp54359.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] numElements and contentView

Posted by Jack Freudenheim <ja...@sounder.com>.
Hi Alex,

Can you please tell me how to unsubscribe?

Thanks,
Jack


On 8/8/16 12:55 AM, Alex Harui wrote:
>
> On 8/7/16, 2:06 AM, "yishayw" <yi...@hotmail.com> wrote:
>
>> We have code that removes all elements in a container. It does something
>> like
>>
>> while (container.numElements) {container.removeElementAt(0)}
>>
>> The problem was that ContainerBase.removeElementAt(0) actually did
>> ContainerBase.contentView.removeElementAt(0) while container.numElements
>> was
>> returning ContainerBase.numElements, not
>> ContainerBase.contentView.numElements.
>>
>> I fixed that, but I was wondering if ContainerBase.$numElements should be
>> fixed as well. I'm not sure exactly what the $ methods do in
>> ContainerBase.
>> Are they meant to insure the contentview is not used as a delegate?
> $numElements looks ok to me.  The $ functions are used by ContainerViews
> to add elements to the "chrome" of the container itself, since addElement
> otherwise adds it to the contentView.  Scrollbars, TitleBars and stuff
> like that get added by the ContainerViews outside of the contentView.
>
> Thanks for fixing the bug.
>
> -Alex
>


Re: [FlexJS] numElements and contentView

Posted by yishayw <yi...@hotmail.com>.
Got it. The fix is in the sprite-refactor branch.



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-numElements-and-contentView-tp54359p54379.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] numElements and contentView

Posted by Alex Harui <ah...@adobe.com>.

On 8/7/16, 2:06 AM, "yishayw" <yi...@hotmail.com> wrote:

>We have code that removes all elements in a container. It does something
>like 
>
>while (container.numElements) {container.removeElementAt(0)}
>
>The problem was that ContainerBase.removeElementAt(0) actually did
>ContainerBase.contentView.removeElementAt(0) while container.numElements
>was
>returning ContainerBase.numElements, not
>ContainerBase.contentView.numElements.
>
>I fixed that, but I was wondering if ContainerBase.$numElements should be
>fixed as well. I'm not sure exactly what the $ methods do in
>ContainerBase.
>Are they meant to insure the contentview is not used as a delegate?

$numElements looks ok to me.  The $ functions are used by ContainerViews
to add elements to the "chrome" of the container itself, since addElement
otherwise adds it to the contentView.  Scrollbars, TitleBars and stuff
like that get added by the ContainerViews outside of the contentView.

Thanks for fixing the bug.

-Alex