Re: request-response loop question
Re: request-response loop question
- Subject: Re: request-response loop question
- From: Chuck Hill <email@hidden>
- Date: Mon, 15 Nov 2004 11:52:24 -0800
Tom,
I dislike frames and strive to avoid them. So it may be I am missing
something vital in my comments below, having shoved it from memory.
On Nov 14, 2004, at 1:53 PM, Thomas Woteki wrote:
Thanks much in advance for any help with the following:
I have an array of items, attributes of which I display in a
WORepetition. The list is displayed within a frame in my main page.
One of the attributes is wrapped in a WOHyperlink whose action is to
return a detail page that displays details of the selected item in
another frame, which is the target of the link and also within my main
page. Only the detail page is refreshed upon clicking the link; the
list frame should remain unrefreshed.
Does the hyperlink have a name binding? I burned myself with that
once, long ago.
The problem is this: The first time I click on the link for any item
the detail page is properly returned and displayed. However, the
second time I click an item, the detail for the previous item I
clicked is re-displayed, not the selected item. For example, if I
click item 1, its details are displayed. If I then click item 2, its
details are displayed. That's all good. If I then click item 1 again,
item 2 is re-deisplayed, not item 1. In general, once clicked, an item
is never again displayed in the detail frame (unless it happens to be
the last item selected); only a previously unselected item or the last
item selected is displayed, depending on what is clicked.
I have logged the request response loop. The second time I click on a
link, the loop proceeds only to awaken the component which contains
the WOHyperlink, but it never invokes action that is bound to the link
(invokeAction is not called), which is just another way of saying
everything above.
In order to prevent the worst ravages of backtracking, WO caches URLs
and responses. If a previously processed URL is requested, the page is
awoken and appendToResponse run. That sounds to me like what is
happening in your case. Here are some ideas on a solution:
- disable this backtracking protection. At the very least, this is a
quick way to prove or disprove my theory. See the WOApplication method
setPageRefreshOnBacktrackEnabled
- it sounds like your action method is not returning a new component
instance (e.g. doing a pageWithName), but instead returning the same
instance configured to display a different object. While this
conserves memory, it can conflict with the multiple state caching of
WO's backtrack refreshing. If you always return a new instance this
should go away.
- integrate a form value into the URL and check this in
appendToResponse, and update the selected object if needed. This seems
rather hackish, but it might work
Chuck
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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