[CONF] Apache Tapestry > Component Events FAQ

2013-10-14 Thread Bob Harner (Confluence)







Component Events FAQ
Page edited by Bob Harner


Comment:
"redirect-after-post" renamed to Post/Redirect/Get


 Changes (1)
 




...
h3. Why does Tapestry send a redirect after a form is submitted?  
This is an extension of the [redirect after post|http://en.wikipedia.org/wiki/Post/Redirect/Get] [Post/Redirect/Get|http://en.wikipedia.org/wiki/Post/Redirect/Get] approach. It ensures that after an operation that updates server-side state, such as a form submission, if the user resubmits the resulting page, the operation is *not* performed a second time; instead just the results of the operation, reflecting the changed server-side state, is re-rendered. 
 This has the unwanted requirement that any data needed to render the response must persist between the event request (the form submission) and the render request; this often means that fields must be annotated with @[Persist|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Persist.html]. 
...


Full Content

Link Components FAQ Frequently Asked Questions _javascript_ FAQ 

Component Events 

Why does Tapestry send a redirect after a form is submitted?

This is an extension of the Post/Redirect/Get approach. It ensures that after an operation that updates server-side state, such as a form submission, if the user resubmits the resulting page, the operation is not performed a second time; instead just the results of the operation, reflecting the changed server-side state, is re-rendered.

This has the unwanted requirement that any data needed to render the response must persist between the event request (the form submission) and the render request; this often means that fields must be annotated with @Persist.



Added in 5.2

If you want to short-circuit this behavior and render a response directly, your component event handle method may return an instance of StreamPageContent. Tapestry will render the page as part of the event request and stream its content back to the client web browser, rather than sending the normal redirect.




Added in 5.4

Starting in release 5.4, Forms (by default) will NOT redirect after post if there are validation errors. This makes it possible to re-render the page, with error decorations, without requiring that the validation errors be stored in the session between requests ... and that means that the application can remain stateless much longer.


I specified a zone in my ActionLink/EventLink, so why doesn't my event fire via ajax (request.isXHR() is false)?

Check your browser's _javascript_ console for errors. It's likely that a _javascript_ error has prevented Tapestry from transforming your ActionLink/EventLink from a page render action to an ajax action.

Link Components FAQ Frequently Asked Questions _javascript_ FAQ



Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Tapestry > Component Events FAQ

2013-08-20 Thread Bob Harner (Confluence)







Component Events FAQ
Page edited by Bob Harner


Comment:
Added Lance


 Changes (1)
 




...
{since}  
h3.  I specified a zone in my ActionLink/EventLink, so why doesn't my event fire via ajax (request.isXHR() is false)?  Check your browser's _javascript_ console for errors. It's likely that a _javascript_ error has prevented Tapestry from transforming your ActionLink/EventLink from a page render action to an ajax action.  
{scrollbar} 


Full Content

Link Components FAQ Frequently Asked Questions _javascript_ FAQ 

Component Events 

Why does Tapestry send a redirect after a form is submitted?

This is an extension of the redirect after post approach. It ensures that after an operation that updates server-side state, such as a form submission, if the user resubmits the resulting page, the operation is not performed a second time; instead just the results of the operation, reflecting the changed server-side state, is re-rendered.

This has the unwanted requirement that any data needed to render the response must persist between the event request (the form submission) and the render request; this often means that fields must be annotated with @Persist.



Added in 5.2

If you want to short-circuit this behavior and render a response directly, your component event handle method may return an instance of StreamPageContent. Tapestry will render the page as part of the event request and stream its content back to the client web browser, rather than sending the normal redirect.




Added in 5.4

Starting in release 5.4, Forms (by default) will NOT redirect after post if there are validation errors. This makes it possible to re-render the page, with error decorations, without requiring that the validation errors be stored in the session between requests ... and that means that the application can remain stateless much longer.


I specified a zone in my ActionLink/EventLink, so why doesn't my event fire via ajax (request.isXHR() is false)?

Check your browser's _javascript_ console for errors. It's likely that a _javascript_ error has prevented Tapestry from transforming your ActionLink/EventLink from a page render action to an ajax action.

Link Components FAQ Frequently Asked Questions _javascript_ FAQ



Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Tapestry > Component Events FAQ

2012-02-21 Thread confluence







Component Events FAQ
Page edited by Howard M. Lewis Ship


 Changes (1)
 




...
{since}  
{since:since=5.4} Starting in release 5.4, Forms (by default) will NOT redirect after post if there are validation errors. This makes it possible to re-render the page, with error decorations, without requiring that the validation errors be stored in the session between requests ... and that means that the application can remain stateless much longer. {since}  
{scrollbar} 


Full Content

Link Components FAQ Frequently Asked Questions _javascript_ FAQ 

Component Events 

Why does Tapestry send a redirect after a form is submitted?

This is an extension of the redirect after post approach. It ensures that after an operation that updates server-side state, such as a form submission, if the user resubmits the resulting page, the operation is not performed a second time; instead just the results of the operation, reflecting the changed server-side state, is re-rendered.

This has the unwanted requirement that any data needed to render the response must persist between the event request (the form submission) and the render request; this often means that fields must be annotated with @Persist.



Added in 5.2

If you want to short-circuit this behavior and render a response directly, your component event handle method may return an instance of StreamPageContent. Tapestry will render the page as part of the event request and stream its content back to the client web browser, rather than sending the normal redirect.




Added in 5.4

Starting in release 5.4, Forms (by default) will NOT redirect after post if there are validation errors. This makes it possible to re-render the page, with error decorations, without requiring that the validation errors be stored in the session between requests ... and that means that the application can remain stateless much longer.


Link Components FAQ Frequently Asked Questions _javascript_ FAQ



Change Notification Preferences

View Online
|
View Changes









[CONF] Apache Tapestry > Component Events FAQ

2011-05-17 Thread confluence







Component Events FAQ
Page edited by Howard M. Lewis Ship


 Changes (2)
 




{scrollbar}  
 
h2. Component Events   h3. Why does Tapestry send a redirect after a form is submitted?  This is an extension of the [redirect after post|http://en.wikipedia.org/wiki/Post/Redirect/Get] approach. It ensures that after an operation that updates server-side state, such as a form submission, if the user resubmits the resulting page, the operation is *not* performed a second time; instead just the results of the operation, reflecting the changed server-side state, is re-rendered.  This has the unwanted requirement that any data needed to render the response must persist between the event request (the form submission) and the render request; this often means that fields must be annotated with @[Persist|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Persist.html].  {since:since=5.2} If you want to short-circuit this behavior and render a response directly, your component event handle method may return an instance of [StreamPageContent|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/StreamPageContent.html]. Tapestry will render the page as part of the event request and stream its content back to the client web browser, rather than sending the normal redirect. {since}  {scrollbar} 


Full Content

Link Components FAQ Frequently Asked Questions _javascript_ FAQ 

Component Events 

Why does Tapestry send a redirect after a form is submitted?

This is an extension of the redirect after post approach. It ensures that after an operation that updates server-side state, such as a form submission, if the user resubmits the resulting page, the operation is not performed a second time; instead just the results of the operation, reflecting the changed server-side state, is re-rendered.

This has the unwanted requirement that any data needed to render the response must persist between the event request (the form submission) and the render request; this often means that fields must be annotated with @Persist.



Added in 5.2

If you want to short-circuit this behavior and render a response directly, your component event handle method may return an instance of StreamPageContent. Tapestry will render the page as part of the event request and stream its content back to the client web browser, rather than sending the normal redirect.


Link Components FAQ Frequently Asked Questions _javascript_ FAQ



Change Notification Preferences

View Online
|
View Changes









[CONF] Apache Tapestry > Component Events FAQ

2011-05-17 Thread confluence







Component Events FAQ
Page  added by Howard M. Lewis Ship

 

 


   
Change Notification Preferences
   
   View Online