You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org> on 2005/06/22 21:07:17 UTC

[jira] Commented: (TAPESTRY-314) FieldLabel should generate a

    [ http://issues.apache.org/jira/browse/TAPESTRY-314?page=comments#action_12314252 ] 

Howard M. Lewis Ship commented on TAPESTRY-314:
-----------------------------------------------

The work just done, to pre-render form components, will come in handy for this.

I think that form components will need to include an optional id parameter.  They will have to use that id  as, or if not supplied, generate one using the form and/or request cycle. They will render the id attribute, and will expose an id property (seperate from the parameter!) that will remain readable until at least the end of the render.  This will allow the following:

1: FieldLabel pre-renders the TextField:

TextField:  <input type="text" name="name" id="unique-id" value="..."/>

2. FieldLabel reads the id, renders itself

<label for="unique-id">Display Name</label>

3. TextField renders from pre-render buffer.

Everything should then come together.

Problem is: what happens when the id is not unique?  For example, if a user puts an id in the HTML template and there's a loop?

> FieldLabel should generate a <label> element
> --------------------------------------------
>
>          Key: TAPESTRY-314
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-314
>      Project: Tapestry
>         Type: Improvement
>   Components: Framework
>     Versions: 4.0
>     Reporter: Howard M. Lewis Ship
>      Fix For: 4.0

>
> Currently, the FieldLabel component just outputs a string (and has hooks into the validation delegate).
> Ideally, it should generate a <label> element around the string.
> Support for informal paramater, specifically to support accesskey, would work.
> The problem is that the for attribute references a form element's id attribute, which is typically not set by Tapestry (TextField, ValidField, etc., set the name).
> To make this work we either need to generate unique ids for form control elements, or only generate the <label> if the element includes a "id" informal parameter.  Not sure which is the lesser evil.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org