Re: RE: BSelect and <input> elements of type radio and checkbox?

"Diez B. Roggisch" <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
Hi,

> 
> 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).

Hmm. I personally think that except from a very basic layout style, you 
won't come far here. To me, this looks like BTable and what some folks 
wanted to do with it - make it a general purpose table renderer for 
different layouts and stuff, fetching information from the bound dom. 
Never heard of that again.

This will effectively duplicate the behaviour of BTemplate. You'll end 
up having specially marked nodes to put your text into. And you can 
never come up with so much configurability as webdesigners come up with 
crazy ideas how the want things layouted.


> 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.

Ok, I'll do it.

> 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).

 From what I have seen so far, I personally think barracudas BTemplate 
is a very powerful and flexible mechanism. I currently have to work with 
struts, and I have to say that they don't offer anything similar to 
BTEmplate. The only thing I would like to see is a small 
expression-language inside of Template-directives that could calculate 
and filter some values. I think of stuff like this (BEL is 
"BarracudaExpressionLanguage"):

<div class="Dir::BEL-{size('searchResultModel') > 0}">
   <!-- render the results -->
   <table>...

   </table>
</div>
<div class="Dir::BEL-{size('searchResultModel') == 0}">
   <!-- render the "No results message"-->
   Sorry pal, nothing found.
</div>

This would eliminate the need of some purely layout-driven template 
model items.

And resource-bundle based localization as immediate support in BText 
could be a nice idea.

I agree of course that the lack of documentation _is_ a problem.

Regards,

Diez
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.