You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Sebastian Hennebrueder <us...@laliluna.de> on 2009/08/07 13:06:19 UTC
Possible render problem/bug
The following snippet in a page template leads to the exception
# java.lang.RuntimeException
Exception assembling root component of page Navigation: Exception
assembling embedded component 'link' (of type
org.apache.tapestry5.corelib.components.ActionLink, within Navigation):
Component Navigation already contains a child component with id 'link'.
Embedded component ids must be unique (excluding case, which is ignored).
But actually there won't be the same id rendered. Is it a bug?
<t:loop source="1..10" value="current">
<t:if test="luckyNumber">
<t:actionlink t:id="link"
context="current">${current}</t:actionlink>
is my lucky number -
<p:else>
<t:actionlink t:id="link"
context="current">${current}</t:actionlink>
-
</p:else>
</t:if>
</t:loop>
--
Best Regards / Viele Grüße
Sebastian Hennebrueder
-----
Software Developer and Trainer for Hibernate / Java Persistence
http://www.laliluna.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: Possible render problem/bug
Posted by Henning Petersen <he...@daenen4.de>.
I usually put the component inside a block and use it in both locations:
<t:if ...>
...
<t:delegate t:to="linkBlock">
<p:else>
...
<t:delegate t:to="linkBlock">
</p:else>
</t:if>
<t:block t:id="linkBlock">
<a t:type="ActionLink" t:id="link">Foo</a>
</t:block>
While the markup looks slightly messier, this saves you from having two
event handlers for the same thing.
Cheers
Henning
-----Original Message-----
From: Thiago H. de Paula Figueiredo [mailto:thiagohp@gmail.com]
Sent: Friday, August 07, 2009 3:50 PM
To: Tapestry users
Subject: Re: Possible render problem/bug
Em Fri, 07 Aug 2009 10:47:29 -0300, Sebastian Hennebrueder
<us...@laliluna.de> escreveu:
> I found this work around as well but this would require a second event
> listener method.
You can use @OnEvent("action") in that case.
> But I suppose that the ids need to be unique on the Tapestry component
> tree, so the fact that the id is unique on the rendered result is not
> relevant.
Absolutely right.
> As a consequence, I will need the second event listener (not really a
> problem)
Not quite. :)
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Possible render problem/bug
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Fri, 07 Aug 2009 10:47:29 -0300, Sebastian Hennebrueder
<us...@laliluna.de> escreveu:
> I found this work around as well but this would require a second event
> listener method.
You can use @OnEvent("action") in that case.
> But I suppose that the ids need to be unique on the Tapestry component
> tree, so the fact that the id is unique on the rendered result is not
> relevant.
Absolutely right.
> As a consequence, I will need the second event listener (not really a
> problem)
Not quite. :)
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Possible render problem/bug
Posted by Sebastian Hennebrueder <us...@laliluna.de>.
I found this work around as well but this would require a second event
listener method.
But I suppose that the ids need to be unique on the Tapestry component
tree, so the fact that the id is unique on the rendered result is not
relevant. As a consequence, I will need the second event listener (not
really a problem)
But anyway, thank you for the feedback.
Joshua Martin schrieb:
> Yes, rename one to link1 and the other to link2
>
>
> On Fri, Aug 7, 2009 at 8:30 AM, Howard Lewis Ship<hl...@gmail.com> wrote:
>> You have t:id="link" on two different components. That is not allowed.
>>
>> On Fri, Aug 7, 2009 at 4:06 AM, Sebastian
>> Hennebrueder<us...@laliluna.de> wrote:
>>> The following snippet in a page template leads to the exception
>>>
>>> # java.lang.RuntimeException
>>> Exception assembling root component of page Navigation: Exception assembling
>>> embedded component 'link' (of type
>>> org.apache.tapestry5.corelib.components.ActionLink, within Navigation):
>>> Component Navigation already contains a child component with id 'link'.
>>> Embedded component ids must be unique (excluding case, which is ignored).
>>>
>>> But actually there won't be the same id rendered. Is it a bug?
>>>
>>> <t:loop source="1..10" value="current">
>>> <t:if test="luckyNumber">
>>> <t:actionlink t:id="link" context="current">${current}</t:actionlink>
>>> is my lucky number -
>>> <p:else>
>>> <t:actionlink t:id="link"
>>> context="current">${current}</t:actionlink>
>>> -
>>> </p:else>
>>> </t:if>
>>>
>>>
>>> </t:loop>
>>>
>>> --
>>> Best Regards / Viele Grüße
>>>
>>> Sebastian Hennebrueder
>>> -----
>>> Software Developer and Trainer for Hibernate / Java Persistence
>>> http://www.laliluna.de
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>> --
>> Howard M. Lewis Ship
>>
>> Creator of Apache Tapestry
>> Director of Open Source Technology at Formos
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
>
--
Best Regards / Viele Grüße
Sebastian Hennebrueder
-----
Software Developer and Trainer for Hibernate / Java Persistence
http://www.laliluna.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Possible render problem/bug
Posted by Joshua Martin <jo...@gmail.com>.
Yes, rename one to link1 and the other to link2
On Fri, Aug 7, 2009 at 8:30 AM, Howard Lewis Ship<hl...@gmail.com> wrote:
> You have t:id="link" on two different components. That is not allowed.
>
> On Fri, Aug 7, 2009 at 4:06 AM, Sebastian
> Hennebrueder<us...@laliluna.de> wrote:
>> The following snippet in a page template leads to the exception
>>
>> # java.lang.RuntimeException
>> Exception assembling root component of page Navigation: Exception assembling
>> embedded component 'link' (of type
>> org.apache.tapestry5.corelib.components.ActionLink, within Navigation):
>> Component Navigation already contains a child component with id 'link'.
>> Embedded component ids must be unique (excluding case, which is ignored).
>>
>> But actually there won't be the same id rendered. Is it a bug?
>>
>> <t:loop source="1..10" value="current">
>> <t:if test="luckyNumber">
>> <t:actionlink t:id="link" context="current">${current}</t:actionlink>
>> is my lucky number -
>> <p:else>
>> <t:actionlink t:id="link"
>> context="current">${current}</t:actionlink>
>> -
>> </p:else>
>> </t:if>
>>
>>
>> </t:loop>
>>
>> --
>> Best Regards / Viele Grüße
>>
>> Sebastian Hennebrueder
>> -----
>> Software Developer and Trainer for Hibernate / Java Persistence
>> http://www.laliluna.de
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
> Director of Open Source Technology at Formos
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
_________________________________
Joshua S. Martin
CONFIDENTIALITY NOTE: This e-mail message, including any
attachment(s), contains information that may be confidential,
protected by the attorney client or other legal privileges, and or
proprietary non public information. If you are not an intended
recipient of this message or an authorized assistant to an intended
recipient, please notify the sender by replying to this message and
then delete it from your system. Use, dissemination, distribution, or
reproduction of this message and or any of its attachments (if any) by
unintended recipients is not authorized and may be unlawful.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Possible render problem/bug
Posted by Howard Lewis Ship <hl...@gmail.com>.
You have t:id="link" on two different components. That is not allowed.
On Fri, Aug 7, 2009 at 4:06 AM, Sebastian
Hennebrueder<us...@laliluna.de> wrote:
> The following snippet in a page template leads to the exception
>
> # java.lang.RuntimeException
> Exception assembling root component of page Navigation: Exception assembling
> embedded component 'link' (of type
> org.apache.tapestry5.corelib.components.ActionLink, within Navigation):
> Component Navigation already contains a child component with id 'link'.
> Embedded component ids must be unique (excluding case, which is ignored).
>
> But actually there won't be the same id rendered. Is it a bug?
>
> <t:loop source="1..10" value="current">
> <t:if test="luckyNumber">
> <t:actionlink t:id="link" context="current">${current}</t:actionlink>
> is my lucky number -
> <p:else>
> <t:actionlink t:id="link"
> context="current">${current}</t:actionlink>
> -
> </p:else>
> </t:if>
>
>
> </t:loop>
>
> --
> Best Regards / Viele Grüße
>
> Sebastian Hennebrueder
> -----
> Software Developer and Trainer for Hibernate / Java Persistence
> http://www.laliluna.de
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Howard M. Lewis Ship
Creator of Apache Tapestry
Director of Open Source Technology at Formos
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org