vaadin8 - Vaadin - HorizontalLayout expand ratio 0 leads to 0 width -
here ui tree size settings:
horizontallayout (size full)
formlayout (size undefined, expand ratio: 0)
- field 1 (size undefined)
- field 2 (size undefined)
- field 3 (size undefined)
panel (size full, expand ratio: 1)
- label (width 100%, height undefined)
what want:
give formlayout minimum space needs, , rest of space should occupied panel.
what happened:
the formlayout has 0 width (practically invisible) , panel takes whole space.
if expand ratio both 1, form layout , panel seem have same width.
is did incorrect? how formlayout keeps size, , panel grow horizontally?
edit:
main view class:
private horizontallayout layout; private formlayout formlayout; private textfield title; private upload upload; private combobox<string> charset; private button btnsubmit; private textviewer textviewer; public textuploadview() { createtitle(); createupload(); createbtnsubmit(); createcharset(); formlayout = new formlayout(title, upload, charset, btnsubmit); textviewer = new textviewer(); layout = new horizontallayout(formlayout, textviewer); layout.setsizefull(); layout.setexpandratio(formlayout, 0); layout.setexpandratio(textviewer, 1); }
the textviewer panel label in it:
public class textviewer extends panel { private static final long serialversionuid = 1l; private label labeltext; public textviewer() { super(); labeltext = new label(); labeltext.setwidth("100%"); labeltext.setstylename("largetextdisplay"); super.setcontent(labeltext); super.setsizefull(); } public void settext(string text) { labeltext.setvalue(text); } }
i don't think css on label causing problem it's this:
.mytheme .largetextdisplay { white-space: pre-wrap; word-wrap: normal; }
Comments
Post a Comment