Thanks!
Chuck
Luu Tuan Cuong wrote:
Hi,
You can use the service: PageRenderLinkSource.
@Inject
PageRenderLinkSource _linkSource;
private Link getPageLink(Class<?> pageClass, Object... context) {
return _linkSource.createPageRenderWithContext(pageClass,
context);
}
public Object setupRender(){
node = Node.getByNodeId(nodeId);
if( node.isRed()){
return getPageLink(Red.class, nodeId);
}
return getPageLink(Green.class, nodeId);
}
In Red or Green page, you use activate method to get nodeId.
On 7/22/2010 9:26 AM, Chuck Kring wrote:
Hi,
I have a page that takes a nodeId as a parameter, then redirects into
the page to a different page depending upon the type of object
referred to by the nodeId. I also would like to set the nodeId of
the redirected page. What's the best way to do this?
Thanks.
Chuck
public class myPage()
{
@Persist
private int nodeId;
@InjectPage
private GreenPage green;
@InjectPage
private RedPage red;
onActivate(id){
this.nodeId = id;
}
public Object setupRender(){
node = Node.getByNodeId(nodeId);
if( node.isRed()){
// doesn't work because red nodeId is not set.
return red;
}
// doesn't work because green nodeId is not set.
return green;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org