0

I have been working on a GWT + GXT app for a few months now. I use the dev mode plugin with firefox while coding. GWT claims to handle browser quirks on the programmers' behalf however I keep running into issues that vary in behavior across browsers. Especialy so in IE's compatibility modes being on v/s off. The layouts go off; widget sizes (especially submenu and dropdown widths), positions etc are inconsistent. Many a times I experience javascript exceptions which are intermittently reproduced in one browser and never on other browsers and I have no clue by looking at the code. And then there are cases which completely crash. One example is embedding a FormPanel within another FormPanel: works nicely in Firefox, causes javascript exceptions in IE9

We chose GWT specifically because we did not want to spend time battling browsers, but seems we got tricked!

Any ideas or thoughts?

Update:

I realise that the FormPanel nesting issue arises because of IE adhering to the w3c standard. However, my issue is not with formpanel in particular but the fact that I get different behavior in different browsers even though GWT claims to handle browser quirks all by itself. I keep getting issues on different browsers which are not a characteristic of the GWT/JAVA code I have written and since the runtime is all javascript, I have no clue how to debug them and how to translate those Javascript exceptions/errors into the Java code flaws/cases

Satyan Raina
  • 990
  • 5
  • 15
  • Nested `form` elements are against the [spec](http://www.w3.org/TR/2011/WD-html5-20110525/forms.html#the-form-element). Consequently, you can't expect GWT to make it work on all browsers if not all browsers actually support it. [Here](http://stackoverflow.com/questions/597596/how-do-you-overcome-the-html-form-nesting-limitation) is something that's potentially interesting. – Baz Jul 07 '14 at 13:07
  • True, in this case IE is exhibiting w3c standard while other browsers are being lenient by allowing it. But this is what i find problematic. GWT should have disallowed it completely by throwing an exception (unless they could make it work somehow on IE). My issue is not with formpanel in particular but the fact that I get different behavior in different browsers even though GWT claims to handle browser quirks all by itself – Satyan Raina Jul 07 '14 at 13:28
  • I agree, that it shouldn't be allowed to nest `FormPanel`s. Feel free to post a bug report for this particular issue at least. – Baz Jul 07 '14 at 13:56

1 Answers1

2

You should never let IE use the compatibility mode when using GWT. To always enforce the browser to use the newest supported document mode, add the following meta tag:

<meta http-equiv="X-UA-Compatible" content="IE=edge">

As an alternative you can also set this using a http header.

Steffen Schäfer
  • 1,126
  • 9
  • 11
  • Sadly my GWT application is embedded inside a parent application which handles the html metas on its own and I am not in a position to change it. Nevertheless, the problem is not only with the compatibility mode. The larger problem exists with cross browser compatibility. For example, FormPanel behavior I metioned occurs regardless of the compatibility mode and is smooth in FF. – Satyan Raina Jul 07 '14 at 11:42
  • 1
    GWT and GXT may paper over the differences between browsers, but this so-called 'compatibility mode' is the real trick. For example, IE9 pretending to be IE8 has bugs and errors entirely unlike either the real IE8 or IE9. Its almost as though it wasn't enough to release *one* new buggy browser, they had to fit in another two or three in these modes to meet a quota... – Colin Alworth Jul 07 '14 at 12:43