cancel
Showing results for 
Search instead for 
Did you mean: 

How to expand textarea in table based on content in SAPUI5?

former_member184238
Participant
0 Kudos

Hi,

In my application I have table which is having text area as columns.

When I bind the table to the oData model I am getting data from back end and placing this in text area.

I am getting data in text area with scroll bar.But the problem is when I want to print that form I am not getting total data which is in text area.Simply I am getting data with Scrollbar.

To resolve this , I am using Textview instead of Textarea.Then total data which is coming from backend is visible to the user but when I print that application I am not getting any borders around that data.

Can we get the borders when we are using Textview in this?

(or)

Can we expand textarea based on the content which is coming from back end?

Thanks&Regards

Sridevi

Accepted Solutions (0)

Answers (1)

Answers (1)

ChandraMahajan
Active Contributor
0 Kudos

Hi,

Please refer my answer in thread http://scn.sap.com/thread/3469411

You may need to do some extra coding to achieve the desired result but you can try code provided by me.

Regards,

Chandra

former_member184238
Participant
0 Kudos

Hi Chandrasekhar,

I have already gone through that post.


But my requirement is I am not applying any key events for my text area.I am using text area with non editable mode in Matrix layout cell and getting data from back end.

If the data is very big I am getting text area with scroll bar.But I want to display total data which is coming from back end in that text area without getting any scroll bar , because when I print that form I want to get total data in textarea .

Is it possible to do like that in SAPUI5 without using any key event operation?

Please suggest me.

Thanks&Regards

Sridevi

former_member184238
Participant
0 Kudos

Hi,

Thank you very much for your reply.

I got the solution for this by placing dynamic row number in text area.

oTV = new sap.ui.commons.TextArea({

                      width : '100%',

                      rows : count,     //(dynamic count)

                      value : dataName[int2-2],

                      editable : false,

                    });

I am counting number of lines in text area which was coming from back end and use this count variable as no of rows in text area .

Then my text area is automatically increased based on my test.

Thanks&Regards

Sridevi