Unable to view GWT 2.0.1 application in IE8 - gwt

I'm creating an application using GWT 2.0.1; it complies 6 computations and runs well in all browsers except IE8, it shows a blank page( but can be viewed in IE8 compatibility mode) .
When I add the line in my gwt.xml
<set-property name="user.agent" value="ie8" / >
it compiles just 1 permutation and the application displays fine in IE8. However if I add the line
<set-property name="user.agent" value="ie8,gecko,gecko1_8,safari,opera" />
it compiles all permutations, but the application still cannot be viewed in IE8 but runs properly in all other browsers.
Is there any other method to ensure my application will run in all browsers ?

According to this page besides setting the proper user agent you have to add the following meta tag to enforce IE8 standards mode:
<meta http-equiv="X-UA-Compatible" content="IE=8"/>

For those who are looking for a nice solution, you have to insert this line :
<meta http-equiv="X-UA-Compatible" content="IE=5,6,8,9" >
in your .html file (the host page)
This will ensure that your page is compatible with ascendant IEs...

I had a similar issue once and the problem was that the HTML page that bootstrapped the GWT JavaScript had an unmatched HTML tag. This didn't cause a problem in Firefox or Chrome, but IE just displayed a blank page. Try verifying your HTML using an HTML Validator. The W3C validator is a the cannonical service.
http://validator.w3.org/

instead of
<set-property name="user.agent" value="ie8,gecko,gecko1_8,safari,opera" / >

Try diffing the generated permutations for IE8 when you use <set-property name="user.agent" value="ie8" / > and when you use <set-property name="user.agent" value="ie8,gecko,gecko1_8,safari,opera" />. If they are different, you might get some clue to take forward your investigation. Use fiddler or IE developer tools to monitor and compare the names of *.cache.js files being loaded in each case.

Related

TinyMCE editor is not loading because document is not in standards mode - how can I get my document in standards mode?

I am so close to getting the TinyMCE editor to work at our site. The necessary scripts when adding a discussion are loading.I can see them in the HTML source. And my domain is properly registered for the API key I'm using. And the id/name of the textarea is correct. But the editor itself doesn't load for the textarea.
There is just one JavaScript console error:
Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode.
Does anybody know what "standards mode" is and how I can make sure the page served is in standards mode?
A big never mind. I found the solution. The document was in so-called "quirks" mode because there was no DOCTYPE. I added this on top and the editor worked just fine!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Even later I discovered something that might help.
Check if the first tag is of the <!doctype html>.
In my case a tag was taking the first place.

HTML5 Pass-Through element causes Eclipse warning 'Unknown tag'

My JSF template.xhtml file looks something like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:jsf="http://xmlns.jcp.org/jsf">
<h:head>
...
</h:head>
<h:body>
<header jsf:id="head">
...
</header>
<nav jsf:id="nav">
...
</nav>
<main jsf:id="main">
...
</main>
<footer jsf:id="foot">
...
</footer>
</h:body>
</html>
Eclipse complains about the
Unknown tag (main).
I wonder whether my file is somehow malformed or Eclipse is just not capable of validating this correctly.
This is not a JSF problem. You would still have exactly the same problem when removing the passthrough element trigger jsf:id. You would even still have exactly the same problem when not using JSF tags/attributes anywhere in the XHTML file.
The <main> tag is relatively new in HTML5 (it was only added in HTML5 CR of August 2013). Other HTML5 tags currently in your XHTML document already exist longer (far back in 2008). Eclipse simply doesn't recognize <main> as a tag registered in the default XML namespace as identified by http://www.w3.org/1999/xhtml. Eclipse holds an internal list of registered tags. If upgrading to latest Eclipse (SR) version doesn't solve the problem, then your best bet is to report this as an issue to Eclipse guys. In the meanwhile, just choose the quick fix option "Ignore 'main' element in HTML5 validation".
Unrelated to the concrete problem, that XML prolog doesn't belong there. Get rid of it. Further I also wonder the necessity of the "header", "nav", "main" and "footer" being whole JSF components. I'm not really seeing any useful real world appliances with this. You'd most likely as good just keep them plain HTML. This saves you from unnecessary overhead.
See also:
XML prolog / instruction not removed from XHTML output
JavaServer Faces 2.2 and HTML5 support, why is XHTML still being used

Browser specific GWT Datepicker Loaclization

GWT Datepicker is showing in "en" locale even if I change my locale to some other language. I dont want to specify it in some *.gwt.xml file, what I want is that it should take it from browser locale. Any workaround for this??????
Dynamic I18N as they call it is only about providing translated constants. For everything else (number formatting, date formatting, plural rules, etc.) you have to compile the supported locales within your app (<extend-property name="locale" values="…" />).
As an alternative, you can possibly override (using <replace-with> rules) the various implementations (in your case with DatePicker, the DateTimeFormatInfoImpl) with your own that would get their information from a Dictionary (or equivalent) rather than from compiled-in data. These APIs are subject to change between versions of GWT though (and I can already tell you that they will change in GWT 2.6).
In the end, it's probably easier to recompile your GWT app when you add support for a new locale, than go down the above-mentioned road.
GWT does not use the browser locale by default. You have to tell it to do so.
<set-configuration-property name="locale.useragent"
value="Y" />
<set-configuration-property name="locale.searchorder"
value="queryparam,cookie,useragent,meta" />
Be aware of that this does not work with all browsers. I suppose that's why it's not activated by default. So far IE is the only exception I know of.
If you want to use the browser locale (which is generally going to be pretty limited, not available in all cases, etc), then you want the combination of Thomas's answer (specifically specifying all the locales your app should support in extend-property tags) and setting the locale.useragent property (you don't need to set locale.searchorder unless you want to change the order or disable some provider).
Specifically, in your apps gwt.xml file, add the following:
<inherits name="com.google.gwt.i18n.I18N"/>
<extend-property name="locale" values="en"/>
<extend-property name="locale" values="fr"/>
... etc ...
<set-configuration-property name="locale.useragent" value="Y"/>
You don't need any replace-with rules. See GWT i18n docs

GWT IE9 emulate IE8

So I have a GWT application that works perfectly in IE6-8, and most all modern browsers. Unfortunately, due to a known bug in how IE9 handles onchange events on <select> elements, it's pretty much unusable in IE9.
So instead of having our clients downgrade to IE8, I had the brilliant idea of having IE9 emulate IE8. I put this meta tag in my GWT host page:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >
When I look at the IE9 Developer Tools (F12), I see that it's "Browser mode" is IE9 and "Document mode" is IE8 standards. The GWT app doesn't load, though: it gives me a JavaScript error in one of the compressed and obfuscated JavaScript functions generated by GWT. I don't have the ability to debug into the app via IE so I can't figure out what's going on that way.
I suspect it has something to do with the way GWT detects which browser is being used and loads the appropriate resources for the session.
Edited to add: When I try to use IE=8 instead of IE=EmulateIE8, Developer Tools still reports a IE9/IE9 standards mode and all of the same onchange event issues are present as when I run in vanilla IE9.
Is there a working way to make IE9 emulate IE8 Standards mode in the way the http-equiv meta tag does, that works with GWT 2.4?
I've had similar problem: IE ignored <meta http-equiv="X-UA-Compatible" content="IE=9"> tag (I was trying to prevent IE8 from displaying the page in IE7 compat mode). It was caused by not having X-UA-Compatible meta as the first child of <head>. I set it as the first child of <head> and added <!DOCTYPE HTML> on top of everything, and it worked.

Tiny MCE not working in IE9 when using document.domain

I am using the latest version of TinyMCE which will render in IE9 but I cannot interact with it.
Removing document.domain will allow it work again, but I need document.domain to make the popup windows in tinyMCE work in my setup.
I have tried using <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> and such but this doesn't seem to make any difference.