Skip to Content
author's profile photo Former Member
Former Member

Problem with reading data from textEdit (htmlB)

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Dec 10, 2004 at 03:25 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2004 at 09:45 AM

    Hi try this one

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

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

    Regds,

    Anto Lawrance

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.