How about:
public String doName(String name)
{
return name;
}
This is very, very new in 4.0. listener methods may now return either
the name of a page to activate, or an instance of IPage to activate.
Alternately:
public void doName(IRequestCycle cycle, String name)
{
cycle.activate(name);
}
Alternately:
public IPage doName(IRequestCycle cycle, String name)
{
return cycle.getPage(name);
}
Alternately:
public void doName(String name)
{
getRequestCycle().activate(name);
}
I like the very first one the most!
On 6/28/05, Scott F. Walter <[EMAIL PROTECTED]> wrote:
> Hensley, Richard wrote:
>
> >use getRequestCycle() from within your method.
> >
> >Richard
> >
> >-----Original Message-----
> >From: Scott F. Walter [mailto:[EMAIL PROTECTED]
> >Sent: Tuesday, June 28, 2005 3:58 PM
> >To: Tapestry users
> >Subject: Tapestry 4 DirectLinks
> >
> >I am attempting to use a DirectLink using the new listener style. I
> >want my listener to accept a String parameter then send the userr to a
> >different page. So I will have the following in my html:
> >
> ><a href="#" jwcid="@DirectLink" listener="listener:doName"
> >parameters="ognl:'scott'">Name</a>
> >
> >my page class will then have a method:
> >
> >public void doName(String name) {
> >}
> >
> >My question is how do I send the user to another page. In the Tapestry 3
> >way, I would have to pull the parameters
> >out of the getServiceParamwter() array then activate the new page. However
> >in my doName() metod I have no
> >Cycle instancec. Is there a way to get a cycle instance?
> >
> >scott.
> >
> >
> >
> >
> Of course! Silly of me.
>
> I really like Tapestry4 with the annotations and the simplified listener
> style. No more getServiceParameters()! Tapestry 4 goes leaps and
> bounds above other frameworks in removing the plumbing code that other
> web frameworks require you to implements (IMHO).
>
> scott.
>
> --
>
> Scott F. Walter Scott F. Walter
> Principal Consultant
> Vivare, Inc.
>
> E: [EMAIL PROTECTED]
> E: [EMAIL PROTECTED]
> Visit scottwalter.com <http://scottwalter.com> --Point. Click. Explore!
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
Professional Tapestry training, mentoring, support
and project work. http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]