Re: Back Button Issues
Re: Back Button Issues
- Subject: Re: Back Button Issues
- From: "Jerry W. Walker" <email@hidden>
- Date: Tue, 18 Apr 2006 01:35:07 -0400
Hi, Jon,
On Apr 18, 2006, at 12:42 AM, Jonathan Miller wrote:
Hi,
I'm certainly guilty of using the appendToResponse method without
understanding its true role in the response generation, so this
could very well apply to me. Since I'm mainly using
appendToResponse to reset counters I use during page generation do
you think I'd be better served by using the sleep() method instead?
Probably not. Recognize that any code you put in the appendToResponse
method prior to its call to super.appendToResponse(...) will be
executed before the page is generated. This tends to be a safe place
to put any code that changes the structure of the page: reset
counters, update arrays, change boolean values, etc.
Once you've executed the super.appendToResponse(...), you've
established the page's structure within which elements will be
identified by elementID. This represents the caution area of your
code which extends through the subsequent takeValuesFromRequest(...)
and up to the call to super.invokeAction(...) within an overridden
invokeAction(...) method.
It might be easier to think of the ReQUest-ReSPonse cycle as a
ReSPonse-ReQUest cycle () as shown tabularly below:
...
appendToResponse() {
{
END SAFE ZONE...
super.appendToResponse();
CAUTION ZONE...
}
sleep()
awake()
takeValuesFromRequest()
invokeAction()
{
END CAUTION ZONE...
super.invokeAction();
SAFE ZONE...
}
...
The call to WOComponent's invokeAction (or, if you override it, your
call to super.invokeAction() in your overriding method) is the last
place that the page template will be built to identify elements by
elementID based on the structure established by the preceding
appendToResponse. Once your action method is called, you can play
most any games you wish with the page's structure. You're in the safe
area of your code again.
An overridden sleep() method (as you can see above) would fall
between the appendToResponse and the subsequent
takeValuesFromRequest, so it would definitely be in the caution zone,
as would the following awake method.
If any of your accessor methods that is triggered by a binding to a
form element needs to change anything that would change the page
structure, it is generally best instead to set some instance variable
that you can later test in your appendToResponse so you can make the
structural change there just prior to your super.appendToResponse().
Of course, the two most common ways to dynamically change the
structure of the page are:
* change the size of a table (or an index) on which a WORepetition
depends.
* change a boolean value (or expression) on which a WOConditional
depends.
Recognize that changing the values of displayed variables or the text
of WOStrings might change the appearance of the page, but won't
change its logical structure. It's the logical structural changes
that you have to watch out for.
Regards,
Jerry
thanks again
Jon
On Apr 17, 2006, at 5:26 PM, Jerry W. Walker wrote:
Hi, Jonathan,
I don't know what the abbreviation "w/n" means in your second
sentence, so your message is a little difficult to parse, but it
doesn't sound like you're facing a page caching issue (except,
perhaps, indirectly).
Performing the wrong action tends to be a characteristic of the
structure of a page changing between the appendToResponse that
generates the page and the invokeAction triggered by the generated
page.
If the page's structure includes a WORepetition that depends on an
array that changes size between the time you generate the page and
when the WOHyperlink is activated, that could cause the problem.
For more information on this issue, take a look at:
http://www.wodeveloper.com/omniLists/webobjects-dev/2005/April/
msg00023.html
HTH.
Regards,
Jerry
On Apr 17, 2006, at 2:34 PM, Jonathan Miller wrote:
Hi,
I'm following Apple's Guidelines on setting up server side page
caching (i.e. setPageRefreshOn... && setPageCacheSize(int)) but
it doesn't seem to be working...
e.g. when someone hits the back button and then uses a
WOHyperlink w/n the page it performs the wrong action.
Does anyone have some wisdom they can share in regards to this?
Thank you
Johnny
--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial
Strength Internet Enabled Systems
email@hidden
203 278-4085 office
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden