cancel
Showing results for 
Search instead for 
Did you mean: 

TextEdit UI element text area line separation

Former Member
0 Kudos

Hello,

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Saurabh,

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.

Regards,

Himanshu

Former Member
0 Kudos

Sounds logical...

Will do it in similar way...

But again I feel SAP should have handled the same in TextEdit UI element.

Former Member
0 Kudos

Well I was wrong...

TextEdit actually parses the new line character...

The problem was that, I was trying to display text in HTML page....so 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

Answers (0)