• 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: Mon, 14 Feb 2005 12:05:55 -0500

I would need more time to get you a full answer on your specific situation, but I can already say that WORepetition need to syncronize because of what we expect from it.
It's the magic of worepetition to give us a context that is valid for the 'current' enumerated item, to implement that magic, it need to syncronize a lot to make sure it's in sync.


- jfv

Le 05-02-14, à 11:47, Jacky Gagnon a écrit :

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


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: Jacky Gagnon <email@hidden>)

  • Prev by Date: Re: Problems with manual synchronization of variable
  • Next by Date: Classpath
  • Previous by thread: Re: Problems with manual synchronization of variable
  • Next by thread: Re: Problems with manual synchronization of variable
  • Index(es):
    • Date
    • Thread