On 10/17/07, Mohammad Shamsi <[EMAIL PROTECTED]> wrote:
>
> Label component in T5, just have a parameter named "for".
> Tapestry use this value with some changes as a label text.
> this value also used for validation messages.
> but :
> 1 - for example my textfield component id is "item.firstName".  then it's
> label is :    item.first Name    :(  not good label
> 2 - in multi language pages, labels most change to selected language.
>

The label component goes hand in hand with the 'label' attribute of
the target element.  So for example, if you have a label and textfield
it would look like:
<t:label for="myTextField" />
<t:textfield t:id="myTextField" label="my funky label" />
The literal value from the label attribute will be placed in the body
of the <label> element.

Also, you can achieve localization (and cleanliness:) using a message catalog[1]

>From the component reference for the (e.g.) textfield component, label
attribute[2]:
"The user presentable label for the field. If not provided, a
reasonable label is generated from the component's id, first by
looking for a message key named "id-label" (substituting the
component's actual id), then by converting the actual id to a
presentable string (for example, "userId" to "User Id")"

[1] http://tapestry.apache.org/tapestry5/tapestry-core/guide/localization.html
[2] 
http://tapestry.apache.org/tapestry5/tapestry-core/component-parameters.html#orgapachetapestrycorelibcomponentstextfield

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

Reply via email to