Reputation: 311
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
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
Reputation: 4967
The only way to get multi-line captions is to use a GridLayout and emulate captions with Labels.
Upvotes: 0
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