Thank you Howard for the clear response. Of course it works well now.

I was a bit surprised that it doesn't worked because I had already done
this kind of event propagation for a method named "onSuccess()". But I
believed it worked because I had not specified the name of the component.

On Tue, 16 Mar 2010 15:24:46 -0700, Howard Lewis Ship <hls...@gmail.com>
wrote:
> Because the "action" event was not caught by it's immediate container
> (the Layout component), it propagated up with a new origin: the Layout
> component itself.  so onActionFromLayout() would work (because the id
> 'layout' will have been autoassigned by Tapestry).
> 
> The concept here is that the Layout component should limit how much of
> its internal structure is exposed to the outside world: it should
> ideally be a black box.
> 
> Often, a component will capture "action" events from one or more
> components and trigger new events with names customized to what the
> component does; here is might trigger an "edit" event, and you would
> name your method onEditFromLayout().
> 
> 
> 
> On Tue, Mar 16, 2010 at 2:57 PM, Nicolas Bouillon <nico...@bouil.org>
> wrote:
>> Hi,
>>
>> I have a simple problem. I use a component as a layout, and i want to
>> have
>> an action link that will be handled by the page that use the layout. I
>> believed that the event from actionLink goes from the Layout Component
to
>> my
>> page containing the component (here it is Index)
>>
>> Here is the source excerpt :
>>
>> Index.tml :
>> <html t:type="layout" p:title="title">
>>   ....
>> </html>
>>
>> Layout.tml
>> ....
>>   <t:actionlink t:id="edit">Edit</t:actionlink>
>> ...
>> <div id="content">
>>               <h2>${title}</h2>
>>               <t:body />
>> </div>
>> ....
>>
>> Index.java
>>
>>   @OnEvent(component = "edit", value = EventConstants.ACTION)
>>   public Object onActionFromEdit() {
>>       return Edit.class;
>>
>>   }
>>
>> And I got the following error :
>>
>> 16/03/2010 22:51:51 ERROR
>> org.apache.tapestry5.services.TapestryModule.RequestExceptionHandler -
>> Processing of request failed with uncaught exception: Request event
>> 'action'
>> (on component w/Index:layout.edit) was not handled; you must provide a
>> matching event handler method in the component or in one of its
>> containers.
>> org.apache.tapestry5.ioc.internal.util.TapestryException: Request event
>> 'action' (on component w/Index:layout.edit) was not handled; you must
>> provide a matching event handler method in the component or in one of
its
>> containers. [at classpath:org/bouil/tapestry/components/Layout.tml, line
>> 59]
>>   at
>>
org.apache.tapestry5.internal.services.ComponentEventRequestHandlerImpl.handle(ComponentEventRequestHandlerImpl.java:79)
>>   at
>>
org.apache.tapestry5.internal.services.ImmediateActionRenderResponseFilter.handle(ImmediateActionRenderResponseFilter.java:42)
>>   at
>>
$ComponentEventRequestHandler_12768f52a94.handle($ComponentEventRequestHandler_12768f52a94.java)
>>   at
>>
org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42)
>> ...
>>
>> What's wrong ?
>>
>> Thanks.
>> Nicolas.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to