Re: Problems with manual synchronization of variable
Re: Problems with manual synchronization of variable
- Subject: Re: Problems with manual synchronization of variable
- From: Jacky Gagnon <email@hidden>
- Date: Mon, 14 Feb 2005 11:47:23 -0500
Hi Jean-François,
if by non-synchronized component, you mean the
'synchronizeVariablesWIthBinding(){return false;}, then what it really
mean is that it won't push <form> elements values from the request to
your bound variables.
Yes, I mean 'synchronizeVariablesWIthBinding(){return false;} by non
synchronized component;
In my parent component I hold an filtered array for the time of the
request-response loop; I clear this attribute when awake is called.
In this component I use 2 subcomponents : a child component who display
the content of the array (A), and another one who display the
navigation bar (B; next, previous button); the problem occur only if
the user use the navigation bar under the component A :
parent component
-------------------------
B Navigation bar 1 (previous, next button; stateless) <== run ok
A Display component (display the filtered array, stateless)
B Navigation bar 2 (previous, next button, stateless) <== the problem
is when this sub component invoke an action
--------------------------
When the user click the next button :
1. The filtered array is set to null in awake;
2. Invoke action is called in subcomponents A
3. The variable of the WORepetition inside subcomponents A are
synchronized (not by me!);
4. The method getFilteredArray is called for the first time by the
WORepetition : the filtered array is stored with old value.
5. Invoke Action is called in subcomponent B and the NEXT action is
invoked the non filtered array is change.
6. getFilteredArray is called again but return the filtered array with
old data (see step 4)
7. The user see the same data again.
I was assuming than getFilteredArray cannot be called before the NEXT
Action (step 5), but I was wrong. Why the WORepetition need to
synchronize his bindings when invoke action is called? I think
appendToResponse would be a better place for reinitializing my
attribute (because the invokeAction phase is terminated).
Thanks
Jacky
On 05-02-12, at 08:27, Jean-François Veillette wrote:
Inter-Component synchronization are always running, before / after
each of RR-Loop. This is to give you the right context (wo-repetition
make synchronization even more often).
If in your sub-component, you make direct call to
parent().setSomething(...), then this will most likely fail if the
parent.something is bound to a variable that will get synchronized
later.
I had this problem a while ago, and if I remember correctly, the
design of the component interaction was not 'complliant' with WO. So
I had to redesign the component interaction.
To help you in more details, I would need more info on your code
and/or context of use.
Note that if you want to store temporary RR-Loop value you can always
use the context.request.userInfo dictionary, this dictionary will be
valid for the whole request. Your sub-component could store value in
there and your parent could take it from there whenever it need it.
- jfv
Le 05-02-11, à 17:16, Jacky Gagnon a écrit :
Hi,
I have a stateless subcomponent with manual synchronization who
display some results to the user.
I discovered a problem when I invoke an action on a link under this
subcomponent; before my action is invoked, the subcomponent call
valueForBinding for synchronization (after the WORepetition inside it
called invokeAction). After that WebObjects execute the action
invoked by the user and the variables are synchronized again.
This situation cause me some problems because I hold the state of
some attributes in the parent component (for the time of the
request-response loop); I clear the state when awake is called. I
cannot do that if the subcomponent synchronize before some actions
are invoked by the user.
Why valueForBinding in the subcomponent with manual synchronization
is called before my action is invoked?
Thanks!
Jacky
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
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