problem of docklayoutpanel in IE9

52 views
Skip to first unread message

tong123123

unread,
Dec 9, 2012, 8:41:52 PM12/9/12
to google-we...@googlegroups.com
our colleague just found that in IE9, the following is not work:

DockLayoutPanel dockLayoutPanel = new DockLayoutPanel(Unit.PX);
dockLayoutPanel.setSize("1024", "768");

the dockLayoutPanel will not shown (although it works in IE8).

In IE9, we must write the px in setsize
DockLayoutPanel dockLayoutPanel = new DockLayoutPanel(Unit.PX);
dockLayoutPanel.setSize("1024px", "768px");

why this is the case?

Thomas Broyer

unread,
Dec 10, 2012, 3:34:10 AM12/10/12
to google-we...@googlegroups.com
Because of browser bugs/discrepancies.

setSize(foo, bar) is equivalent to style="width: foo; height: bar", and IE8 used to default to pixels when the unit wasn't present.

If you're using pixels, use setPixelSize and you'll never forget the unit anymore.
Reply all
Reply to author
Forward
0 new messages