Monday, November 8, 2010

JavaScript errors in IE with ICEfaces and Liferay.

JavaScript errors in Internet Exploerer?!?!?!? Surely not!

Yes, friends. It is my sad duty to report that yes indeed, Internet Explorer may have JavaScript issues when using ICEfaces in Liferay when Firefox and Chrome do not.

But then, if you found this blog because you Googled that, you already knew it, and now you'd like me to stop gabbing and tell you the solution.

Oh I get it.

So here's the scenario:
Liferay 5.2
ICEfaces 1.8.1

You create some nifty little portlet that installs into Liferay fine and displays fine and... uh oh... some of the functionality doesn't work and you get that irritating little icon in the bottom left corner of IE telling you there's a JavaScript error on the page. Clicking it to show the error gets you nothing but a message telling you "Error: Object expected" and what line the error occurred on.

Useless, ain't it?

So here's the thing: According to this post:

Liferay and ICEfaces compress .js files and this does not make Internet Explorer happy. If you want your portlet to run in IE, you have to disable this feature.

Go into your web.xml file and add the following:


And try your app again. That hideous little error should be gone.

No comments:

Post a Comment