You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Kevin J. Menard, Jr." <ni...@negativetwenty.net> on 2004/09/14 20:27:04 UTC

Calling Listeners from Other Pages

Hi,

Is it possible to call a listener from another page class?  What I want 
to do is have a primary search page, which leads to a results page, and 
the results page has a search field as well (a la Google).  Currently I 
have the primary search page performing the search, handing the results 
off to the results page, and then activating the results page.  I'd 
like to recycle this relationship, so the query button from the results 
page activates the listener in the search page.  Is this possible, or 
is it even the correct thing to do?  FWIW, I'm trying to avoid using a 
Border component, since the search fields will be laid out differently.

Any feedback would be appreciated.

-- 
Thanks,
Kevin


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


Re: Calling Listeners from Other Pages

Posted by Norbert Sándor <pr...@hotmail.com>.
Yes, it is possible.
I think something like below should work:

    <binding name="listener"
expression="requestCycle.getPage('pagename').listeners.onEvent" />

Norbi

----- Original Message ----- 
From: "Kevin J. Menard, Jr." <ni...@negativetwenty.net>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, September 14, 2004 8:27 PM
Subject: Calling Listeners from Other Pages


> Hi,
>
> Is it possible to call a listener from another page class?  What I want
> to do is have a primary search page, which leads to a results page, and
> the results page has a search field as well (a la Google).  Currently I
> have the primary search page performing the search, handing the results
> off to the results page, and then activating the results page.  I'd
> like to recycle this relationship, so the query button from the results
> page activates the listener in the search page.  Is this possible, or
> is it even the correct thing to do?  FWIW, I'm trying to avoid using a
> Border component, since the search fields will be laid out differently.
>
> Any feedback would be appreciated.
>
> -- 
> Thanks,
> Kevin
>
>
> ---------------------------------------------------------------------
> 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


RE: Calling Listeners from Other Pages

Posted by John McTeague <jo...@shortslant.com>.
Rather than having a listener method in your search page, create a class
that implements org.apache.tapestry.IActionListener and implement the search
logic there. You can then hook the listener class into both search buttons
(I usually define a <bean> in my page for the listener and bind that bean to
the listener parameter)

-----Original Message-----
From: Kevin J. Menard, Jr. [mailto:nirvdrum@negativetwenty.net] 
Sent: 14 September 2004 19:27
To: Tapestry users
Subject: Calling Listeners from Other Pages


Hi,

Is it possible to call a listener from another page class?  What I want 
to do is have a primary search page, which leads to a results page, and 
the results page has a search field as well (a la Google).  Currently I 
have the primary search page performing the search, handing the results 
off to the results page, and then activating the results page.  I'd 
like to recycle this relationship, so the query button from the results 
page activates the listener in the search page.  Is this possible, or 
is it even the correct thing to do?  FWIW, I'm trying to avoid using a 
Border component, since the search fields will be laid out differently.

Any feedback would be appreciated.

-- 
Thanks,
Kevin


---------------------------------------------------------------------
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