whisperstorm
09-24-2003, 06:33 PM
I'm sure I'm going to smack my head when I hear what I'm doing wrong, but for some reason I simply cannot get the text of this element to change via js...
<canvas debug="true">
<simplelayout axis="y"/>
<windowtext name= "consolewindow" id="consolewindow" height="200" width="400" text="hello there"/>
<button onclick="changeText('hello');">
Move <b>me</b>
<method name="changeText" args="theText">
Debug.write(consolewindow.text);
Debug.write("trying to set text:" + theText);
consolewindow.setAttribute('text',theText);
</method>
</button>
</canvas>
I've tried several variations, where the text is a child of the windowtext and other things, and I can see in the debugger that that value of consolewindow.text has changed, but the view of the consolewindow still has the old text.
<canvas debug="true">
<simplelayout axis="y"/>
<windowtext name= "consolewindow" id="consolewindow" height="200" width="400" text="hello there"/>
<button onclick="changeText('hello');">
Move <b>me</b>
<method name="changeText" args="theText">
Debug.write(consolewindow.text);
Debug.write("trying to set text:" + theText);
consolewindow.setAttribute('text',theText);
</method>
</button>
</canvas>
I've tried several variations, where the text is a child of the windowtext and other things, and I can see in the debugger that that value of consolewindow.text has changed, but the view of the consolewindow still has the old text.