>>
>> Agreed, but I can’t think of a way to do this.
>
> One way is to have assignable removeElement logic.
Meaning an assignable Function property, or something else?
> Another is to have a bead that overwrites UIBase.prototype.removeElement.
> What won't work on SWF but will on JS.
Interesting. Probably worth looking into.
>>
>> I’m trying to keep this really simple. ButtonBar extends List which
>> requires dataProviders, ItemRendererers, etc. My approach is to allow
>> adding any component which has a selected property to any container. The
>> bead will handle correcting the selection of the unselected elements. I
>> want to enable the following mxml:
>>
>> <js:HContainer>
>> <js:beads>
>> <js:SingleSelectionContainerBead/>
>> </js:beads>
>> <js:ToggleTextButton text="Fee"/>
>> <js:ToggleTextButton text="Fi"/>
>> <js:ToggleTextButton text="Fo"/>
>> <js:ToggleTextButton text="Fum"/>
>> </js:HContainer>
>>
>> Those ToggleTextButtons could be RadioButtons, Checkboxes, etc.
>
> We should make sure it works, but I would expect issues around focus,
> keyboard selection and accessibility. And also, how it upgrades to being
> able to load the text labels from resources or a server and add or remove
> buttons.
I’m not sure I understand why you think these are issues. The components should
be pretty much self contained. I guess I’ll see.
> This sort of thing makes me wonder if there is some other item renderer
> contract we should be offering instead. IIRC, right now, the contract
> dictates that the renderer must have a "data" property. Maybe if there
> was a contract where we could dictate the property to set you could just
> drop in an existing component as a renderer. There was a similar thing in
> Flex. It was a bit heavy, but maybe folks don't care.
>
> Way back I pointed out that all components should be able to be expressed
> as a UIBase or ContainerBase/GroupBase with a collection of beads. It
> would be interesting to see what the other List beads expect. Right now a
> factory watches a dataProvider and generates an item renderer for each
> dataProvider item. Hopefully the other beads don't care how the item
> renderers appeared and can be repurposed to your pattern. IOW, either you
> specify a factory and an item renderer and a dataProvider or you supply a
> set of children, but everything else should work.
I’m not sure if I’m following you here. My understanding was that the only way
to specify the children of a list is to provide a dataProvider. It seems like
you are saying that it should technically be possible to add the children
directly. For kicks I just tried the following to see and it did not work at
all (i.e. nothing was added to the button bar):
<js:ButtonBar>
<js:ToggleTextButton text="Fee"/>
<js:ToggleTextButton text="Fi"/>
<js:ToggleTextButton text="Fo"/>
<js:ToggleTextButton text="Fum"/>
</js:ButtonBar>
I’m guessing that you are suggesting a factory could be added with conditional
logic.
Harbs