Scrollbars and Labels

Hello all,

I have searched the forum, used google, read a ton of posts and tried different solutions but I cannot seem to achieve what I am looking for.
I am using Vaadin 6 for a portlet deployed in Liferay 6.0.6; the portlet (GridLayout) has a header (addComponent(header,0,0,9,2)) that shall contain some html that’s changed depending on the portlet selections ( combo boxes ). Since the text has to be formatted as HTML I thought I could use a label…
No problem until the HTML text is “bigger” than the label. At this point I tried a whole lot of solutions proposed :

put the label into a panel and :

A) set the panel container size = undefined + set panel width 100% + set panel scrollable true
B) set panel container = new HorizontalLayout + set panel container size = undefined + set panel scrollable true
C) set panel container size = undefined + set panel scrollable true
D) set panel scrollable = true
E) do nothing

then I tried, for each of the above, to set the label size :
1 : undefined
2 : sizeFull
3 : setWidth = 100%
4 : setWidth = 80%

Nothing seems to make the scrollbars appear and I am quite lost .

Any chances someone has some hints ?

TIA

Marco

  1. Panel#setScrollable is misleading. It really has nothing to do with whether the content scrolls or not. It’s just enables/disables programmatic scrolling. So you don’t have to use it all.

  2. Reading from your description I’m not quite sure, but did you try this combination.


Panel panel = new Panel();
panel.setSizeFull();
panel.getContent().setSizeUndefined();
Label lbl = new Label();
lbl.setSizeUndefined();
panel.addComponent(lbl);
  1. Make sure you don’t have any conflicting size definitions in the Panel’s ancestors e.g. having Panel width 100%, but the layout containing the Panel having -1/null (= undefined) width.