Re: Action Link In Parent Component

2009-03-03 Thread Robert Zeigler
Nah, that's not true, sorry. Event bubbling happens regardless of the  
method visibility.


The issue here is understanding how event bubbling works.

When the child component contains an action link, it may do one of  
three things:

1) It may handle the action (onAction) and prevent bubbling
2) It may ignore the action, and bubbling will occur
3) It may handle the action and generate its own custom event.

What you want, DH, is either 2 or 3.  I like #3 a lot because it makes  
the parent component agnostic to the way the event is generated in the  
child.
In the case of #2, which is what you were trying to do, the event is  
propagated as though it originated from the child component.


So, instead of:

onActionFromChildEvent, you need:

onActionFromChild

Or event:
@OnEvent(value="action",component="child")
void foo() {
}

Cheers,

Robert

On Mar 3, 2009, at 3/34:26 AM , Inge Solvoll wrote:


Make sure that the parent listener has the correct visibility. If the
listener is package private and the child component is in a different
package, the listener won't be triggered...

On Tue, Mar 3, 2009 at 10:21 AM, dhning  wrote:


I think what you need is
Class Parent {
onChildEvent(int id){
// Do something 
}


Thanks,

DH


- Original Message -
From: "Davor Miku" 
To: "Tapestry users" 
Sent: Tuesday, March 03, 2009 1:05 PM
Subject: Action Link In Parent Component



Hi!

I want to set action link in child component, but action needs to be

handled

in parent component.

I tried to hack like:


   



Class Parent {

onActionFromChildEvent(int id){
// Do something 
  }

}
In child.tml :
Action


but I'm getting :

Component parent does not contain an embedded component with id
'childevent'.

How can I achieve this?






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



Re: Action Link In Parent Component

2009-03-03 Thread Andy Pahne



Or is Eventink what you are searching for?

see 
http://tapestry.formos.com/nightly/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/EventLink.html



Inge Solvoll wrote:

Make sure that the parent listener has the correct visibility. If the
listener is package private and the child component is in a different
package, the listener won't be triggered...

On Tue, Mar 3, 2009 at 10:21 AM, dhning  wrote:

   

I think what you need is
Class Parent {
  onChildEvent(int id){
// Do something 
}


Thanks,

DH


- Original Message -
From: "Davor Miku"
To: "Tapestry users"
Sent: Tuesday, March 03, 2009 1:05 PM
Subject: Action Link In Parent Component


 

Hi!

I want to set action link in child component, but action needs to be
   

handled
 

in parent component.

I tried to hack like:


 



Class Parent {

onActionFromChildEvent(int id){
// Do something 
}

}
In child.tml :
Action


but I'm getting :

Component parent does not contain an embedded component with id
'childevent'.

How can I achieve this?

   


   



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



Re: Action Link In Parent Component

2009-03-03 Thread Inge Solvoll
Make sure that the parent listener has the correct visibility. If the
listener is package private and the child component is in a different
package, the listener won't be triggered...

On Tue, Mar 3, 2009 at 10:21 AM, dhning  wrote:

> I think what you need is
> Class Parent {
>  onChildEvent(int id){
> // Do something 
> }
>
>
> Thanks,
>
> DH
>
>
> - Original Message -
> From: "Davor Miku" 
> To: "Tapestry users" 
> Sent: Tuesday, March 03, 2009 1:05 PM
> Subject: Action Link In Parent Component
>
>
> > Hi!
> >
> > I want to set action link in child component, but action needs to be
> handled
> > in parent component.
> >
> > I tried to hack like:
> >
> > 
> > 
> > 
> >
> >
> > Class Parent {
> >
> > onActionFromChildEvent(int id){
> > // Do something 
> >}
> >
> > }
> > In child.tml :
> > Action
> >
> >
> > but I'm getting :
> >
> > Component parent does not contain an embedded component with id
> > 'childevent'.
> >
> > How can I achieve this?
> >
>


Re: Action Link In Parent Component

2009-03-03 Thread dhning
I think what you need is
Class Parent {
 onChildEvent(int id){
// Do something 
}


Thanks,

DH


- Original Message - 
From: "Davor Miku" 
To: "Tapestry users" 
Sent: Tuesday, March 03, 2009 1:05 PM
Subject: Action Link In Parent Component


> Hi!
> 
> I want to set action link in child component, but action needs to be handled
> in parent component.
> 
> I tried to hack like:
> 
> 
> 
> 
> 
> 
> Class Parent {
> 
> onActionFromChildEvent(int id){
> // Do something 
>}
> 
> }
> In child.tml :
> Action
> 
> 
> but I'm getting :
> 
> Component parent does not contain an embedded component with id
> 'childevent'.
> 
> How can I achieve this?
>

Action Link In Parent Component

2009-03-02 Thread Davor Miku
Hi!

I want to set action link in child component, but action needs to be handled
in parent component.

I tried to hack like:


 



Class Parent {

 onActionFromChildEvent(int id){
 // Do something 
}

}
In child.tml :
Action


but I'm getting :

Component parent does not contain an embedded component with id
'childevent'.

How can I achieve this?