Re: A method only refered to in the wod-file is called during invokeAction
Re: A method only refered to in the wod-file is called during invokeAction
- Subject: Re: A method only refered to in the wod-file is called during invokeAction
- From: Chuck Hill <email@hidden>
- Date: Tue, 10 May 2005 12:37:41 -0700
On May 10, 2005, at 12:35 PM, Kaj Hejer wrote:
On 10. mai 2005, at 17.35, Chuck Hill wrote:
But... this method is also called during invokeAction when I click a
link in the WORepetition that iterate over this array.
Yes, of course it is. The entire template is evaluated, with full
binding synchronization, at each of the three phases takeValues,
invokeAction, appendToResponse. takeValues is skipped if there is no
form submitted. See pages 201 to 207 in "the book" :-) for more
details.
Ofcource... :) My mind just wasn't thinking about that this also goes
for all dynamic element, not just subcomponents.
btw: I have "The Book" at work, but I will take a look there tomorrow.
"The Book" lives together with the other "must have" books I have like
"The Green Book" ("Planning Extreme Programming",
<http://www.amazon.com/exec/obidos/ASIN/0201710919>)
The link is bound to a method where the currentItem for the
repetition is accessed like
public WOComponent doMyStuffWithCurrent() {
...
nextPage.setSelectedIdem(currentItem);
return nextPage;
}
A cardinal rule of methods called for binding synchronization is
"Thou shalt not have side effects".
:) The only sideeffecr from our getMyListElements is that is takes
some time to fetch the stuff from the database. I guess the solution
here is to just cache the array so we don't have to fetch it more than
once...
Yes, that is another good solution.
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