This is eerily similar to my <custom:label key="..."/> tag which generates field labels, along with an asterisk if its a required field and a different style (currently red) if the field is in error.

This will be part of the app I post up this week too.

Erik


Matt Raible wrote:
I agree, and does require more work, considering:

<html:label for="name">
<bean:message key="prompt.username"/>
</html:label>

Is more typing than:

<label for="name">
...
</label>

Maybe something like this would make it more useful:

<html:label key="prompt.username" />

I was thinking of reducing the prefixes in my struts-xdoclet app from:

html -> h
logic -> l
bean -> b
tiles -> t
nested -> n

Would this create too much confusion (even though it would require less
typing?)?
It much rather type <h:label key="prompt.username" />

Matt


-----Original Message-----
From: David Graham [mailto:[EMAIL PROTECTED]] Sent: Monday, November 25, 2002 12:25 PM
To: [EMAIL PROTECTED]
Subject: Re: Enhancement Request - add label and labelKey to form elements


I don't see what advantage the <html:label> tag has over hand coding the html. Looks like the same amount of work to me.

David







From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
Reply-To: "Struts Developers List" <[EMAIL PROTECTED]>
To: Struts Developers List <[EMAIL PROTECTED]>
Subject: Re: Enhancement Request - add label and labelKey to form elements
Date: Mon, 25 Nov 2002 11:14:10 -0800 (PST)

On Mon, 25 Nov 2002, Matt Raible wrote:


Date: Mon, 25 Nov 2002 11:10:33 -0700
From: Matt Raible <[EMAIL PROTECTED]>
Reply-To: Struts Developers List <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Enhancement Request - add label and labelKey to form elements

I thought I'd run this idea by the development team

before entering
it into Bugzilla.

One of the items that is required with 508 compliance is

a <label>
value for each form element:

For example:

<label for="name">Name:</label>
<input type="text" id="name" size="50" name="name" />

More information at: http://www.csuohio.edu/uctl/508/forms.html

This would typically be rendered with Struts tags using:

<label for="name">Name:</label>
<html:text name="name" styleId="name" size="50"/>

To make it easier, we could do:

<html:text name="name" styleId="name" size="50"

label="Name:"/> OR
<html:text name="name" styleId="name" size="50" labelKey="prompt.name"/>

The problems I see with this are that you lose some

control over the
presentation (i.e. a <br /> after the label or labels in

a separate
<td>). However, it might be useful for rapid prototyping and code-generating tools. My hope someday is that the JSP simply renders XML, and then an XSL stylesheet is applied, and in this case, the presentation issues would disappear?

What does everyone think? Would anyone use it?

I think a way to create <label> elements would be very
useful. I just
don't think we should embed it in the existing UI element
tags (for the
reasons that others have articulated.

How about a new <html:label> tag instead. Then, you could do things like this on the logon page in struts-example:

...
<tr>
<th align="right">
<html:label for="name">
<bean:message key="prompt.username"/>
</html:label>
</th>
<td align="left">
<html:text styleId="name" property="username" size="16"
maxlength="18"/>
</td>
</tr>
...

(I thought you tied labels to elements with the "id" ???)

The above approach assumes that it's not necessary to localize the element id itself (which would really complicate attempts to
generate
JavaScript event handlers), but you do (of course) need to
localize the
text of the label.

This also imposes no restrictions on the mechanisms by which
you manage
layout, and can be easily retrofitted onto existing pages.


Thanks,

Matt

Craig


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

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail: <mailto:struts-dev-> [EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



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




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

Reply via email to