It is supposed to work like this: A: You may have zero or more beads defined inline in MXML for your component using <js:beads> property.
B: You may have zero or more beads defined in CSS for your component. When addElement is called on your component, it will add the underlying element to the display list and then call addedToParent() on the component and process the inline beads first (situation A). Once the inline beads are added (and their strand setters are called), the "standard" set of beads may be added: model, view, and controller. This done by first seeing if one is already on the beads list (e.g. added inline). If it is not present, then the CSS (situation B) is examined using ValuesManager. If a bead class is found, it is instantiated and then added to the strand's beads list (the bead's strand setter is called). When the "standard" beads have been added, addedToParent() finished by dispatching "beadsAdded" on the strand. C: Any beads in CSS that are non-standard are not automatically added. If your component class overrides addedToParent() it should call super.addedToParent() right away to load the inline and standard beads. After calling super.addedToParent(), your component can then load custom beads (e.g., a date formatter) by following the same pattern addedToParent() follows: Using an interface type, does the bead already exist on the strand (added inline)? If not, is there a class for it in CSS via ValuesManager? If so, create a new instance and add it to the bead list. The reason for this sequence is to allow inline beads to override default beads (default beads being added in addedToParent()). So if your component loads the ABCBead in its addedToParent() override, I can use your component and put in my custom DEFBead which either extends ABCBead or implements IMyCustomBead interface (which ABCBead should also implement). This bead will be loaded early (in super.addedToParent()) and will not get replaced by the default later. Since "beadsAdded" was already dispatched, your component might want to either dispatch "initComplete" or some custom event. Note that the container classes (GroupBase/Group, ContainerBase/Container, etc.) all dispatch "initComplete" so if your basing your component on a container type, you don't have to dispatch "initComplete" but you can dispatch a custom event. I hope that helps. ‹peter On 4/18/17, 4:41 AM, "jus...@classsoftware.com" <jus...@classsoftware.com> wrote: >Hi, > >> It looks to related to a bug in getBeadByType. > >And the reason for that is the addBead call to add DateFormatDDMMYYYYBead >is called after DateField addedToParent is called Or if you prefer at the >time addedToParent is called the beads have not been added so it will add >the one defined in the CSS. Only the first iFormat bead will have an >effect. > >Thanks, >Justin