tags:

views:

30

answers:

1

On a GWT panel, can I enforce a minimum height?

+1  A: 

A GWT Panel is just a <div> element. You can use the CSS min-height property to enforce a minimum height for that div.

Just use panel.addStyleName("foo"); on the panel you want to control, and in your CSS, use .foo { min-height: 100px; } or whatever you want it to be.

Or if you're using UIBinder:

<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
    xmlns:g='urn:import:com.google.gwt.user.client.ui'>>
  <ui:style>
    .foo { min-height: 100px; }
  </ui:style>

  <g:Panel styleName='{style.foo}'>
</ui:UiBinder>
Jason Hall
Although min-height will work, one has to be careful with its usage as certain older versions of IE do not support it.
Ashwin Prabhu