Tapestry 4.0 beta 6, 7, and 8. I implemented what you discussed in returning
an ILink from a listener, but but it resulted in a
Hivemind.ApplicationRuntimeException. Failure invoking listener method
...ILink ...fooListener(...IRequestCycle) Parameter parameter is of type
$Foo... which is not compatible with java.lang.String.
Template:
<form jwcid="form">
...
</form>
Page:
<component id="form" type="Form">
<binding name="listener" value="listener:fooListener"/>
</component>
I added the page injection and the public abstract accessor method. Compiles
and runs until this listener is called.
Did I miss something??
Thanks,
Joseph
On 9/16/05, Eli Doran <[EMAIL PROTECTED]> wrote:
>
> you're right, the way to do it is return an ILink which will cause
> getRequestCycle().sendRedirect(link.getAbsoluteURL())
>
> What I've been doing until beta-7 source is my BasePage class has
> redirectTo/externalRedirectTo methods and I inject PageService or
> ExternalService into any page that uses these methods; which most do
> because I do a redirect from my listener methods.
>
> so, i'll change my listeners to return ILink and change the BasePage
> methods to provide the ILink.
>
> Thank you,
> ~eli.
>
> Tomás( Drenc(ák wrote:
>
> >I'm not sure if you can throw a RedirectException from listener
> >method. If you need redirect, just return ILink from listener method
> >which redirects your request.
> >
> >@InjectObject("engine-service:page")
> >public abstract IEngineService getPageService();
> >
> >@InjectPage("SomePage")
> >public abstract IPage getSomePage();
> >
> >public ILink doSmth() {
> > return getPageService().getLink(getRequestCycle(), false,
> getSomePage());
> >}
> >
> >2005/9/15, Eli Doran <[EMAIL PROTECTED]>:
> >
> >
> >>anyone else having trouble with RedirectExceptions when called from a
> >>listener method? mine are being caught and displayed in the exception
> >>page. i'm using the most recent TP4 source. it works fine from
> >>pageValidate methods.
> >>
> >>~eli
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
>
>