Tuesday, June 2, 2009

GWT opera body tag issue

Trying to get the body tag using RootPanel.get("body") when in the .html file you have <body id="body"> works fine in Firefox and Safari, but causes problems in Opera. For some reason it doesn't like getting the body element that way, instead you need to use RootPanel.getBodyElement().

We were trying to do RootPanel.get("body").setStyleName("body"); but instead had to use RootPanel.getBodyElement().setClassName("body");