-
30. Re: IE9 richfaces 3.3.3.Final
waldemar_erhardt Feb 13, 2012 10:39 AM (in response to bretwil31)Hi Brett,
we have the same problem here as you describe. Did you find a solution or a workaround for this?
Thanks
-
31. Re: IE9 richfaces 3.3.3.Final
bretwil31 Feb 13, 2012 4:46 PM (in response to waldemar_erhardt)Hi yes we solved it as far as we know, see below:
Patched the AJAX.js script in the richfaces-impl jar with:
1) IE9 detection from
http://vsomani.blogspot.com/2011/12/a4j-and-ie-9-issues-with.html
2) Logging fix - Move LOG class to start of file and remove all object toStrings (ie9 cant handle it)
3) Add checks for "oldnode == null"
Patched the Myfaces-impl with:
1) Modified the HtmlRendererUtils class to add checks for "text/css"
I will upload modified files if I can find how to attach jar files on this site....
-
32. Re: IE9 richfaces 3.3.3.Final
jr_rodriguez_l Apr 26, 2012 1:18 PM (in response to msznapka)You could solve all the problems of ajax with that?
-
33. Re: IE9 richfaces 3.3.3.Final
celeborn1979 Aug 3, 2012 6:49 AM (in response to bretwil31)Does this solution fix rich:tree node selection for any of you? I'm using a patched AJAX.js and everything works except for treenode selection.
-
34. Re: IE9 richfaces 3.3.3.Final
jonny23 Aug 13, 2012 8:25 AM (in response to bretwil31)I tried above mentioned solution to fix IE9 issues, however even in IE7 compatibility mode some bugs were present. After spending some time in IE development tools here's addition to richfaces-impl fix:
1) Instead of patching Sarrissa framework ( "1) IE9 detection from..") it is better to upgrade Sarissa framework to 0.9.9.6 it has some additional IE9 issues fixed, to upgade framework, download sarissa.js from http://sourceforge.net/projects/sarissa/files/ and replace first part of AJAX.js (till EOF comment) or replace sarissa.js in richfaces souce resources and use maven to build new jar.
2) For richfaces-impl work in non-compatibility mode in IE9, A4J.AJAX.replacePage method should be fixed either in AJAX.js or JSFAJAX.js(if you are building sources), custom document.open method does not work in IE9 document mode. Simply replace if(isIE) { --> if(isIE&&!Sarissa._SARISSA_IS_IE9) { (line 2125 in AJAX.js, line 1121 in JFSAJAX.js).
That's fixed IE9-related issues for our application ( myfaces 1.2.11 + richfaces 3.3.2.SR1).
-
35. Re: IE9 richfaces 3.3.3.Final
rbmo Nov 8, 2012 3:15 AM (in response to tom_goring)Hi.
We could fix our IE9 Problems with a simple Filter we added in the web.xml
<filter>
<display-name>IE9 Filter</display-name>
<filter-name>ie9filter</filter-name>
<filter-class>ch.bedag.gba.capweb.util.IE9Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>ie9filter</filter-name>
<url-pattern>*</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
package ch.bedag.gba.capweb.util;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* IE9 Filter. Helps proper rendering on Internet Explorer 9.
*/
public class IE9Filter implements Filter {
private final static Log LOG = LogFactory.getLog(IE9Filter.class);
@Override
public void init(FilterConfig filterConfig) throws ServletException {
// noop
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
// Hier zwingen wir den IE9 in den Kombatibilitaetsmodus
((HttpServletResponse) response).setHeader("X-UA-Compatible", "IE=EmulateIE8");
// Der IE9 sendet fuer css neu nur noch "text/css" als Accept header.
// Dies hat zur Folge, dass die Klasse HtmlRenderUtils folgende
// Exception wirft.
// "ContentTypeList does not contain a supported content type: text/css"
// Um dies zu verhindern kann man entweder das Myfaces Patchen oder eben
// den Request korrigierren.
// Wir haben uns für die zweite Lösung enschieden und verändern den
// Accept header. Neu wird es "text/css, */*" anstatt nur "text/css"
String accept = ((HttpServletRequest) request).getHeader("Accept");
if ("text/css".equals(accept)) {
chain.doFilter(new IE9HttpServletRequestWrapper((HttpServletRequest) request), response);
} else {
chain.doFilter(request, response);
}
}
@Override
public void destroy() {
// noop
}
// Request Wrapper. Catches the getHeader for Accept. When it is text/css we
// will return simply "text/css, */*"
private class IE9HttpServletRequestWrapper extends HttpServletRequestWrapper {
public IE9HttpServletRequestWrapper(HttpServletRequest request) {
super(request);
}
@Override
public String getHeader(String name) {
String header = super.getHeader(name);
if ("text/css".equalsIgnoreCase(header)) {
header = "text/css, */*";
}
return header;
}
}
}
-
36. Re: IE9 richfaces 3.3.3.Final
newuser001 Apr 25, 2013 3:39 AM (in response to rbmo)Tempororily i resolve the problem by replacing the below lines. It works fine. Two changes can help you to resolve the problem
Find the file AJAX.js in richfaces-impl.jar
Location : /org/ajax4jsf/javascript/scripts/AJAX.js
1 :
line number 1398
oldnode.outerHTML = new XMLSerializer().serializeToString(newnode);
and replace it by
if (typeof window.XMLSerializer != "undefined")
{
oldnode.outerHTML = new XMLSerializer().serializeToString(newnode);
}
else if (typeof xmlNode.xml != "undefined")
{
oldnode.outerHTML = xmlNode.xml;
}
2 :
line number 1627
dst.setAttribute(attr,value);
and replace by adding try, catch
try
{
dst.setAttribute(attr, value);
}
catch (err)
{
//alert('Error');
}
(or)
make a copy of AJAX.js file and modified the above lines and include this file into your main page that will replace the old one.
-
37. Re: IE9 richfaces 3.3.3.Final
thohawk May 30, 2013 2:27 AM (in response to newuser001)Hi,
Just wanted to add that this can be done without replacing anything in the jar files;
jQuery(document).ready(function() {
//https://community.jboss.org/message/638508#638508
try {
if (jQuery.browser.msie && jQuery.browser.version >= 9) {
window.XMLSerializer = function() {};
window.XMLSerializer.prototype.serializeToString = function(oNode) {
return oNode.xml;
};
}
} catch (exception) {}
try {
A4J.AJAX.XMLHttpRequest.prototype._copyAttribute = function(src, dst, attr) {
var value = src.getAttribute(attr);
if (value) {
try {
dst.setAttribute(attr, value);
} catch (err) {}
}
};
} catch (exception) {}
});
-
38. Re: IE9 richfaces 3.3.3.Final
fragilitiline Jun 5, 2013 5:22 AM (in response to tom_goring)i have problem in windows 8 and IE 10
Webpage error details is
User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/6.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729)
Timestamp: Tue, 4 Jun 2013 14:40:24 UTC
Message: No such interface supported
Line: 120
Char: 1
Code: 0
i am using richfaces-impl-3.3.2SR1.jar
please help me......
Thanks in advance
-
39. Re: IE9 richfaces 3.3.3.Final
tomisky Jun 14, 2013 6:53 AM (in response to fragilitiline)The problem with the
LOG.debug("Hidden JSF state fields: " + idsSpan);
is that XML node "ajax-view-state" which keeps hidden inputs with view state, do not have .toString() method, so when js tries to concat string and idsSpan.toString() raises an error.
If tried to "add" a toString() method to that kind of nodes:
try {
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");
var newRoot = xmlDoc.createElement("root");
// newRoot is an object of the same type as idsSpan
newRoot.prototye.toString = function() {
return this.xml;
}
} catch (e) {
}
But with no success. Anybody any insight?
-
40. Re: IE9 richfaces 3.3.3.Final
handymanlondon Jun 14, 2013 7:31 AM (in response to tomisky)I'm also seeking a solution or any ideas for my IE10. Seems like many of us have same problem.
-
41. Re: IE9 richfaces 3.3.3.Final
tomisky Jun 14, 2013 7:43 AM (in response to handymanlondon)For this exact issue I got the code from
/<CONTEXT_PATH>/a4j/g/3_3_1.GAorg.ajax4jsf.javascript.AjaxScript.jsf
include statically from a local file in web server
and comment that line
Can't find a better solution
-
42. Re: IE9 richfaces 3.3.3.Final
bleathem Jun 14, 2013 3:08 PM (in response to tomisky)We are not planning on releasing any more releases of RichFaces 3. To keep your apps running on any Internet Explorer release >= 9, be sure to set the document compatibility in your application to IE-EmulateIE8 as in:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >
For more details, see:
Defining document compatibility:
http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx
Specifying legacy document modes
http://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx
-
43. Re: IE9 richfaces 3.3.3.Final
pgmjsd Jul 3, 2013 3:29 PM (in response to bleathem)The <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> solution did not work for me. I'm using RichFaces 3.3.1.GA still because the calendar widget doesn't work at all in 3.3.3.Final.
Maybe I'll fork 3.3.3.Final and fix it if I'm feeling ambitious. Where is the source for RichFaces 3.3.3.Final anyway?
-
44. Re: IE9 richfaces 3.3.3.Final
pgmjsd Jul 3, 2013 4:21 PM (in response to thohawk)I was about to say that it's probably not such a good idea to use browser detection to make the decision, but I did some investigating in IE10 and found that IE10 does have XMLSerializer.serializeToString(), but it doesn't work with this particular bit of code. In fact, in the AJAX.js script at line 614 there is this:
if(!window.XMLSerializer && Sarissa.getDomDocument && Sarissa.getDomDocument("","foo", null).xml){
/**
* Utility class to serialize DOM Node objects to XML strings
* @constructor
*/
XMLSerializer = function(){};
/**
* Serialize the given DOM Node to an XML string
* @param oNode the DOM Node to serialize
*/
XMLSerializer.prototype.serializeToString = function(oNode) {
return oNode.xml;
};
}
Interesting.... So it actually already knows how to fake this stuff out. It's just not doing it.