Manual syncing question
Manual syncing question
- Subject: Manual syncing question
- From: Miguel Arroz <email@hidden>
- Date: Fri, 15 Sep 2006 01:19:01 +0100
Hi!
I'm trying to follow the advice I received on WWDC from
experienced people to avoid using components that auto-synch their
values (ie, the normal way WO works). I was open to this suggestion
because I was having some problems that were clearly related to auto-
syncing.
So, I'm trying to make some subcomponents that do not use auto-
sync. It works great for some stuff (like binding actions, yahoo!)
but there are some other stuff that I guess I'm not doing right.
Imagine I have on the top component an object, say, an User. I
want to bind the User object to a subcomponent inside the top
component. The subcomponent does not auto-sync.
So, I override the synchronizesVariablesWithBindings method on the
subcomponent, and I create a method, called user:
public User user() {
return (User)valueForBinding(USER_BINDING_NAME);
}
Well, but this is stupid. I'm actually doing a lot more work (with
valueForBinding) than what was done on auto-synch. Every time I
access the user, WO goes and grabs the binding. This is a waste of
cycles and does not solve one of the problems that lead me to try to
write non-auto-synching componentes - to control exactly when is the
stuff synced.
I thought about using the subcomponent constructor, but I tested,
and when I regenerate the page with another user (imagine I click on
a "Next" link that shows me another user, but the parent component
it's the same - the method binded to the link returns null) WO
apparently re-uses the subcomponent too, so no constructor is called.
So... basically... how do you solve this?
<Waiting for a one line reply with a really obvious answer that I
totally missed>
Yours
Miguel Arroz
"The world lies in the hands of evil
And we pray it would last" -- Apocalyptica, Life Burns!
Miguel Arroz
http://www.ipragma.com
_______________________________________________
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