Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TextArea Item input loses formatting

    Hi,
    We have a text area item in a form. After users insert text into the text area item, we go ahead and display it in a label. The issue is that any formatting (e.g. newline, tabs etc.) are lost after it is displayed in the label. We can have a work around by enclosing it in the <pre> tag which preserves the formatting. However, is there a plan to fix it in Smart GWT?

    Thanks!

    #2
    This is not a bug. Label.contents is documented as accepting an HTML String, and when you view plain text as HTML, whitespace is no longer significant.

    You can use your <pre> tag or you could process the string character by character, for example, turning spaces into &nbsp and linefeeds into <br>.

    Comment

    Working...
    X