• 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: Stateless but get bindings of childs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stateless but get bindings of childs


  • Subject: Re: Stateless but get bindings of childs
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 25 Jul 2007 10:05:46 -0700


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@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:
40easyshadow.com


This email sent to email@hidden



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@hidden)
Help/Unsubscribe/Update your Subscription:
40easyshadow.com


This email sent to email@hidden



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@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net


This email sent to email@hidden

--

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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Stateless but get bindings of childs
      • From: Fabrice Pipart <email@hidden>
References: 
 >Stateless but get bindings of childs (From: Fabrice Pipart <email@hidden>)
 >Re: Stateless but get bindings of childs (From: Ulrich Köster <email@hidden>)

  • Prev by Date: Re: Stateless but get bindings of childs
  • Next by Date: Re: Generate DirectAction URL with instance number when there is nosession
  • Previous by thread: Re: Stateless but get bindings of childs
  • Next by thread: Re: Stateless but get bindings of childs
  • Index(es):
    • Date
    • Thread