-
1. Re: rich:dataTable, action not fired after using browser back button
christian.yttesen Mar 25, 2011 10:52 AM (in response to christian.yttesen)I've put together a simple war illustrating this issue.
You may download it here: http://ge.tt/7P1Er4r (source included).
Deploy to your app-server (verified on Resin/Tomcat) and access /browserback context.
Click on one of the "Show date" buttons:
Instead of using the "< Back to dates" button hit your browser back button (or ALT + Arrow-Left) irregardless of which other button you click on (on the dates listing) you will always see the first selected date.
The managed-bean is SessionScoped.
NB: If I change the scope to RequestScope - it solves the problem - but I would prefer not doing this as it require additional managed-beans for my application.
UPDATE: Tried pushing in a RequestScope bean in my application - for the navigation part - didn't make a difference :-(.
Any suggestions, hint, ideas are highly appreciated (also workarounds)?
Regards,
Christian
-
3. Re: rich:dataTable, action not fired after using browser back button
christian.yttesen Mar 29, 2011 1:34 AM (in response to christian.yttesen)A temporary fix has been to configure a "no-cache" phaselistener doing this:
// HTTP 1.0
response.setHeader("Pragma", "no-cache");
// HTTP 1.1
response.setHeader("Cache-Control", "private, no-store, no-cache, must-revalidate, max-stale=0");
// IE's HTTP 1.1
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
// prevents caching at proxy server
response.setDateHeader("Expires", 0);This seems to insure that the user is warned about "expired" content when clicking the back-button - and hence forced to reload the page.
Anybody tried to download the war archive and reproduce it?
// HTTP 1.0
response.setHeader("Pragma", "no-cache");
// HTTP 1.1
response.setHeader("Cache-Control", "private, no-store, no-cache, must-revalidate, max-stale=0");
// IE's HTTP 1.1
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
// prevents caching at proxy server
response.setDateHeader("Expires", 0); -
4. rich:dataTable, action not fired after using browser back button
nbelaevski Mar 29, 2011 12:41 PM (in response to christian.yttesen)Hi Christian,
You have sort of this problem: http://community.jboss.org/wiki/CommonAjaxRequestsProblems#conditionalRendering
Remove all 'rendered' attributes and your applciation will work as expected.
-
5. Re: rich:dataTable, action not fired after using browser back button
christian.yttesen Mar 30, 2011 3:06 AM (in response to nbelaevski)Hi Nick,
Thanks for the feedback - it surely makes a difference removing the rendered attributes that conditionally displays either the list or the selected instance.
The solution for my application was to move the "rendered" logic to the <h:form> tag - thus having two forms on my page instead of only one.
<f:view> <h:form rendered="#{not myManagedBean.editMode}"> ... </h:form> <h:form rendered="#{myManagedBean.editMode}"> ... </h:form> </f:view>
Again thanks a lot for pointing me in the right direction.
Regards,
Christian
-
6. Re: rich:dataTable, action not fired after using browser back button
nbelaevski Mar 30, 2011 4:22 AM (in response to christian.yttesen)When you press back button, value of 'myManagedBean.editMode' stays true, so controls in the first form are not processed. Use a4j:keepAlive instead.
-
7. Re: rich:dataTable, action not fired after using browser back button
nbelaevski Mar 30, 2011 4:22 AM (in response to nbelaevski)Conversation scope will also work.
-
8. Re: rich:dataTable, action not fired after using browser back button
christian.yttesen Mar 30, 2011 7:08 AM (in response to nbelaevski)OK as it is now it seems not to be a problem that the controls is not (re)processed when pressing back button - I will keep in mind the use of a4j:keepalive.
Conversation scope isn't that a "SEAM only" concept?
-
9. Re: rich:dataTable, action not fired after using browser back button
nbelaevski Mar 30, 2011 8:19 AM (in response to christian.yttesen)Yes, Seam or Weld.