cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with reading data from textEdit (htmlB)

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi try this one

TextEdit TE1 =(TextEdit)this.getComponentByName("TextEdit1");

textEdit =TE1.getValueAsDataType().toString();

Regds,

Anto Lawrance

detlev_beutner
Active Contributor
0 Kudos

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