on 12-10-2004 12:35 PM
Hi Guys,
I am not able to read text entered into the TextEdit box.
Here is the code which I am using.
-
TextEdit TE1 = (TextEdit) this.getComponentByName("TextEdit1");
strTE1 = TE1 .getText();
-
On the second line I get a null pointer exception.
Thanx,
sk
Hi try this one
TextEdit TE1 =(TextEdit)this.getComponentByName("TextEdit1");
textEdit =TE1.getValueAsDataType().toString();
Regds,
Anto Lawrance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
your problem in fact is: You are not able to retrieve the TextEdit element. See: TE1.getText(); throws a NullPointerException, ie TE1 is null. So the getComponentByName call didn't return what you expected.
Check where you have put this code - within a onXXX method? At least, within a method called after JSP has been rendered?
If yes, check the ID of the TextEdit element ("TextEdit1") against the string you have used within your JSP.
Hope it helps
Detlev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.