import java.util.List;
+import com.google.gwt.core.client.Scheduler;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.UIObject;
import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.client.BrowserInfo;
import com.vaadin.client.LayoutManager;
import com.vaadin.client.StyleConstants;
+import com.vaadin.client.ui.layout.ElementResizeEvent;
import com.vaadin.client.ui.layout.ElementResizeListener;
import com.vaadin.shared.ui.AlignmentInfo;
private ElementResizeListener spacingResizeListener;
+ /*
+ * IE8 forgets to re-render the slot if the widget inside the slot changes
+ * size. To force IE to re-render we apply the well know zoom property to
+ * the widget which triggers a re-render of the slot element.
+ */
+ private static final ElementResizeListener ie8ElementRefresherListener = new ElementResizeListener() {
+
+ @Override
+ public void onElementResize(final ElementResizeEvent e) {
+ Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
+ @Override
+ public void execute() {
+ int zoom = e.getElement().getPropertyInt("zoom");
+ e.getElement().setPropertyInt("zoom", zoom);
+ }
+ });
+ }
+ };
+
// Caption is placed after component unless there is some part which
// moves it above.
private CaptionPosition captionPosition = CaptionPosition.RIGHT;
lm.addElementResizeListener(getSpacingElement(),
spacingResizeListener);
}
+
+ if (BrowserInfo.get().isIE8()) {
+ lm.addElementResizeListener(getWidget().getElement(),
+ ie8ElementRefresherListener);
+ }
}
}
lm.removeElementResizeListener(getSpacingElement(),
spacingResizeListener);
}
+
+ if (BrowserInfo.get().isIE8()) {
+ lm.removeElementResizeListener(getWidget().getElement(),
+ ie8ElementRefresherListener);
+ }
}
}