You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Aleksey Baranyuk (JIRA)" <de...@tapestry.apache.org> on 2008/08/01 08:46:31 UTC

[jira] Updated: (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 ]

Aleksey Baranyuk updated TAPESTRY-2546:
---------------------------------------

    Attachment: Any.java.patch

this is patch I have generated by svn

> 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
>         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