Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stateless but get bindings of childs





valueForBinding is to talk with the parent of the component. 


void takeValuesFromRequest(WORequest request, WOContext context) {
super. takeValuesFromRequest(request, context);
Value > Value two = request.formValueForKey("anotherBindingName2");
if(two.isBetterThen(one)) {
setValueForBinding(one, "XYZ");
}
else {
setValueForBinding(two, "XYZ");
}
}
from StatelessParent.wod 
Text1: WOTextField {
text = anotherBinding1;
name="anotherBindingName1"
}
Text1: WOTextField {
text = anotherBinding2;
name="anotherBindingName2"
}

The stuff should work, but I think it's not a good idea to use statefull childs when the parent is stateless. (WOTextField is a statefull child of StatelessParent in your case).
uli

Am 25.07.2007 um 16:21 schrieb Fabrice Pipart:

Unfortunately, this is still not the pattern I have (sorry for being unprecise)
I rather have :

from StatefulParent.wod

StatelessParent: StatelessParent {
XYZ  = "foo";
}

from StatelessParent.wod 
Text1: WOTextField {
text = anotherBinding1;
}
Text2: WOTextField {
text = anotherBinding2;
}
Text3: WOTextField {
text = anotherBinding3;
}

And then in StatelessParent I use the 3 bindings to give back a value to StatefullParent using setValueForBinding
The problem is that anotherBindingX are never set by the text fields and if I do hasBinding("anotherBindingX") in takeValuesFromRequest I get a false answer

Does it seems behavior to you?


Fabrice


On Jul 25, 2007, at 4:03 PM, Ulrich Köster wrote:

During the takeValuesFromRequest

Another option is to use the ^ (carat) binding in your component and forget the stuff in the StatelessParent.java

For instance:

from StatefulParent.wod

StatelessParent: StatelessParent {
XYZ  = "foo";
}

from StatelessParent.wod 

Text: WOTextField {
text = ^XYZ;
}

^ is the same as "bound against my parent". ^ doesn't work for stateful components

Good luck

Uli


Am 25.07.2007 um 15:04 schrieb Fabrice Pipart:

Just what I thought.
The problem is it does not work :(

In which phase do you do that?
Does it work for child components too?

I have something like this :
StatefulParent contains StatelessParent contains TextFields

I use bindings to get the bindings StatefulParent sets. Works fine.
But when StatefulParent submits a form, the values of the text field does not seem to reach StatelessParent

Any idea of what I did wrong?

On Jul 25, 2007, at 1:10 PM, Ulrich Köster wrote:

valueForBinding() to get the value and setValueForBinding() to push the value

Uli


Am 25.07.2007 um 12:44 schrieb Fabrice Pipart:

Hi !

If I have a stateless component (no variable synchronization) that has for example text fields in it, it seems I never get the values of my text fields in my stateless component. I suppose they are not pushed to the parent since it has no automatic synchronizaion.
Is there a way to manually get those values during the R-R loop ?
Or I'd better turn automatic synchronization on again keeping my component stateless (I need it stateless)?


Regards

Fabrice

EasyMediaOnline
Digital Signage Software

Easyshadow
Palais de la Scala
1 avenue Henri Dunant
Suite 1155
MC - 98000 Monaco

Skype: fabrice.pipart
Tel.  +377 97 98 21 04 (direct)
Fax. +377 97 70 88 07



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/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



EasyMediaOnline
Digital Signage Software

Easyshadow
Palais de la Scala
1 avenue Henri Dunant
Suite 1155
MC - 98000 Monaco

Skype: fabrice.pipart
Tel.  +377 97 98 21 04 (direct)
Fax. +377 97 70 88 07




 _______________________________________________
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



EasyMediaOnline
Digital Signage Software

Easyshadow
Palais de la Scala
1 avenue Henri Dunant
Suite 1155
MC - 98000 Monaco

Skype: fabrice.pipart
Tel.  +377 97 98 21 04 (direct)
Fax. +377 97 70 88 07




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/email@hidden

This email sent to email@hidden

References: 
 >Stateless but get bindings of childs (From: Fabrice Pipart <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.