You can throw new PageRedircetException("PageName"); or you can use the page
service:
http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/engine/PageService.html

To inject the page service, do following:

@InjectObject("engine-service:page")
public abstract IEngineService getPageService();

On Jan 18, 2008 12:30 PM, Andy Pahne <[EMAIL PROTECTED]> wrote:

>
> Hello,
>
> I have a listener method with the return type of ILink. It needs to
> return ILink, because in some cases the user will be forwarded to
> external pages and I created those links with
>    new StaticLink(url)
>
> In some other cases the listener method should return an ILink to an
> internal tapestry page. How can I construct an ILink that links to a page.
>
>
> Example:
>
> public ILink accommodationSelectAction(Hotel hotel) {
>
>
>  switch (someCondition) {
>
>   case CONDITION_1:
>      IPage nextPage = getNextPage();
>      return ????
>
>    case CONDITON_2:
>       return new StaticLink(someUrl);
>
>    default:
>       throw new ApplicationRuntmieException("boo boo");
>   }
>
>  }
>
>
>
> Thanks,
> Andy
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Best regards,

Igor Drobiazko

Reply via email to