cancel
Showing results for 
Search instead for 
Did you mean: 

Get width of textArea in pixels?

daniel_humberg
Contributor
0 Kudos

I have a textArea on my web dynpro view, and it has a width of N cols.

How can I find out the width of the textArea in pixels?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Daniel,

Create a context attribute and bind it to the width property of your textarea, then just read the attribute. Do not forget to initialize your attribute with default width.

Regards,

Isaac.

daniel_humberg
Contributor
0 Kudos

Hi Isaac,

this will only work if the attribute "width" of the text area is set. If the attribute "cols" is used, this attribute is initial (and still I would like to get the width in pixels).

Regards, Daniel

Former Member
0 Kudos

Hi Daniel,

I do not know the purpose of why you want to know the width of a textarea in pixels. Other thing that I can think of is to take a screenshot (Prnt Scrn button) and paste it in an image editor (like Photoshop). There you can measure the width of the textarea in pixels.

Regards,

Isaac Meléndez

Answers (0)