Re: Semantics of ^ in value bindings in .wod file.
Re: Semantics of ^ in value bindings in .wod file.
- Subject: Re: Semantics of ^ in value bindings in .wod file.
- From: Anjo Krank <email@hidden>
- Date: Sat, 29 Dec 2007 20:14:49 +0100
Am 29.12.2007 um 18:57 schrieb Archibal Singleton:
^foo in the wod is the same as parent().valueForBinding("foo") in
java
parent.foo in the wod is the same as parent.valueForKey("foo") in
java
The first line requires a parent with foo bound. The second line
requires a variable or method named foo.
Thanks for the clarification Uli, the nuance is indeed important and
I didn't get it at first.
It's important and unfortunately is not quite right. Assume your
parent java has:
public String hello() {return "Hello"}
The parent wod has
MySub : MySub {
foo = hello;
}
The child MySub has:
MyFoo : WOString {
value = ^foo;
}
Then you get whatever your parent has bound against the child
instance's "foo" binding. This is NOT the same as
parent().valueForBinding("foo"), which would get what the parent of
the parent of MySub had bound to "foo".
It mainly a shortcut so you don't have to write in the child java:
public Object foo() {return valueForBinding("foo")}
and in the child wod:
MyFoo : WOString {
value = foo;
}
I'm normally not picky about stuff, but this IS an important concept
and in particular valueForKey() and valueForBinding() can be hard to
tell apart...
Cheers, Anjo
_______________________________________________
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