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]> |
At 03:45 PM 6/18/2003 -0600, you wrote: >Yeah, I DO agree with you here...there's nothing wrong with components >behaving differently depending on what they're bound too...that's kind of >the whole purpose. I'm not at all opposed to making BSelect work this way >for these components (provided it doesn't break anything, and from the looks >of it, it won't). Yep, although you bring up some interesting points below... >One thing that is still not clear to me is how you would handle the labels >that would need to go along with each checkbox? In the examples above, you >show only <input> components, but in reality, you'd need a way to set some >kind of label with each one of those, and at that point I think BSelect may >run out of steam... To tell you the truth, I hadn't actually thought that far along. Adding logic to BSelect to do this might be kind of messy as you've pointed out. Hmmm... >you might be able to use the key portion of ItemMap for >the text, and the value for the value, but how are you going to identify >what portion of the template is "label"? And how do you determine whether it >comes before or after the input component? And what if there's other >"non-label" text scattered in there as well? Just seems like there are a lot >of non-obvious technical details that would have to be ironed out. > >In the end, it might make more sense to create an entirely different >component that isn't quite as low-level as either BSelect or >BToggleButton... Maybe a component that extends BSelect? BToggleButton is specifically not for list behavior (at least not any individual BToggleButton) where BSelect (or anything extending BSelect) is. I'll have to think about this. I haven't spent much time in the component model other than fixing basic stuff like null pointer exceptions so I'll have to take a look at what it would take to implement this. Might be a little bit, but I think it would be worth doing since it would allow for list-type behavior with radio buttons and checkboxes without resorting to a BTemplate-based IterativeModel (not that BTemplate and the IterativeModel are bad, but options are always good). >INteresting discussion... :-) Agreed. Jake