Re: Checking if user has left the page or refreshed it
Be aware that the referer header is unreliable. It is frequently blocked by proxies, and in the case of SSL I believe it is (usually? always?) not present. On Tue, Mar 5, 2013 at 3:58 PM, bhorvat horvat.z.bo...@gmail.com wrote: Cool I will then try what you suggested. The pageReset event looks to be perfect for what I need -- View this message in context: http://tapestry.1045711.n5.nabble.com/Checking-if-user-has-left-the-page-or-refreshed-it-tp5720332p5720364.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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
Checking if user has left the page or refreshed it
Is there any way to check if the user has just refreshed a page (in this case I would like to keep all of the fields persistent) or if it has come to the page from some other place (in this case I want to have a clear start). Basically I have some checkboxes that I want to keep in memory what has been selected. Once a user submits a form/or simple refreshes something I dont want to clear the checkboxes but if it come from a different page I want to have them cleared. I am aware of the methods like onPasivate and onActivate but can I somehow distinguish between those 2 events. Cheers -- View this message in context: http://tapestry.1045711.n5.nabble.com/Checking-if-user-has-left-the-page-or-refreshed-it-tp5720332.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Checking if user has left the page or refreshed it
I think you can use pageReset event to clear the checkboxes. It is called when user come from another page. This is copy paste from http://blog.tapestry5.de/index.php/2010/08/11/tapestry-5-2-preview/ A page is reset when the page is accessed from another page; component event links and page render links that target the same page do not cause a reset, but linking from one page to another will cause a reset on the destination page when it is rendered. The reset lifecycle event occurs after page activation, allowing the page to reset its internal state to the match its activation context. Note that on pages that have such reset logic will have an additional query parameter added to the page render URL in some cases. Best regards, Yohan Yudanara On Tue, Mar 5, 2013 at 4:42 AM, bhorvat horvat.z.bo...@gmail.com wrote: Is there any way to check if the user has just refreshed a page (in this case I would like to keep all of the fields persistent) or if it has come to the page from some other place (in this case I want to have a clear start). Basically I have some checkboxes that I want to keep in memory what has been selected. Once a user submits a form/or simple refreshes something I dont want to clear the checkboxes but if it come from a different page I want to have them cleared. I am aware of the methods like onPasivate and onActivate but can I somehow distinguish between those 2 events. Cheers -- View this message in context: http://tapestry.1045711.n5.nabble.com/Checking-if-user-has-left-the-page-or-refreshed-it-tp5720332.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Checking if user has left the page or refreshed it
The only thing I can think of is to check the referer header in the request. If its not from this page, you can clear all the persistent fiends in setupRender On Mar 4, 2013, at 3:42 PM, bhorvat horvat.z.bo...@gmail.com wrote: Is there any way to check if the user has just refreshed a page (in this case I would like to keep all of the fields persistent) or if it has come to the page from some other place (in this case I want to have a clear start). Basically I have some checkboxes that I want to keep in memory what has been selected. Once a user submits a form/or simple refreshes something I dont want to clear the checkboxes but if it come from a different page I want to have them cleared. I am aware of the methods like onPasivate and onActivate but can I somehow distinguish between those 2 events. Cheers -- View this message in context: http://tapestry.1045711.n5.nabble.com/Checking-if-user-has-left-the-page-or-refreshed-it-tp5720332.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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