Roddy of the Frozen Peas
Roddy of the Frozen Peas

Reputation: 15190

GWT JavaScript error on IE 64-bit browsers

So I've got a bit of an odd one here.

I've got a (huge) legacy application running GWT 2.4. In one of my custom widgets that extends FlowPanel, I call the following in the constructor:

super();
DOM.setElementProperty(getElement(), "style", "");

Self-explanatory. I strip any default inline styles that GWT may or may not have applied when initializing the FlowPanel. These are the first two lines in the constructor. The rest of the constructor applies an ID and then adds some labels and input elements. Nothing overly fancy.

Good news is that it works in IE9, Chrome, Firefox. It also works fine in 32-bit versions of IE8. It does not work in 64-bit versions of IE8 and, in debug mode, gives this error:

com.google.gwt.core.client.JavaScriptException: (Error): Not implemented 
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    at com.google.gwt.dom.client.Element$.setPropertyString$(Element.java)
    at com.google.gwt.user.client.DOM.setElementProperty(DOM.java:1127)

... and the next line indicates the setElementProperty line I indicated above.

I've been told that it's also working fine in 32-bit IE 6, though the 64-bit version also chokes and dies with the same result.

So. Why in the world would this code not work in the 64-bit versions of these browsers?

Upvotes: 1

Views: 373

Answers (1)

Thomas Broyer
Thomas Broyer

Reputation: 64541

What you're doing is basically, in JS: elt.style = ''. You should rather do elt.style.cssText = '', which you can do in GWT with either DOM.setStyleAttribute(getElement(), "cssText", "") (old style) or getElement().getStyle().setProperty("cssText", "") or getElement().getStyle().clearProperty("cssText") (new style).

Upvotes: 3

Related Questions