On Sat, 24 Jan 2015 13:10:10 -0200, akshay <akshayestat...@gmail.com>
wrote:
Hi,
Hi!
Can anyone please suggest me a way of redirecting/rendering a page with
context from my current page.
I'm sorry, I'm not following you. Redirecting and rendering a page are
completely different actions with completely different outcomes.
This what I have been doing:-
@Inject
private ComponentSource componentSource;
Object onActivate(){
return componentResources.getPage(getPageName());
//This works fine till the time I have valid logical page name such as
"/project/index". It fails when I add a context to it such as
project/details/10871(which is because I believe it expects only the
logical page name(existing in the package) without the context.
}
The code above is incorrect and would never work with a context. Anyway,
you seem to be trying to build the URL yourself. Don't do that. Let
Tapestry do that for you.
You can do way simpler:
@InjectPage
private YourTargetPage yourTargetPage;
Object onActivate() {
yourTargetPage.setXXX(...);
yourTargetPage.setYYY(...);
return yourTargetPage;
}
This supposes YourTargetPage has correctly implemented onActivate() and
onPassivate().
You could also @Inject PageRenderLinkSource and use its methods.
Anyway, check http://tapestry.apache.org/page-navigation.html. It has
everything you need to know about going from one page to another in
Tapestry.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org