Wicket component does not recognize new lines

I'm new to the gate. Why doesn't / n add a new line to a line in a panel component? / n just stands aside, and the line continues as usual.

+4
source share
2 answers

This is because its displayed as HTML and HTML do not recognize \n as newlines. Instead, it is treated as normal empty space.

If you want a new line, insert <br> into your line and use setEscapeModelStrings(false) for your component.

+10
source

Or, if your component is a label, you can use MultiLineLabel

+9
source

Source: https://habr.com/ru/post/1393199/


All Articles