All of the implementations I can think of add just-in-case code to check
for a CSS property and/or check for an array.  I suppose you could write
some code that watches for changes to the DOM and adds a bead as things
get added to the DOM.

In your specific example, you want to customize layout and you can already
do that in CSS.

My 2 cents,
-Alex

On 8/7/17, 2:14 PM, "Harbs" <harbs.li...@gmail.com> wrote:

>Yeah. But we really should have a way to declare beads that are injected.
>
>Since we are already using CSS files to declare beads of specific types,
>maybe we can abuse CSS a bit more and allow declaring an array of beads
>there?
>
>Either way, I think the code which delays layout of hidden elements blows
>up layout in subtle ways. I’m reverting that for now. Sometime when I
>have the cycles maybe I’ll look at this again.
>
>> On Aug 8, 2017, at 12:08 AM, Alex Harui <aha...@adobe.com.INVALID>
>>wrote:
>> 
>> I hear you, but IMO, that's PAYG.  Otherwise we would keep adding little
>> bits of "just-in-case" code and end up with the same problems as regular
>> Flex.
>> 
>> UIBase knows to look for a model, view and controller.
>> Container also looks for Layout.
>> 
>> We don't want just-in-case code looking for other things.  It would be
>> great to find a way to use composition to inject another bead.  I
>>suppose
>> you could write a custom View that automatically adds the bead you want.
>> Or you can replace the layout with layouts that know how to not layout
>> when not visible or wrap layouts with code that does a visible check.
>> IMO, this last bit is the actual implementation you should choose.
>> 
>> My 2 cents,
>> -Alex
>> 
>> On 8/7/17, 2:01 PM, "Harbs" <harbs.li...@gmail.com> wrote:
>> 
>>> I actually just tried that, and it all blew up. I'll probably figure
>>>out
>>> why soon...
>>> 
>>> It feels broken that I have to create my own Container just to get
>>>layout
>>> to happen when it becomes visible.
>>> 
>>>> On Aug 7, 2017, at 11:55 PM, Alex Harui <aha...@adobe.com.INVALID>
>>>> wrote:
>>>> 
>>>> IMO, you should create a different Container (probably a cheap
>>>>subclass
>>>> of
>>>> Container) and apply the bead in the constructor or fetch it from CSS
>>>>in
>>>> addedtoParent().
>>>> 
>>>> -Alex
>>>> 
>>>> 
>>>> On 8/7/17, 1:12 PM, "Harbs" <harbs.li...@gmail.com> wrote:
>>>> 
>>>>> I would like to apply a bead (LayoutOnShow) to every Container in my
>>>>> app.
>>>>> I know I can subclass Container and add the bead using AS (or mxml),
>>>>> but
>>>>> I’d like to keep my mxml markup and just inject the bead. I think I
>>>>> want
>>>>> to use CSS to do that, but I cannot figure out how to specify a bead
>>>>> which is not one of the accepted interfaces in CSS.
>>>>> 
>>>>> Is there something I’m missing? Ideas on how to accomplish this?
>>>>> 
>>>>> Harbs
>>>> 
>>> 
>> 
>

Reply via email to