3.14
04-26-2004, 12:17 PM
hi
i'm trying to do some very simple data binding: i want to constrain a text component's label with a global string variable.
but the following code doesn't work (the text component always displays 'not ok'....): can someone explain me why?
##################
CODE
##################
<canvas width="800" height="500" title="Test binding">
<script>
dtp="not ok";
function choose(){dtp="ok";}
</script>
<simplelayout axis="y"/>
<button onclick="choose();">Go</button>
<text text="$always{dtp}" width="200"/>
</canvas>
i'm trying to do some very simple data binding: i want to constrain a text component's label with a global string variable.
but the following code doesn't work (the text component always displays 'not ok'....): can someone explain me why?
##################
CODE
##################
<canvas width="800" height="500" title="Test binding">
<script>
dtp="not ok";
function choose(){dtp="ok";}
</script>
<simplelayout axis="y"/>
<button onclick="choose();">Go</button>
<text text="$always{dtp}" width="200"/>
</canvas>