Re: RE: BSelect and <input> elements of type radio and checkbox?
Jacob Kjome <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Diez,
At 10:50 PM 6/18/2003 +0200, you wrote:
>Hi,
>
>maybe I'm missing something here - but actually everything you need is
>already
>there. Look at my form-repopulation-example. It should even be possible to
>either render a select or checkbox/radiobutton group, putting the decision to
>the designer.
Yes, using the IterativeModel along with BTemplate. My idea to use BSelect
would allow for list-type behavior with radio buttons and checkboxes in the
same way as select boxes work using only a single component and no helpers
such as BTemplate and IterativeModel. The logic is essentially the
same. But as Christian has pointed out, the details in rendering need to
be worked out and this may require a separate component that, maybe,
extends BSelect and provides behavior and features specific to <input>
elements of type radio and checkbox (such as adding labels or dealing with
other surrounding text).
>The only inconvenience is that for every list-driven component, you have to
>manually add the resulting child model to the BTemplate.
>
>I once thought of introducing an interface called ChildModelContainer
>(anybody
>a better name?).
>
>public interface ChildModelContainer {
>
> public List getChildModels();
>}
>
>If a BTemplate.addModel() encounters a ChildModelContainer implementing
>model,
>it recursively adds the child-models to itself.
>
>Then things should work perfecly.
I've used your idea's of child models in the past for my projects and they
seem to be a very necessary feature. I think this is a good idea and
shouldn't break existing code using BTemplate. I'd like to see more
information about it. Maybe you can add the functionality and modify your
existing contrib app to utilize this and show how it makes the code cleaner
and makes adding child models more convenient and standardized. We can
always pull it out if it doesn't seem to be the right thing to do.
I think we really need to concentrate on making the component model and
especially BTemplate as easy and flexible to use as other templating
models. The event model is, hands down, better than anything else I've
seen out there, but the component model can make it tough to do some
complex things. Whether this is just a matter of the learning curve or
real limitations in the component model is up for debate (and documentation).
Jake
>Diez
>
>_______________________________________________
>Barracuda mailing list
>[email protected]
>http://barracudamvc.org/lists/listinfo/barracuda