javanaut
10-29-2003, 01:02 PM
What I want to do is quite simple. Given a Redmond windowtext component I want to clear the initial value of the text in the text field. Here's a code snippet which does not work:
<canvas debug="true">
<method name="showText">
debug.write('Got a click or something');
var myText = ourFld.getText();
debug.write(myText);
ourFld.setText("");
</method>
<windowtext id="input" name="ourFld" x="100" y="60" text="Hello" width="200" clickable="true" onclick="canvas.showText()">
</windowtext>
</canvas>
I have also tried using:
a) onclick="this.clearText()" since WEB-INF\lps\components\redmond\redmondinputtext.lzx shows that there is such a method;
b) onclick="this.setText('')"
c) placing the method "inline" with the windowtext component and using onclick="this.showText()"
I can't think of any other way of doing it. Am I doing something fundamentally wrong? Am I trapping for the wrong event? It must be obvious. Thanks in advance for your help.
<canvas debug="true">
<method name="showText">
debug.write('Got a click or something');
var myText = ourFld.getText();
debug.write(myText);
ourFld.setText("");
</method>
<windowtext id="input" name="ourFld" x="100" y="60" text="Hello" width="200" clickable="true" onclick="canvas.showText()">
</windowtext>
</canvas>
I have also tried using:
a) onclick="this.clearText()" since WEB-INF\lps\components\redmond\redmondinputtext.lzx shows that there is such a method;
b) onclick="this.setText('')"
c) placing the method "inline" with the windowtext component and using onclick="this.showText()"
I can't think of any other way of doing it. Am I doing something fundamentally wrong? Am I trapping for the wrong event? It must be obvious. Thanks in advance for your help.