You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Larry Sherrill <la...@yahoo.com> on 2005/08/05 00:51:18 UTC

How does a component listen

My apologies if this is asked every week. I can't find
a similar example.

I am creating a Header component that will be included
at the top of each page. For example, Home.html will
have:
<span jwcid="@Header"/>

This component will have a logout link. Here is a
simplified version of the Header component:

<tr>
<td>
<a href="#" jwcid="@DirectLink"
listener="ognl:listeners.logout">Logout</a>
</td>
</tr>

The problem is that ognl:listeners.logout (logout
lives in Home.java) doesn't work. I get his error:
Unable to resolve expression 'listeners.logout' for
org.apache.tapestry.BaseComponent@1f6f81b[Home/$Header].

How do I put a listener method in the component?
Putting the standard listener method in Header.java
didn't work, nor did putting the listener method in
Home.java work.

I've tried the Tapestry book, but can't find a similar
scenario there.

Thanks,
Larry Sherrill



		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How does a component listen

Posted by Larry Sherrill <la...@yahoo.com>.
Hi Danny,

That did the trick. Thanks so much. I'm just starting
to get my feet wet with making my own components and
forgot to specify the class.

Larry

--- Danny Mandel <dm...@tolweb.org> wrote:

> Hi Larry.
> 
> The problem appears to be that your Header component
> isn't getting 
> instantiated with your Header class.
> 
> The error message:
> 
> Unable to resolve expression 'listeners.logout' for
>
org.apache.tapestry.BaseComponent@1f6f81b[Home/$Header].
> 
> Says your component is an instance of BaseComponent,
> instead of your 
> class.  Check your .jwc file and make sure that the
> class attribute is 
> pointing to your Header class.  Then, things should
> be working fine.  
> Components can have their own listener methods just
> like pages can.
> 
> Hope that helps,
> Danny
> 
> Larry Sherrill wrote:
> 
> >My apologies if this is asked every week. I can't
> find
> >a similar example.
> >
> >I am creating a Header component that will be
> included
> >at the top of each page. For example, Home.html
> will
> >have:
> ><span jwcid="@Header"/>
> >
> >This component will have a logout link. Here is a
> >simplified version of the Header component:
> >
> ><tr>
> ><td>
> ><a href="#" jwcid="@DirectLink"
> >listener="ognl:listeners.logout">Logout</a>
> ></td>
> ></tr>
> >
> >The problem is that ognl:listeners.logout (logout
> >lives in Home.java) doesn't work. I get his error:
> >Unable to resolve expression 'listeners.logout' for
>
>org.apache.tapestry.BaseComponent@1f6f81b[Home/$Header].
> >
> >How do I put a listener method in the component?
> >Putting the standard listener method in Header.java
> >didn't work, nor did putting the listener method in
> >Home.java work.
> >
> >I've tried the Tapestry book, but can't find a
> similar
> >scenario there.
> >
> >Thanks,
> >Larry Sherrill
> >
> >
> >
> >		
>
>____________________________________________________
> >Start your day with Yahoo! - make it your home page
> 
> >http://www.yahoo.com/r/hs 
> > 
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> >  
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How does a component listen

Posted by Danny Mandel <dm...@tolweb.org>.
Hi Larry.

The problem appears to be that your Header component isn't getting 
instantiated with your Header class.

The error message:

Unable to resolve expression 'listeners.logout' for
org.apache.tapestry.BaseComponent@1f6f81b[Home/$Header].

Says your component is an instance of BaseComponent, instead of your 
class.  Check your .jwc file and make sure that the class attribute is 
pointing to your Header class.  Then, things should be working fine.  
Components can have their own listener methods just like pages can.

Hope that helps,
Danny

Larry Sherrill wrote:

>My apologies if this is asked every week. I can't find
>a similar example.
>
>I am creating a Header component that will be included
>at the top of each page. For example, Home.html will
>have:
><span jwcid="@Header"/>
>
>This component will have a logout link. Here is a
>simplified version of the Header component:
>
><tr>
><td>
><a href="#" jwcid="@DirectLink"
>listener="ognl:listeners.logout">Logout</a>
></td>
></tr>
>
>The problem is that ognl:listeners.logout (logout
>lives in Home.java) doesn't work. I get his error:
>Unable to resolve expression 'listeners.logout' for
>org.apache.tapestry.BaseComponent@1f6f81b[Home/$Header].
>
>How do I put a listener method in the component?
>Putting the standard listener method in Header.java
>didn't work, nor did putting the listener method in
>Home.java work.
>
>I've tried the Tapestry book, but can't find a similar
>scenario there.
>
>Thanks,
>Larry Sherrill
>
>
>
>		
>____________________________________________________
>Start your day with Yahoo! - make it your home page 
>http://www.yahoo.com/r/hs 
> 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org