[ 
https://issues.apache.org/jira/browse/TAPESTRY-1395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12558465#action_12558465
 ] 

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

I just don't see this as having a lot of benefit.  I think the timing of the 
element and the name and id attributes is too finicky to encapsulate in a 
mixin; you may see that it's been done as a base class, which works better.

> Add mixin to render element name & id
> -------------------------------------
>
>                 Key: TAPESTRY-1395
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1395
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.4
>            Reporter: Ben Sommerville
>            Priority: Trivial
>
> Currently all field components have to render their name and id explicitly. 
> Since all field components need to do this it seems reasonable to add a mixin 
> to do it for them, similar to the RenderDisabled mixin.
> This moves the responsiblity for rendering element names and ids to one place 
> & reduce the code for component implementations.  It also means that derived 
> components don't have to worry about names/id in unit tests (which is tricky 
> since both those fields are read only)
> e.g.
> /**
>  * Renders a "name" and "id' attribute for the containing field.
>  */
> @MixinAfter
> public class RenderIdentifiers {
>     @InjectComponent
>     private Field _field;
>     void beginRender(MarkupWriter writer)
>     {
>           writer.attributes("name",field.getElementName()
>                                         "id", field.getClientId);
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to