You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Jim McCollom <ji...@evercare.dk> on 2005/01/18 13:06:32 UTC
Generic Label Feature Request
I was wondering why FieldLabel is only implemented using the ValidField
component ?? I have only been playing with Tapestry for about 4 weeks,
but it seems having a simple Label parameter for all the components
would allow for a more consistent page definition. For example takea
simple form that accepts a name and an email, and assume email is an
optional field.
example.page:
<component id="inputName" type="ValidField">
<static-binding name="displayName" value="Name"/>
<binding name="validator" expression="beans.required"/>
<binding name="value" expression="name"></binding>
</component>
<component id="inputEmail" type="TextField">
<binding name="value" expression="email"></binding>
</component>
and example.html would then look something like this:
<tr>
<th><span jwcid="@FieldLabel"
field="ognl:components.inputFirstName"/></th>
<td><input type="text" jwcid="inputFirstName"/></td>
</tr>
<tr>
<th> Email </th>
<td><input type="text" jwcid="inputEmail"/></td>
</tr>
Which leads to some what of a cluttered interface definition because I
declare one of my field labels in the xml page file(the Name label) and
another in the html file (the Email Label). Wouldn't adding a generic
displayName parameter to all the components display components that way
you keep all your field label definitions in one spot instead of
spreading them across the application.
Jim McCollom
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: Generic Label Feature Request
Posted by Howard Lewis Ship <hl...@gmail.com>.
FieldLabel actually does work with any form element (all the form
element components implement IFieldComponent) ... however, only
ValidField implements a displayName parameter, needed by FieldLabel to
know what to display.
On Tue, 18 Jan 2005 13:06:32 +0100, Jim McCollom <ji...@evercare.dk> wrote:
> I was wondering why FieldLabel is only implemented using the ValidField
> component ?? I have only been playing with Tapestry for about 4 weeks,
> but it seems having a simple Label parameter for all the components
> would allow for a more consistent page definition. For example takea
> simple form that accepts a name and an email, and assume email is an
> optional field.
>
> example.page:
>
> <component id="inputName" type="ValidField">
> <static-binding name="displayName" value="Name"/>
> <binding name="validator" expression="beans.required"/>
> <binding name="value" expression="name"></binding>
> </component>
> <component id="inputEmail" type="TextField">
> <binding name="value" expression="email"></binding>
> </component>
>
> and example.html would then look something like this:
>
> <tr>
> <th><span jwcid="@FieldLabel"
> field="ognl:components.inputFirstName"/></th>
> <td><input type="text" jwcid="inputFirstName"/></td>
> </tr>
> <tr>
> <th> Email </th>
> <td><input type="text" jwcid="inputEmail"/></td>
> </tr>
>
> Which leads to some what of a cluttered interface definition because I
> declare one of my field labels in the xml page file(the Name label) and
> another in the html file (the Email Label). Wouldn't adding a generic
> displayName parameter to all the components display components that way
> you keep all your field label definitions in one spot instead of
> spreading them across the application.
>
> Jim McCollom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>
--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
Professional Tapestry training, mentoring, support
and project work. http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org