Re: RR loop confusion....
Re: RR loop confusion....
- Subject: Re: RR loop confusion....
- From: Florijan Stamenkovic <email@hidden>
- Date: Wed, 27 Jul 2005 00:19:44 +0200
On Jul 26, 2005, at 06:37, Jerry W. Walker wrote:
Hi, Florijan,
First of all Jerry, thank you for the very, very illuminating reply. I
have read it several times, along with the Secret Life of Components,
which I failed to grasp the consequences of the first time I went
through it. Things indeed are much clearer now...
The longer answer is that for EACH PHASE of the RR loop, WO builds an
HTML tree graph of the page called the component template. The nodes
on this tree are the WOComponents (subcomponents), WODynamicElements
and the chunks of static HTML that intervene. When
takeValuesFromRequest is sent to WOApplication, it sends it on to
WOSession who passes it on to the root of this template. The root
passes it on to each of its children and so on recursively in a depth
first transit of the entire tree.
And thereby it needs to resolve the repetition, and thereby the
repetition list binding gets accessed in those phases as well... Clear
now.
A similar sequence occurs with appendToResponse. The template is
generated, each node is visited and each appends its piece to the HTML
response.
Yup, and at that point no values are being pushed, and no actions to be
invoked, so the changes made to the template opposed to the one from
the previous appendToRespose do not make problems, right?
One other point to make here is the absolute need to avoid any side
effects that would change the structure of the component template from
the page's initial appendToResponse until the subsequent
takeValuesFromRequest and invokeAction for that page both complete. If
anything would cause that structure to change (such as changing the
boolean value on which a WOConditional depends, or changing the size
of an array over which a WORepetition increments), then some elements
in the component template will be given the wrong component ID, so
they will act on the wrong values. This is a common and PERNICIOUS
error in WO applications.
So, I should not be changing the values that directly control the
template structure through forms, but only in the actual component
methods invoked. As I see it, the solution would be to use temporary
variables to take the form values and push them over in the method.
Will try it.
It sounds like this is the problem you're having as you've outlined in
your "Skippable details:" section.
Yup, the templates get generated but the component has only a part of
values ready which gives nasty results. I actually got a key method
returning an array trying to generate an NSRange which would start at
2160 and should contain -2000 or something items. :(
Hope this helps.
Very much. Thanks again to all who replied,
Flor
_______________________________________________
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