This must be myself just being dense but based on what I’ve read on the book of vaadin about getting the text to wrap in a label, I am stuck as to why I cannot get it to do so in my implementation.
[code]
VerticalLayout container = new VerticalLayout();
rootLayout.addComponent(container);
VerticalLayout comment = new VerticalLayout();
container.addComponent(comment);
comment.setExpandRatio(createdByLbl, 0.2f);
comment.setExpandRatio(textLbl, 0.7f);
comment.setExpandRatio(createdDateLbl, 0.1f);
[/code]All of the above is wrapped in a CSSLayout with size se to full also btw. Can anybody spot what I am doing wrong?
Attached is a screenshot of the behaviour I am getting as a result of my implementation.
Try without the preformatted setting. BTW, those expand ratios will look weird, since they grow the spacing between the components the bigger the label gets. set expandratio only on the middle label, and call setSpacing(true) on the layout instead.