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 2008/08/08 20:39:44 UTC
[jira] Assigned: (TAPESTRY-2546) Duplicate client id generation in
"Any" component
[ https://issues.apache.org/jira/browse/TAPESTRY-2546?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship reassigned TAPESTRY-2546:
----------------------------------------------
Assignee: Howard M. Lewis Ship
> Duplicate client id generation in "Any" component
> -------------------------------------------------
>
> Key: TAPESTRY-2546
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2546
> Project: Tapestry
> Issue Type: Bug
> Components: Core Components
> Affects Versions: 5.0.13
> Reporter: Aleksey Baranyuk
> Assignee: Howard M. Lewis Ship
> Attachments: Any.java.patch
>
>
> Hello! I've found a problem in component "Any". If I use "Any" component in different components i get duplicate client id. For example, I have component "Header". And I use "Any" in tml like:
> <div t:type="any" t:mixins="myMixin1">
> some content
> <div>
> And I have a component "Dashboard". It contains "Header" and uses "Any" component like:
> <div t:type="any" t:mixins="myMixin2">
> some content
> <div>
> <div t:type="any" t:mixins="myMixin2">
> some content
> <div>
> <div t:type="any" t:mixins="myMixin2">
> some content
> <div>
> Mixins are like this:
> @InjectContainer
> private ClientElement element;
> ...
> String id=element.getClientId();
> This id is realy inique, but generated Ids for div element in "Any" component are duplicate. I have output html like this:
> <div id="any">
> </div>
> <div id="any">
> </div>
> <div id="any_0">
> </div>
> <div id="any_1">
> </div>
> I've found how "Any" component generated id for div element. And i think the solution is:
> Index: tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Any.java
> ===================================================================
> --- tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Any.java (revision 681375)
> +++ tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Any.java (working copy)
> @@ -72,7 +72,7 @@
> if (uniqueId == null)
> {
> uniqueId = renderSupport.allocateClientId(clientId);
> - anyElement.forceAttributes("id", clientId);
> + anyElement.forceAttributes("id", uniqueId);
> }
>
> return uniqueId;
--
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