You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Craig Hamilton <CH...@celeres.ca> on 2005/08/30 22:55:51 UTC

redirect if visit object not populated

First off, I am using tapestry 3.

 

I have not been able to solve this in reading the documentation, or the
tapestry in action book, and hope someone can help me out.

 

There is some context information which needs to be specified before a
set of pages within my app can be shown.  I would like to detect that
case within each  for the screens, and then redirect to a page I have
for specifying the context info.  When the user hits submit, it should
then return back to the page which was attempting to be shown.

 

For example before ScreenA can be shown, the visit object has to have
certain info filled in.  

 

Within the onFinishLoad method on ScreenA, I detect this, and thought I
could issue a cycle.activate over to my context entry screen.  

 

This didn't work.

 

Any tips much appreciated.

 

Thanks

 

Craig

 


Re: redirect if visit object not populated

Posted by Robert Zeigler <ro...@scazdl.org>.
1) I would implement PageValidateListener for logic like this.
2) You probably want to use PageRedirectException instead of
cycle.activate for changing to the page.
3) Look into callbacks, as well; you may need to implement a custom
callback to maintain all of the information you need for the various
screens.

Robert

Craig Hamilton wrote:
> First off, I am using tapestry 3.
> 
>  
> 
> I have not been able to solve this in reading the documentation, or the
> tapestry in action book, and hope someone can help me out.
> 
>  
> 
> There is some context information which needs to be specified before a
> set of pages within my app can be shown.  I would like to detect that
> case within each  for the screens, and then redirect to a page I have
> for specifying the context info.  When the user hits submit, it should
> then return back to the page which was attempting to be shown.
> 
>  
> 
> For example before ScreenA can be shown, the visit object has to have
> certain info filled in.  
> 
>  
> 
> Within the onFinishLoad method on ScreenA, I detect this, and thought I
> could issue a cycle.activate over to my context entry screen.  
> 
>  
> 
> This didn't work.
> 
>  
> 
> Any tips much appreciated.
> 
>  
> 
> Thanks
> 
>  
> 
> Craig
> 
>  
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: redirect if visit object not populated

Posted by Tomáš Drenčák <to...@gmail.com>.
In validate method you can check if everything is set (maybe in Visit
object). If not you can remember page which should be displayed and
then throw a RedirectException to the path specified e.g. "/" to Home
page... After everything has been set, you can use
cycle.activate(page) with page from first request.

2005/8/30, Craig Hamilton <CH...@celeres.ca>:
> First off, I am using tapestry 3.
> 
> 
> 
> I have not been able to solve this in reading the documentation, or the
> tapestry in action book, and hope someone can help me out.
> 
> 
> 
> There is some context information which needs to be specified before a
> set of pages within my app can be shown.  I would like to detect that
> case within each  for the screens, and then redirect to a page I have
> for specifying the context info.  When the user hits submit, it should
> then return back to the page which was attempting to be shown.
> 
> 
> 
> For example before ScreenA can be shown, the visit object has to have
> certain info filled in.
> 
> 
> 
> Within the onFinishLoad method on ScreenA, I detect this, and thought I
> could issue a cycle.activate over to my context entry screen.
> 
> 
> 
> This didn't work.
> 
> 
> 
> Any tips much appreciated.
> 
> 
> 
> Thanks
> 
> 
> 
> Craig
> 
> 
> 
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org