Dmitry Sh
Dmitry Sh

Reputation: 311

Vaadin Form TextField multiline caption

I have an Form with many TextField's (Vaadin), each one have very long caption.

Can i make TextField's caption multiline?

Upvotes: 3

Views: 4691

Answers (3)

user3000951
user3000951

Reputation: 11

In Vaadin 7, the Panel caption excepts HTML.

Example, <sub>subscript</sub> and <br/> commands.

I don't know about version prior to 7.

Upvotes: 1

Henri Kerola
Henri Kerola

Reputation: 4967

The only way to get multi-line captions is to use a GridLayout and emulate captions with Labels.

Upvotes: 0

tibtof
tibtof

Reputation: 7957

I don't think you can. Can you use TextArea instead?

Update: Define a custom style in your style.css:

.v-caption-multiline {
    white-space: pre;
}

And then use in in your code to separate the lines by \n:

TextField t = new TextField("A very long caption\nA very long caption ");
t.addStyleName("multiline");

Upvotes: 3

Related Questions