On Jul 25, 2007, at 7:41 AM, Ulrich Köster wrote:


valueForBinding is to talk with the parent of the component.


void takeValuesFromRequest(WORequest request, WOContext context) {
        super. takeValuesFromRequest(request, context);
        Value one = request.formValueForKey("anotherBindingName1");
        Value two = request.formValueForKey("anotherBindingName2");
        if(two.isBetterThen(one)) {

LOL!

                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.

I think it is, in fact, forbidden and WO will give you an error if you try this.


(WOTextField is a statefull child of StatelessParent in your case).

Hold on Uli.  WOTextField is a WODynamicElement and hence stateless.

Chuck


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

www.easyshadow.com
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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/ ulrich.koester%40assense.com

This email sent to [EMAIL PROTECTED]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/fabrice% 40easyshadow.com

This email sent to [EMAIL PROTECTED]



www.easyshadow.com
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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/fabrice% 40easyshadow.com

This email sent to [EMAIL PROTECTED]



www.easyshadow.com
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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill% 40global-village.net

This email sent to [EMAIL PROTECTED]

--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to