Ondřej Čada
2012-04-26 13:17:19 UTC
Hello there,
either setPageRefreshOnBacktrackEnabled does not work, or I am missing something fundamental.
In my "class Application extends ERXApplication" I do "setPageRefreshOnBacktrackEnabled(true)". All the HTTP headers are generated all right, far as I can say:
===
12 ~P/WebObjects> curl -D - <my app URL>
HTTP/1.1 200 Apple
Date: Thu, 26 Apr 2012 13:05:20 GMT
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r
cache-control: private
cache-control: no-cache
cache-control: no-store
cache-control: must-revalidate
cache-control: max-age=0
expires: Sun, 22-Apr-2012 20:37:15 GMT
pragma: no-cache
set-cookie: wosid=YCGjnZm0l4GhkbB33k27C0; version="1"; path=/cgi-bin/WebObjects/CEBOIS.woa
set-cookie: woinst=1; version="1"; path=/cgi-bin/WebObjects/CEBOIS.woa
connection: close
content-length: 5452
MS-Author-Via: DAV
Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
...
===
In my session there is "SomeClass foo".
In one of my pages, there is (essentially) this:
===
<wo:if condition=$session.foo> OK <wo:str value=$session.foo.title/> </wo>
<wo:else>
<wo:hyperlink action=$selectFoo1>Foo1</wo>
<wo:hyperlink action=$selectFoo2>Foo2</wo>
</wo>
===
with the actions trivial "WOComponent selectFoo1() { session().foo=foo1; return null; }" and similar with Foo2. (There is also a "select Foo" action in the OK part which does session().foo=null, but that's not important here, it works perfectly.)
It works perfectly -- till I use backtrack. With backtrack, it goes all wrong :(
1. page is opened, shows "Foo1 Foo2"
2. "Foo1" is clicked, shows correctly the "OK Foo1.title" contents
3. back button is used --> oops, shows again "Foo1 Foo2"!
Here I probably am missing something -- given I have set pageRefreshOnBacktrackEnabled=true, it should show still OK, since my session still contains non-null foo, should it not?
Anyway, seems no part of my application gets activated at this moment; not even appendToResponse logs anything.
4. "Foo2" is clicked --> oops, shows again "OK Foo1.title"
whilst none of the selectFoo1/selectFoo2 actions is ever called. appendToResponse is called, though.
What am I missing, and, more important, how to fix the problem? I don't care whether
(a) back keeps showing the "OK Foo1.title" contents (
(b) back goes to "Foo1 Foo2" AND selection works all right.
I've googled out a trick based on contextID comparation, but that one fails with automatic refresh (which it considers to be same as "back") :(
Thanks and all the best,
---
Ondra Čada
OCSoftware: ***@ocs.cz http://www.ocs.cz
private ***@ocs.cz http://www.ocs.cz/oc
either setPageRefreshOnBacktrackEnabled does not work, or I am missing something fundamental.
In my "class Application extends ERXApplication" I do "setPageRefreshOnBacktrackEnabled(true)". All the HTTP headers are generated all right, far as I can say:
===
12 ~P/WebObjects> curl -D - <my app URL>
HTTP/1.1 200 Apple
Date: Thu, 26 Apr 2012 13:05:20 GMT
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r
cache-control: private
cache-control: no-cache
cache-control: no-store
cache-control: must-revalidate
cache-control: max-age=0
expires: Sun, 22-Apr-2012 20:37:15 GMT
pragma: no-cache
set-cookie: wosid=YCGjnZm0l4GhkbB33k27C0; version="1"; path=/cgi-bin/WebObjects/CEBOIS.woa
set-cookie: woinst=1; version="1"; path=/cgi-bin/WebObjects/CEBOIS.woa
connection: close
content-length: 5452
MS-Author-Via: DAV
Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
...
===
In my session there is "SomeClass foo".
In one of my pages, there is (essentially) this:
===
<wo:if condition=$session.foo> OK <wo:str value=$session.foo.title/> </wo>
<wo:else>
<wo:hyperlink action=$selectFoo1>Foo1</wo>
<wo:hyperlink action=$selectFoo2>Foo2</wo>
</wo>
===
with the actions trivial "WOComponent selectFoo1() { session().foo=foo1; return null; }" and similar with Foo2. (There is also a "select Foo" action in the OK part which does session().foo=null, but that's not important here, it works perfectly.)
It works perfectly -- till I use backtrack. With backtrack, it goes all wrong :(
1. page is opened, shows "Foo1 Foo2"
2. "Foo1" is clicked, shows correctly the "OK Foo1.title" contents
3. back button is used --> oops, shows again "Foo1 Foo2"!
Here I probably am missing something -- given I have set pageRefreshOnBacktrackEnabled=true, it should show still OK, since my session still contains non-null foo, should it not?
Anyway, seems no part of my application gets activated at this moment; not even appendToResponse logs anything.
4. "Foo2" is clicked --> oops, shows again "OK Foo1.title"
whilst none of the selectFoo1/selectFoo2 actions is ever called. appendToResponse is called, though.
What am I missing, and, more important, how to fix the problem? I don't care whether
(a) back keeps showing the "OK Foo1.title" contents (
(b) back goes to "Foo1 Foo2" AND selection works all right.
I've googled out a trick based on contextID comparation, but that one fails with automatic refresh (which it considers to be same as "back") :(
Thanks and all the best,
---
Ondra Čada
OCSoftware: ***@ocs.cz http://www.ocs.cz
private ***@ocs.cz http://www.ocs.cz/oc