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)" <de...@tapestry.apache.org> on 2007/10/14 00:19:50 UTC
[jira] Commented: (TAPESTRY-1395) Add mixin to render element name
& id
[ https://issues.apache.org/jira/browse/TAPESTRY-1395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534573 ]
Howard M. Lewis Ship commented on TAPESTRY-1395:
------------------------------------------------
Note: @InjectComponent has been renamed to @InjectContainer. The container of a mixin the component it is attached to.
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org