Thursday, December 8, 2011

a4j and IE 9 issues with framework.pack.js file

If you get the following error in IE 9


SCRIPT438: Object doesn't support property or method 'dispatchEvent'
framework.pack.js.faces, line 1754 character 26

SCRIPT16386: No such interface supported

framework.pack.js.faces, line 2373 character 3


This is related to the rich faces library 3.3.3.final

Apply the following to resolve this problem

Extract framework.pack.js from richfaces-impl-3.3.3.Final.jar (path - org\ajax4jsf\)

  • insert the following below line number 1914


Sarissa._SARISSA_IS_IE9 = Sarissa._SARISSA_IS_IE && (parseFloat(navigator.appVersion.substring(navigator.appVersion.indexOf("MSIE")+5))) >= 9;


  • After adding this line, change the following content on line number 2062


}}}}if(!window.DOMParser){if(Sarissa._SARISSA_IS_SAFARI){DOMParser=function(){};

to

}}}}if(!window.DOMParser || Sarissa._SARISSA_IS_IE9){if(Sarissa._SARISSA_IS_SAFARI){DOMParser=function(){};


  • Change the following on line number 2116


if(!window.XMLSerializer && Sarissa.getDomDocument && Sarissa.getDomDocument("","foo",null).xml){XMLSerializer=function(){};

to

if((!window.XMLSerializer || Sarissa._SARISSA_IS_IE9)&& Sarissa.getDomDocument && Sarissa.getDomDocument("","foo",null).xml){XMLSerializer=function(){};


Save the file and add the file back into the richfaces-impl-3.3.3.Final.jar replacing the earlier one.

Deploy and Enjoy

4 comments:

geert said...

Worked like a charm, thanks!

Kartik said...

I am having trouble building my project with the newly repackaged Richfaces jar - did you use the java jar.exe util? If so, with what parameters?

Unknown said...

Hi Vivek Somani,
As you said I have did changes by extracting the files and replaced the js file. And still I am getting the same error:

Error:
Line: 2374
Char: 3
Code: 0
URI: http://localhost:8080/b2c/a4j_resource/org/ajax4jsf/framework.pack.js.xhtml

In my application I have used JSF2 and Richfaces 3.3.3.Final
with richfaces-impl-jsf2-3.3.3.Final.jar.

Can you please help me get rid of this JS error?

Unknown said...

Thanks Vivek.

Your solution works great!