Hi Harbs,

When nested components is instantiated with default bead X, and after
instantiation has been added new instance of Bead Y - Both Beads will apply
logic to that components.

Example - Component has HorizontalLayout (declared in CSS) - I'm adding
VerticalLayout by addBead and both are applied - in the results you have
messed layout.

Piotr

On Sun, Jan 27, 2019, 1:13 PM Harbs <[email protected] wrote:

> I don’t understand the situation.
>
> Why is nested components an issue?
>
> > On Jan 27, 2019, at 1:26 PM, Piotr Zarzycki <[email protected]>
> wrote:
> >
> > Hi Yishay,
> >
> > Your example is showing how to avoid it, but user probably won't null
> > anything in css. That's the situation. As for the scenario - Let's say
> that
> > you have component which has inside of View instantiation of another
> > component. Situation looks like that:
> >
> > <div> - first component with bead X
> >    <div></div> - second component with bead X, who have bead Y of the
> same
> > type as bead X.
> > </div>
> >
> > In that situation dynamically instantiated component 2 will take bead X
> and
> > we will end up with above situation. Does that valid scenario for you?
> >
> > Thanks,
> > Piotr
> >
> > On Sun, Jan 27, 2019, 10:19 AM Yishay Weiss <[email protected]
> wrote:
> >
> >> Can you explain why this is necessary? Why create a strand with bead X
> and
> >> replace it with bead Y in runtime?
> >>
> >> If your strand is using loadBeadFromValuesManager() it should be able to
> >> receive a null css class reference, like in this example.
> >>
> >> https://github.com/yishayw/Examples/tree/RunTimeLayout
> >>
> >>
> >> From: Carlos Rovira<mailto:[email protected]>
> >> Sent: Sunday, January 27, 2019 10:26 AM
> >> To: [email protected]<mailto:[email protected]>
> >> Subject: Problems dealing with bead substitution in Royale
> >>
> >> Hi,
> >>
> >> Piotr and I found a situation where we don't know how to solve with some
> >> generalist solution. Hope others here could give some ideas.
> >>
> >> The setup: We have a layout bead that decorates the strand with a css
> class
> >> selector. The bead is configured in CSS as a default bead
> >>
> >> The problem: We found that adding another layout bead at runtime that
> >> "substitute" the default bead and adds other CSS class selector, left
> the
> >> selector(s) from the old layout bead untouched.
> >>
> >> Notice that adding the new layout bead in MXML through beads array is
> ok,
> >> since (I think) default bead is never instantiated and the second one is
> >> the only one running its code. The problem happens if we try to do the
> >> change at runtime at a later time.
> >>
> >> So, our question is: How to deal with beads that are already
> instantiated
> >> and needs to be removed. How we should operate with it? Should be have
> some
> >> removal mechanism in Royale to do this?
> >>
> >> For more info and code about this issue, Piotr shared some source code
> in
> >> other recent thread about Jewel Group.
> >>
> >> Thanks
> >>
> >> --
> >> Carlos Rovira
> >> http://about.me/carlosrovira
> >>
> >>
>
>

Reply via email to