Re: throw new PageRedirectException

2010-09-23 Thread Martin Strand
On Thu, 23 Sep 2010 04:43:28 +0200, asianCoolz   
wrote:



IEngineService pageService = getPageService();

   String pageName = "NextTapestryPage";
   ILink link = pageService.getLink(false, pageName);
   throw new RedirectException(link.getAbsoluteURL());



if page is IPage, and i set parameter to the page.setExtraParameter(abc);
how to get absoluteurl for this IPage? rathan than "string" that you  
suggested

for pageName.


I haven't used Tapestry 4 for a while, but I'm pretty sure that you can  
pass all the parameters to getLink(...) in an array, starting with the  
page name:


IPage page = ...;
Object abc = ...;
String pageName = page.getName();
ILink link = pageService.getLink(false, new Object[] {pageName, abc,  
moreParameters(), etc} );

throw new RedirectException(link.getAbsoluteURL());

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: throw new PageRedirectException

2010-09-22 Thread asianCoolz
IEngineService pageService = getPageService();
>String pageName = "NextTapestryPage";
>ILink link = pageService.getLink(false, pageName);
>throw new RedirectException(link.getAbsoluteURL());


if page is IPage, and i set parameter to the page.setExtraParameter(abc);
how to get absoluteurl for this IPage? rathan than "string" that you suggested
for pageName.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: throw new PageRedirectException

2010-09-22 Thread Martin Strand

This is in Tapestry 4, right?
To send the client to a different URL you can throw a RedirectException  
instead:


void redirectToNextPage()
{
  IEngineService pageService = getPageService();
  String pageName = "NextTapestryPage";
  ILink link = pageService.getLink(false, pageName);
  throw new RedirectException(link.getAbsoluteURL());
}

You also need to inject the page service in your page/component class:

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


On Wed, 22 Sep 2010 12:00:10 +0200, asianCoolz   
wrote:


with throw new PageRedirectException("NextTapestryPage"); , i was  
redicectd to
another page, but the url on the browser address bar is not change.   is  
there

any method i can call "forward", so that use 'forward' to another page


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: throw new PageRedirectException

2010-09-22 Thread Katia Aresti Gonzalez
http://tapestry.apache.org/tapestry5/guide/pagenav.html

2010/9/22 asianCoolz 

> with throw new PageRedirectException("NextTapestryPage"); , i was redicectd
> to
> another page, but the url on the browser address bar is not change.   is
> there
> any method i can call "forward", so that use 'forward' to another page
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>