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

TextEdit UI element text area line separation


I have a scenario where user has to input some data in a text area field and submit it.

Upon submission that data is to be displayed on different view as normal text.

I have used TextEdit UI element for this purpose and bound it to context attribute variable of type String.

Now when user enters Data in below format in textedit filed :

Line1 comes here,
Line2 goes here.

and press submit button,

It gets displayed in below format :

Line1 comes here,Line2 goes here.

But it should have got displayed in format in which user entered this data...i.e. with that line separation....

How can I make this possible.

Thanking you in anticipation

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 18, 2011 at 07:21 AM


    I think you will have to insert a new line character explicitly in the attribute you use to store the text edit data (say TEdata)

    Declare a String and set its value to TEdata.

    Now iterate over the string and find the ASCII value of each character that has been typed and wherever it corresponds to an Enter , insert a new line character.

    Once done , assign the value of this string to TEdata.

    Hope this helps.



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Well I was wrong...

      TextEdit actually parses the new line character...

      The problem was that, I was trying to display text in HTML I feel it was not able to parse the "\r\n"

      Thus I need to replace occurances of \r\n with BR.

      Edited by: Saurabh Agarwal on Apr 18, 2011 10:57 AM

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.