Note that there are some explanatory texts on larger screens.

plurals
  1. POGWT composite dynamic height resize
    primarykey
    data
    text
    <p>I Have a GWT Composite to which some other Composites are added dynamically. I want to make may Parent composite Resize to fit the height of all its child widgets automatically. i tried setting setHeight("100%") for Composite but this doesn’t work. any Idea how to accomplish this functionality?</p> <p>thanks. EDIT:</p> <pre><code>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&lt;Date&gt;() { @Override public void onValueChange(final ValueChangeEvent&lt;Date&gt; event) { dateChanged = true; } }); panel.add(dateBox); final ListBox visibility = new ListBox(); final Label lblVisibility = new Label("Visibility:"); LabeledWidget vis = new LabeledWidget(lblVisibility, visibility); for (int i = 0; i &lt; 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); </code></pre> <p>UPDATE: Setting Composite width to fill all available Window horizontal space:</p> <pre><code> 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"); } }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload