How to put a line break in textarea widget

2
Hi all, I got here a very simple question. How can I put a line-break in textarea. In the earlier version (2.4.x) of Mendix, I can use $String1 +'\n'+ $String2 to create a line break in the generate text from MF, and the textarea will render it as a line-break. This doesn't work any more in 2.5.x. Any idea? Thanks, Panayu
asked
5 answers
6

If you just use

$String1 + '
' + $String2 

that works OK in a text area. Alternatively, you can create a string variable in your MF and set it to

'
'
(a carriage return between the quotes), then just insert that string variable wherever you need a line break.

answered
1

Create HTML objects and use the Rich text suite (app store) to display as a textarea. U can use strings like: "$String1"<"br" />"$Strings2"<" "br" />".

answered
0

You can use the richtextviewer widget to achieve this behavior as well.

answered
0

Thank Jacco for the answer. It is really too bad that we cannot use the regular textarea widget, because it is a lot lighter and our customer do not use all styling features from Rich Text Editor.

BTW: the correct syntax was

$String1 + '< br />'+  $String2

Cheers, Panayu

answered
0

Hi panayu, you should still be able to use linebreaks in a textarea. A user is able to use linebreaks when he fills in a form so you can fake this as well. It might be possible the notation has changed. You can try using \r\n instead of only the \n

answered