You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Norman Franke <no...@myasd.com> on 2011/10/20 19:57:05 UTC

T5.2 Context Parameters and Lazy Initialization

I'm working on a simple confirm delete component that provides a  
context parameter. This should provide the parent page with the key of  
the object to delete. I'm using this component in a loop, so the  
context is "row.rowId". I'm having a few issues:

1. If I generate a "delete" event from a hidden t:eventlink, the event  
doesn't appear to propagate up to the page. I have an  
@OnEvent("delete") that matches the t:event="delete" of the  
t:eventlink. It never makes it.

2. If I trap the event in the component using the same method as in  
#1, that works, but not if I specify the ID of the event link.

3. If I get the event in the component as in #2, I want to send a new  
event that the parent page can then intercept. I use the  
ComponentResource.triggerEvent to do this, but my context is now null  
(since it pointed to "row.rowId".

How should this be handled? I'm using .tml to render the HTML, which  
I'd prefer rather than programmatically generating it.


Norman Franke
Answering Service for Directors, Inc.
www.myasd.com




Re: T5.2 Context Parameters and Lazy Initialization

Posted by Norman Franke <no...@myasd.com>.
Never mind, I think I got it. The issue was that I forgot to add  
t:context to the eventlink.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com



On Oct 20, 2011, at 1:57 PM, Norman Franke wrote:

> I'm working on a simple confirm delete component that provides a  
> context parameter. This should provide the parent page with the key  
> of the object to delete. I'm using this component in a loop, so the  
> context is "row.rowId". I'm having a few issues:
>
> 1. If I generate a "delete" event from a hidden t:eventlink, the  
> event doesn't appear to propagate up to the page. I have an  
> @OnEvent("delete") that matches the t:event="delete" of the  
> t:eventlink. It never makes it.
>
> 2. If I trap the event in the component using the same method as in  
> #1, that works, but not if I specify the ID of the event link.
>
> 3. If I get the event in the component as in #2, I want to send a  
> new event that the parent page can then intercept. I use the  
> ComponentResource.triggerEvent to do this, but my context is now  
> null (since it pointed to "row.rowId".
>
> How should this be handled? I'm using .tml to render the HTML, which  
> I'd prefer rather than programmatically generating it.
>
>
> Norman Franke
> Answering Service for Directors, Inc.
> www.myasd.com
>
>
>