Mar 21, 2011

Issue With Ajax In IE9 (No such interface supported)

Hi All,

Today I found something very interesting and would like to share with you all.

I was facing error "No such interface supported" when I hit button on my custom page in IE9, but it was working properly on IE8. On click of this button controller method is called using AJAX, after that page messages is rendered. Here is the visualforce code :
<apex:page controller="IE9IssueController">
    <apex:form >

        <apex:pageMessages id="PM" />

        <apex:pageBlock title="IE9 Issue Page">

            <apex:pageBlockButtons >
                <apex:commandButton value="Hit" action="{!Hit}" reRender="PM"/>
            <apex:outputLabel value="Hit the button, if info message displays that means action function is completed successfully else problem occured."/>

And here is my apex code :
public class IE9IssueController
    public IE9IssueController()
    public void Hit()
        Apexpages.addMessage(new Apexpages.Message(ApexPages.Severity.INFO, 'You clicked the button!'));
Now I was unable to find the exact problem but was able to get the work around of it. This line put the browser in IE8 mode and page message get rendered properly in IE9 also.
Apexpages.currentPage().getHeaders().put('X-UA-Compatible', 'IE=8');

1 comment:

  1. Fixed as a patch :

    Thanks to salesforce.