Hi Andrew,

El vie., 28 dic. 2018 a las 14:07, Andrew Wetmore (<cottag...@gmail.com>)
escribió:

>
> 1. There are three ways of adding beads to a component: baked in using
> <js:beads>, through CSS, and dynamically using addBead(). Which method is
> best to use for what purposes?
>

Don't think one is better than other, adding a bead to the array of beads
should be best for users that want a concrete behavior in the current
component instance, so usually this will be done for a "special case".
CSS could be a more generalist behavior so all instance of the same
component will use the same beads.
And addBead is more programatic approach (while the first one is more
declarative through MXML).

Of course, all of this is dependent on the use case since you can create an
MXML with an instance that uses concrete beads in Js:beads, and then reuse
it over all application, and in the same way, you can create a concrete css
selector that define a bead and use it in just one instance of the
component.



> 1a. I can see from the wiki clear examples for two methods of adding beads.
> Can someone point to an example using CSS to add a bead to a component?
>

For example item renderers in Jewel:

https://royale.apache.org/tourdejewel/#

in List example search for : className="iconListItemRenderer"

then check CSS:


https://github.com/apache/royale-asjs/blob/develop/examples/royale/TourDeJewel/src/main/resources/jewel-example-styles.css

and search for :

.iconListItemRenderer
{
IItemRenderer: ClassReference("itemRenderers.IconListItemRenderer");
}



> 2. Is the order of beads on a strand significant?
>
>
good question, maybe this should be answered by other.

I think usually not if each bead is an isolated funcionality. But maybe you
can think on some bead that requiere other beads, in that case, I suppose
the bead that require the other one should ensure to get its own code.


> 3. How much should I worry about bead cleanup when a bead is no longer
> actively used? I presume this would relate to dynamically-added beads, not
> the <js:beads> or CSS ones.
>

don't think you need to remove a bead as a listener. But would like to read
Alex's response and see if removing a UIBase component will loop through
the beads and make a removal before remove the component itself.


>
> 4. Where do I find the existing beads? Is there a curated list for each
> release of Royale?


No, and I think this could be a great addition to documentation. If you
could create this list, I think it will be very valuable. Maybe you could
improve asdocs in each bead that could be needed (not all, but I think some
of the beads doesn't have a minimum doc of what we should expect to do)


> How do I know which ones would be useful for a text
> entry field, a list, a button?
>

In Jewel, the beads are organized in packages and controls. I tried to keep
organized while developing. So for Jewel that should be easy to do that
work. In Basic there's no such organization and all is in the same package.
We talked about do some package organization before 1.0.

Thanks to you to work on this :)


> Thanks!
>
> a
>
>
> [1]
>
> https://apache.github.io/royale-docs/Welcome/Features/Strands%20and%20Beads.html
> [2]
> https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=71013028
> [3] https://cwiki.apache.org/confluence/display/FLEX/Creating+Components
>
> --
> Andrew Wetmore
>
> http://cottage14.blogspot.com/
>


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

Reply via email to