You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ken nashua <nh...@hotmail.com> on 2007/10/26 20:25:34 UTC

how to bind script variables to component property

Folks,
 
Can someone provide some snippet on how to bind a script routine variable to a component property?
 
For instance I have this...
 
<input-symbol key="component" class="org.demo.myComponent"
    required="yes" />
<let key="myForm">document.forms[0]</let>
<let key="myWidth" unique="yes">inlineMyWidth</let>
 
The component has one properties myWidth.
 
So I want to ask dojo for the forms width and bind it to my respetive component property.
 
var componentObjectCB = dojo.html.getContentBox(${myForm});
 
${myWidth} = Math.abs(componentObjectCB.width);
 
Do I perform the bind like this?
tapestry.bind("${component.mywidth}", "${myWidth}");
 
Can someone tell how to bind back to the server component object property?
 
Thanks in advance.Best regards Ken in nashua
_________________________________________________________________
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews