component specific action event

2009-03-25 Thread Reinhold Gruber
Hi all!
 
Following is a simplified version of a problem which I'm not able to
solve:
 
I have a component:
public class Test {}

t:container
xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;

t:actionlink t:id=sampleLink
t:context=5click/t:actionlink

/t:container

 

and a page using the Test component

public class Start {

public void onActionFromSampleLink() {

System.err.println(onActionFromSampleLink);

}

public void onAction() {

System.err.println(onAction);

}

}

 

html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;

bodyt:test//body

/html

 

To my surprise only onAction() gets invoked,  onActionFromSampleLink()
is ignored?!?

 

Reinhold Gruber
Software Development
___

Deltavista GmbH
Diefenbachgasse 35; A-1150 Wien
Firmenbuchgericht und -nummer: Handelsgericht Wien, 200570g
Sitz der Gesellschaft: Wien
DVR: 1062107
http://www.deltavista.com http://www.deltavista.com/ 

Tel: +43 1 897 42 44 17
Fax: +43 1 897 42 44 31
mailto:r.gru...@deltavista.com mailto:r.gru...@deltavista.com 
___

 


Re: component specific action event

2009-03-25 Thread nille hammer
Hi Reinhold,

either delete the context-Attribute in your template or provide an event 
handler with a parameter holding the context-value (e.g. public void 
onActionFromSampleLink(final int value) ). It is just a guess, but I am pretty 
sure that tapestry is confused by the fact that you provide a context but no 
event handler for it.

Greetings nillehammer


- original Nachricht 

Betreff: component specific action event
Gesendet: Mi, 25. Mrz 2009
Von: Reinhold Gruberr.gru...@deltavista.com

 Hi all!
  
 Following is a simplified version of a problem which I'm not able to
 solve:
  
 I have a component:
 public class Test {}
 
 t:container
 xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
 
 t:actionlink t:id=sampleLink
 t:context=5click/t:actionlink
 
 /t:container
 
  
 
 and a page using the Test component
 
 public class Start {
 
 public void onActionFromSampleLink() {
 
 System.err.println(onActionFromSampleLink);
 
 }
 
 public void onAction() {
 
 System.err.println(onAction);
 
 }
 
 }
 
  
 
 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
 
 bodyt:test//body
 
 /html
 
  
 
 To my surprise only onAction() gets invoked,  onActionFromSampleLink()
 is ignored?!?
 
  
 
 Reinhold Gruber
 Software Development
 ___
 
 Deltavista GmbH
 Diefenbachgasse 35; A-1150 Wien
 Firmenbuchgericht und -nummer: Handelsgericht Wien, 200570g
 Sitz der Gesellschaft: Wien
 DVR: 1062107
 http://www.deltavista.com http://www.deltavista.com/ 
 
 Tel: +43 1 897 42 44 17
 Fax: +43 1 897 42 44 31
 mailto:r.gru...@deltavista.com mailto:r.gru...@deltavista.com 
 ___
 
  
 

--- original Nachricht Ende 


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



Re: component specific action event

2009-03-25 Thread Howard Lewis Ship
This is part of how Tapestry handles event bubbling.

To Test (container of sampleLink), the action event originates from
component sampleLink.

To Start (container of component test), the action event originates
from component test.

On Wed, Mar 25, 2009 at 10:05 AM, nille hammer
tapestry.nilleham...@winfonet.eu wrote:
 Hi Reinhold,

 either delete the context-Attribute in your template or provide an event 
 handler with a parameter holding the context-value (e.g. public void 
 onActionFromSampleLink(final int value) ). It is just a guess, but I am 
 pretty sure that tapestry is confused by the fact that you provide a context 
 but no event handler for it.

 Greetings nillehammer


 - original Nachricht 

 Betreff: component specific action event
 Gesendet: Mi, 25. Mrz 2009
 Von: Reinhold Gruberr.gru...@deltavista.com

 Hi all!

 Following is a simplified version of a problem which I'm not able to
 solve:

 I have a component:
 public class Test {}

 t:container
 xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;

         t:actionlink t:id=sampleLink
 t:context=5click/t:actionlink

 /t:container



 and a page using the Test component

 public class Start {

     public void onActionFromSampleLink() {

         System.err.println(onActionFromSampleLink);

     }

 public void onAction() {

     System.err.println(onAction);

     }

 }



 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;

     bodyt:test//body

 /html



 To my surprise only onAction() gets invoked,  onActionFromSampleLink()
 is ignored?!?



 Reinhold Gruber
 Software Development
 ___

 Deltavista GmbH
 Diefenbachgasse 35; A-1150 Wien
 Firmenbuchgericht und -nummer: Handelsgericht Wien, 200570g
 Sitz der Gesellschaft: Wien
 DVR: 1062107
 http://www.deltavista.com http://www.deltavista.com/

 Tel: +43 1 897 42 44 17
 Fax: +43 1 897 42 44 31
 mailto:r.gru...@deltavista.com mailto:r.gru...@deltavista.com
 ___




 --- original Nachricht Ende 


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





-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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



RE: component specific action event

2009-03-25 Thread Reinhold Gruber
Ok, I see. The method must be named onActionFromTest.
Thanks for that.

But does that mean, that in the following structure:

Page
|_ Border
   |_Comp1 (contains ActionLink with integer context)
   |_Comp2 (contains ActionLink with integer context)

it is not possible for the page class to find out what happened? 
What is best practice for that case?

I could supply an additional dispensable param und define 2 onActionFromBorder 
methods but this seems an ugly solution.

Regards
Reinhold

-Original Message-
From: Howard Lewis Ship [mailto:hls...@gmail.com] 
Sent: Mittwoch, 25. März 2009 18:14
To: Tapestry users
Subject: Re: component specific action event

This is part of how Tapestry handles event bubbling.

To Test (container of sampleLink), the action event originates from component 
sampleLink.

To Start (container of component test), the action event originates from 
component test.

On Wed, Mar 25, 2009 at 10:05 AM, nille hammer 
tapestry.nilleham...@winfonet.eu wrote:
 Hi Reinhold,

 either delete the context-Attribute in your template or provide an event 
 handler with a parameter holding the context-value (e.g. public void 
 onActionFromSampleLink(final int value) ). It is just a guess, but I am 
 pretty sure that tapestry is confused by the fact that you provide a context 
 but no event handler for it.

 Greetings nillehammer


 - original Nachricht 

 Betreff: component specific action event
 Gesendet: Mi, 25. Mrz 2009
 Von: Reinhold Gruberr.gru...@deltavista.com

 Hi all!

 Following is a simplified version of a problem which I'm not able to
 solve:

 I have a component:
 public class Test {}

 t:container
 xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;

         t:actionlink t:id=sampleLink
 t:context=5click/t:actionlink

 /t:container



 and a page using the Test component

 public class Start {

     public void onActionFromSampleLink() {

         System.err.println(onActionFromSampleLink);

     }

 public void onAction() {

     System.err.println(onAction);

     }

 }



 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;

     bodyt:test//body

 /html



 To my surprise only onAction() gets invoked,  
 onActionFromSampleLink() is ignored?!?



 Reinhold Gruber
 Software Development
 ___

 Deltavista GmbH
 Diefenbachgasse 35; A-1150 Wien
 Firmenbuchgericht und -nummer: Handelsgericht Wien, 200570g Sitz der 
 Gesellschaft: Wien
 DVR: 1062107
 http://www.deltavista.com http://www.deltavista.com/

 Tel: +43 1 897 42 44 17
 Fax: +43 1 897 42 44 31
 mailto:r.gru...@deltavista.com mailto:r.gru...@deltavista.com 
 ___




 --- original Nachricht Ende 


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





--
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

-
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: component specific action event

2009-03-25 Thread DH
2 ways:

1. Use eventlink instead of actionlink: Give event 'first' to the first link 
and 'secodn' to the second one.
 Then in page implement 2 handlers:
onFirst() and onSecond().
2. Handle event in Border and trigger different events to the parent (Page): 
ComponentResources#triggerEvent.

Thanks
DH


- Original Message - 
From: Reinhold Gruber
Sent: Thursday, March 26, 2009 5:36 AM
Subject: RE: component specific action event


Ok, I see. The method must be named onActionFromTest.
Thanks for that.

But does that mean, that in the following structure:

Page
|_ Border
   |_Comp1 (contains ActionLink with integer context)
   |_Comp2 (contains ActionLink with integer context)

it is not possible for the page class to find out what happened? 
What is best practice for that case?

I could supply an additional dispensable param und define 2 onActionFromBorder 
methods but this seems an ugly solution.

Regards
Reinhold