Re: Handling component's actionlink on the enclosing page?

2012-04-20 Thread Dmitriy Vsekhvalnov
Thanks guys, works like a charm.

On Fri, Apr 20, 2012 at 3:17 AM, Chris Mylonas ch...@opencsta.org wrote:

 that is an awesome one or two line explanation of an event bubble!

 this was a little too hard to take in whilst i mucked around with custom
 components and totally missed the point (
 https://tapestry.apache.org/component-events.html)
 the jumpstart example looks good too
 http://jumpstart.doublenegative.com.au/jumpstart/examples/component/eventbubbling

 cheers
 chris

 On 20/04/2012, at 6:05 AM, Thiago H. de Paula Figueiredo wrote:

  On Thu, 19 Apr 2012 16:59:33 -0300, Thiago H. de Paula Figueiredo 
 thiag...@gmail.com wrote:
 
  Yes, if you change from ActionLink to EventLink.
 
  Ooops, it missed the explanation: Tapestry component ids are local to
 the component or page in which they were declared, so, outside it, you
 cannot use the id in the event handler method name of the @OnEvent
 annotation. On the other hand, event names don't have this limitation.
 Events bubble up (from the component that triggers it to its parent until
 it reaches the containing page).
 
  Summary: use EventLink with a different event name for each link.
 
  --
  Thiago H. de Paula Figueiredo
  Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
  Owner, Ars Machina Tecnologia da Informação Ltda.
  http://www.arsmachina.com.br
 
  -
  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




Re: Handling component's actionlink on the enclosing page?

2012-04-19 Thread Thiago H. de Paula Figueiredo
On Thu, 19 Apr 2012 16:36:58 -0300, Dmitriy Vsekhvalnov  
dvsekhval...@gmail.com wrote:



Hi all,


Hi!


i have simple custom component within  loop on the page:

t:loop source=units value=unit
   t:uniteditor value=unit
/t:loop

UnitEditor.tml contains couple ActionLinks:

t:actionlink t:id=delete t:context=value../t:actionlink
t:actionlink t:id=edit t:context=value../t:actionlink

Can i handle those events in the page class?


Yes, if you change from ActionLink to EventLink.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Handling component's actionlink on the enclosing page?

2012-04-19 Thread Thiago H. de Paula Figueiredo
On Thu, 19 Apr 2012 16:59:33 -0300, Thiago H. de Paula Figueiredo  
thiag...@gmail.com wrote:



Yes, if you change from ActionLink to EventLink.


Ooops, it missed the explanation: Tapestry component ids are local to the  
component or page in which they were declared, so, outside it, you cannot  
use the id in the event handler method name of the @OnEvent annotation. On  
the other hand, event names don't have this limitation. Events bubble up  
(from the component that triggers it to its parent until it reaches the  
containing page).


Summary: use EventLink with a different event name for each link.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Handling component's actionlink on the enclosing page?

2012-04-19 Thread Chris Mylonas
that is an awesome one or two line explanation of an event bubble!

this was a little too hard to take in whilst i mucked around with custom 
components and totally missed the point 
(https://tapestry.apache.org/component-events.html)
the jumpstart example looks good too 
http://jumpstart.doublenegative.com.au/jumpstart/examples/component/eventbubbling

cheers
chris

On 20/04/2012, at 6:05 AM, Thiago H. de Paula Figueiredo wrote:

 On Thu, 19 Apr 2012 16:59:33 -0300, Thiago H. de Paula Figueiredo 
 thiag...@gmail.com wrote:
 
 Yes, if you change from ActionLink to EventLink.
 
 Ooops, it missed the explanation: Tapestry component ids are local to the 
 component or page in which they were declared, so, outside it, you cannot use 
 the id in the event handler method name of the @OnEvent annotation. On the 
 other hand, event names don't have this limitation. Events bubble up (from 
 the component that triggers it to its parent until it reaches the containing 
 page).
 
 Summary: use EventLink with a different event name for each link.
 
 -- 
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and 
 instructor
 Owner, Ars Machina Tecnologia da Informação Ltda.
 http://www.arsmachina.com.br
 
 -
 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