i have gwt composite other composites added dynamically. want make may parent composite resize fit height of child widgets automatically. tried setting setheight("100%") composite doesn’t work. idea how accomplish functionality?
thanks. edit:
final docklayoutpanel docklayoutpanel = new docklayoutpanel(unit.em); docklayoutpanel.setstylename("entrypanel"); docklayoutpanel.setsize("142px", "72px"); initwidget(docklayoutpanel); final verticalpanel panel = new verticalpanel(); panel.setsize("140px", "72px"); chckbxexport = new checkbox("export"); putfield(commonpresenter.constants.export, chckbxexport); datebox = new datebox(); datebox.addvaluechangehandler(new valuechangehandler<date>() { @override public void onvaluechange(final valuechangeevent<date> event) { datechanged = true; } }); panel.add(datebox); final listbox visibility = new listbox(); final label lblvisibility = new label("visibility:"); labeledwidget vis = new labeledwidget(lblvisibility, visibility); (int = 0; < commonpresenter.constants.visibilities.length; i++) { visibility.additem(commonpresenter.constants.visibilities[i]); } putfield(commonpresenter.constants.visibility, visibility); panel.add(vis); panel.add(chckbxexport); docklayoutpanel.add(panel);
update: setting composite width fill available window horizontal space:
final int scrollbarwidth = 25; // editpanel.setheight("180px"); setwidth(window.getclientwidth() - scrollbarwidth + "px"); // editpanel.setstylename("editorpanel"); window.addresizehandler(new resizehandler() { public void onresize(resizeevent event) { int width = event.getwidth(); setwidth(width - scrollbarwidth + "px"); } });
here's how html+css:
- create parent, , do not set height (or set
auto
). - then add children (just make sure, don't use
absolute
/fixed
positioning children). - set height of children, if required.
the height of parent adjusted automatically. same gwt composites - make sure, css (including style attributes) applies elements! if unsure, use firebug.
if need more specifics, you'd have post code shows how construct parent composite (uibinder, ...?)
Comments
Post a Comment