• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problems with manual synchronization of variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with manual synchronization of variable


  • Subject: Re: Problems with manual synchronization of variable
  • From: Jean-François Veillette <email@hidden>
  • Date: Tue, 15 Feb 2005 08:51:33 -0500

My bad, sorry, I'm not sure what I'was thinking, I won't even try to explain, but ... if in doubt, trust Anjo ;-)
Once the brain get working again, I'll get back on the forum.


- jfv

Le 05-02-14, à 12:21, Anjo Krank a écrit :

Gosh,

so many errors, so little time:)

Am 12.02.2005 um 14:27 schrieb Jean-François Veillette:

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.

This is wrong. Form values are always pushed. Repetition values are always pushed. At least into the direct parent.


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).

What does *not* happen is that a parent pushes its values on each stage in the RR loop into the child component and vice-versa. So if that's what you mean with "Inter-Component synchronization", synchronizesVariablesWithBindings() exists to prevent exactly that. So basically you get a chance to step in and pull this binding only once for all three phases.


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.

You shouldn't use parent().getFoo() or parent().setFoo() in a component. This makes for terrible reuse. Rather use this.valueForBinding("foo") and this.setValueForBinding(x, "foo");


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.

However, it's not there and not mutable until you actually set or initialize it to a NSMutableDictionary.


and finally:

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.

Before invokeAction, takeValuesFromRequest is called and this may or may be what tells your component to pull the bindings. That's all I can say until you post some more info.


Cheers, Anjo

PS: you might check if you spelled the method correctly... it's "synchronizesVariablesWithBindings"



_______________________________________________
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


References: 
 >Problems with manual synchronization of variable (From: Jacky Gagnon <email@hidden>)
 >Re: Problems with manual synchronization of variable (From: Jean-François Veillette <email@hidden>)
 >Re: Problems with manual synchronization of variable (From: Anjo Krank <email@hidden>)

  • Prev by Date: Re: Direct Action App Editing Context management?
  • Next by Date: Web page design in WO
  • Previous by thread: Re: Problems with manual synchronization of variable
  • Next by thread: develop java client with XCode
  • Index(es):
    • Date
    • Thread