Re: R-R Loop Oddities
Re: R-R Loop Oddities
- Subject: Re: R-R Loop Oddities
- From: Kieran Kelleher <email@hidden>
- Date: Sat, 25 Jun 2005 07:50:50 -0400
The behaviour you are seeing may be automatic binding synchronization.
If the value being set is related to a binding on the component, then
automatic binding synchronization happens automatically at the
beginning and end of each phase of the R-R loop. So bindings are pushed
and pulled six times in total during the R-R loop. This can cause
undesired behaviour in subcomponents. If this is the case for you, then
it is recommended practice in general to always turn off automatic
synchronization (see synchronizesVariablesWithBindings() in
WOComponent) in subcomponents and use lazy initialization with
valueForBinding("bindingName") to pull bindings and setValueForBinding(
..., ... ) to push back up to parent component.
/** Returns false to turn off automatic binding synchronization */
public boolean synchronizeVariablesWithBindings() {
return false;
}
For example, let's say I have a binding called "trader" bound to an
object of type CTTrader:
public CTTrader trader()
{
if ( _trader == null ) {
_trader = (CTTrader)valueForBinding("trader");
}
return _trader;
}
HTH,
-Kieran
________________________________________________________________
Blog: http://webobjects.webhop.org/
On Jun 25, 2005, at 6:13 AM, Greg wrote:
In a component I am having some odd problems that I cannot figure out
why it is happening. I have logged each part of the RR loop to try and
figure out why it is occurring. What I don't understand is why it is
taking a value after it has returned from the method (finding images),
and before it has entered the appending to response. Does anyone know
why this would be occurring and how I would go about fixing it?
Any help is greatly appreciated.
Regards,
Greg
ConsumerViewAlbums (ConsumerViewAlbums.java:88) - taking values from
request
ConsumerViewAlbums (ConsumerViewAlbums.java:554) - taking value:
{tags = (); image =
"56e6d5cd-cb64-4f43-be75-96c3adfe1d28/88317503-1bce-47cf-9244-
cc52b577eb55.jpg"; } for key: imageTagsDict
ConsumerViewAlbums (ConsumerViewAlbums.java:554) - taking value: null
for key: imageTagsDict
ConsumerViewAlbums (ConsumerViewAlbums.java:554) - taking value: Greg
for key: searchString
ConsumerViewAlbums (ConsumerViewAlbums.java:546) - invoking action
ConsumerViewAlbums (ConsumerViewAlbums.java:554) - taking value:
{tags = (); image =
"56e6d5cd-cb64-4f43-be75-96c3adfe1d28/88317503-1bce-47cf-9244-
cc52b577eb55.jpg"; } for key: imageTagsDict
ConsumerViewAlbums (ConsumerViewAlbums.java:554) - taking value:
null for key: imageTagsDict
ConsumerViewAlbums (ConsumerViewAlbums.java:596) - finding images
ConsumerViewAlbums (ConsumerViewAlbums.java:558) - setting image set
to 0 images
ConsumerViewAlbums (ConsumerViewAlbums.java:563) - setting image set
title: Search Results for: Greg
ConsumerViewAlbums (ConsumerViewAlbums.java:615) - finished finding
ConsumerViewAlbums (ConsumerViewAlbums.java:554) - taking value:
Holidays for key: setTitle
ConsumerViewAlbums (ConsumerViewAlbums.java:563) - setting image set
title: Holidays
ConsumerViewAlbums (ConsumerViewAlbums.java:548) - invoked action
ConsumerViewAlbums (ConsumerViewAlbums.java:75) - appending to
response
_______________________________________________
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