On 7/22/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
> Since this topic is already a Friday topic, I don't feel bad going OT :)
> 
> On Fri, July 22, 2005 2:04 pm, Craig McClanahan said:
> >     <h:commandButton id="save" value="#{messages['save.button.label']}"
> >         action="#{mybean.save_action}" .../>
> 
> I noticed this last night watching a demonstration of Exadel Studio...
> Craig, why is it that the attribute of a button that defines what a user
> sees is "value" and not "label"?  I know it really *IS* the value
> underneath, but wouldn't it be clearer if the attribute was "label"?
> Especially in the case of using the <button> tag, which presumably will
> become more prevalent, where there actually is a distinction between what
> is visible to the user and what the value is (I don't know what
> <h:commandButton> renders by the way).

The standard (HTML centric) set of JSF components was deliberately
designed to use attribute names that are similar to (or identical to)
the HTML attributes that they correspond to.  The thinking was that
newcomers to JSF who were using these tags would appreciate that
familiarity.

A component not in the standard set can, of course, use whatever
attribute names it wants.  The component set that comes with Creator 2
EA, for example, uses "label" for the label of a Button :-).

> 
> I've noticed this with a lot of the Struts taglibs too... the attributes
> don't always describe what they really are.  This complaint has been
> leveled against struts-config definitions too, but I'm not going there :)
> 
> Just curious if there was some underlying logic to the attribute names I'm
> not seeing.
> 

Same basic issue, but even more so ... the Struts tags can *only* emit
HTML, so it made the most sense to use attribute names that
corresponded to what was actually getting emitted:

IN:     <html:button ... value="Save" .../>

OUT:    <input type="submit" value="Save" ...>


> Frank

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to