WebObjects Tips
 
Wednesday, May 24, 2006
Passing Through Bindings
 
If you have a component that manually pulls its values out of the bindings, if you have a ^ in front of a value name in a .wod file, that tells webobjects to look for that value in the bindings where the component is used. That is:
value = ^ value;
in a component’s .wod file, will let you pass through bindings without having to add accessors or instance variables. This makes it easy to pass through any options on your sub-components out to clients of your component.
This need not be a declared binding. Since WebObjects will pass through any declaration on a basic dynamic element through to the HTML, any HTML attribute can be used as a setting. You can even change names as you pass them through, so that you can have:
height= ^imageHeight;
So the binding for your component will be “imageHeight=10” but it will be written into the HTML as height=”10”.