You need to sign in to do that
Don't have an account?
osaman
Ajax doesn't work in IE9
Hi
My visualforce page was working fine on IE8 with ajax being used. But on IE9 it gives an error
SCRIPT16386: No such interface supported
3_3_3.Finalorg.ajax4jsf.javascript.AjaxScript, line 122 character 41
SCRIPT16386: No such interface supported 3_3_3.Finalorg.ajax4jsf.javascript.AjaxScript, line 122 character 41
Any idea how it can be solved?
This will put the browser in IE8 mode by the way, which works for now:
Apexpages.currentPage().getHeaders().put('X-UA-Compatible', 'IE=8');
All Answers
Hi,
Please let me know after getting error does work page stop working? Or if we disable the error alerts of IE then your ajax is working properly?
I don't think IE9 is supported by salesforce yet.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Thanks Ankit.
No, the ajax request never gets completed and the page does nothing. But I can navigate to other URLs on the page if I click on them
Thanks
Hi Osama,
Try using <apex:actionFunction immediate="true"/>, and let me know if error still persists.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
I am already using that since I have to bypass the validations for this request.
Seems like its a known IE9 issue. I did talk to SF support but as usual no satisfying response from them.
I think there is an issue when javascript calls createElement() method on IE9.
Thanks
I can confirm that reRender doesn't work in IE9. I have made a very simple page and controller do demonstrate the issue.
Page code:
Controller code:
public without sharing class IE9ReRenderTest {
public void clickMe()
{
Apexpages.addMessage(new Apexpages.Message(ApexPages.Severity.INFO, 'You clicked the button!'));
}
public static testMethod void test()
{
new IE9ReRenderTest().clickMe();
}
}
The pagemessage doesn't get rendered in IE9. But it works if you change to IE8 mode.
Yes I already confirmed that.
Thanks anyway. Appreciate it!
This will put the browser in IE8 mode by the way, which works for now:
Apexpages.currentPage().getHeaders().put('X-UA-Compatible', 'IE=8');
This header trick seem to fail if you use the visualforce page as an inline page in a search layout. Is it because the header section is not included in that situation?
Yup, I've noticed the same thing. If the page is in an iframe (inline) the fix above does not work.
This this post was already marked as solved I've created a new one to address the iframe issue.
http://boards.developerforce.com/t5/Visualforce-Development/IE9-rerender-and-iframes-dont-work/td-p/260459
Took a look at this over the afternoon. The issue, in a nutshell, if I'm understanding it, is:
if(Sarissa._SARISSA_IS_IE && parseFloat(navigator.appVersion.substring(navigator.appVersion.indexOf("MSIE")+5)) >=9) { window.XMLSerializer = function(){}; window.XMLSerializer.prototype.serializeToString=function(oNode){return oNode.xml;} }
It's essentially the JavaScript fix from the link above, just inserted in a brute force manner since most of us, myself included, can't just updated the library file itself. However in my quick testing it does seem to work on the iFrame example in the other post.
Again: Test this thoroughly if you end up trying it.
Josh,
Thanks for the thorough description, this helps alot.
Has this been escalated to support?
I'd rather not scramble to add some hotfix to a bunch of VF pages if SF team is aware of the issue and plans to rollout a fix in the near future.
It has been escalated, the right guys are on it - but it might be a few weeks or more before a fix can be responsibly put in. So it really depends on the urgency - if you've got a lot IE9 users running into this, I'd probably recommend being pre-emptive. Users can also put the browser into IE8 mode, depending on their access level/rights, but obviously that might not be the most customer friendly approach.
Thanks again.
Luckily most of the VF pages use templates, so we can just add that JS to the Template. I've done that on one site and it seems to have worked, although some of the rerendered div's aren't resizing... not sure if thats IE9 bug or existed before.
Regardless, the JavaScript solution has resolved the big issue of the rerender not working at all. Definetly don't want to have to force users to switch to IE8 mode, especially if these are external facing pages (Force.com Sites).
Looking forward to whenever SF can put in the fix.
Testing this out I get the Object or Method not supported error as noted. This occurs on line 171 of the Sarissa Lib. Its a Debug Log statement. Is there a way to switch this off? While it does sliently fail it actually appears to abort the process. As a result using a render cause incorrect behaviour.
Pesudo Code:
public string myItem {get; set;}
public <tableOfMyItems> Items {get; set;}
public void AddSomething(){
myObject__c obj = new myObject__c();
obj.name = myItem
insert obj;
}
//VF Code
<apex:inputText value="{!myItem}"/>
<apex:outputPanel id="rerenderMe">
<!-- an Apex table that's rerendered with the list of myItems-->
<apex:pageBlocktable value="tableOfMyItems" var="item">
<apex:column value="{!item.Name}"/>
</apex:pageBlocktable>
<apex:outputPanel>
<apex:commandButton rerender="rerenderMe" action="{!AddSomething}" value="Add Something"/>
What happens is that the first Item is added to the table. But when a second Item is added it overwrites the first. So while the failure in Sarissa is slient it appears to bail out at this point.
@r_boyd_848 I wasn't able to reproduce your issue. This appears to work fine.
Page:
Controller:
-Jason
Thanks, the problem I have arises on a significantly more complex page then the sample I gave. This includes a drop down list that's rendered in each table row. I suspect this is the cause I'll need to break it down. I'll post the results when I'm done.
So the second Sarissa error that IE9 gives is actually a really annoying one. When the AJAX response is being processed, it hits this bit:
And IE9 chokes on the debug. Apparently it doesn't want to append the element set, or a null, or something to the string ... not entirely sure. When I first looked at it, I assumed it was misreporting, but after pulling the function apart and trying again, it continued reporting on the same line. Below is that function with the debug line removed, which seems to remove the second failure as well. Same as before, just place this somewhere it will be fired after the libraries load, but before the rerender.
Again, while these changes are lightweight - it is stil overriding a core function, test thoroughly, etc. Also, be careful cutting and pasting ... if any of the debug lines get split it will toss out an error.
Eeek, that is getting deep. Still seems like the best solution is adding this to constructor:
Only time this doesn't work is if your page is served from an ifram within another page as the headerss are completely ignored by IE9 and the page inherits X-UA-Compatible settings from the parent page. In this case you must add this meta tag to the parent page if you can:
-Jason
Yeah, I'd agree with that. I would try the HTML meta tag first, the the meta in code second, and the JavaScript last. Overriding this kind of stuff isn't trivial, despite how small the changes might be.
An official patch was released by the Visualforce team last night, so this should no longer be an issue. If you don't notice the fix right away, you might need to refresh/clear cache since this was a clientside issue.
Sweet! Thanks! So glad this made it into a patch fix and didn't get the whole IE9 isn't supported treatment.
Thanks to Josh et al
Heads up that I've still got pages that are braking with IE9 rerenders.
SCRIPT438: Object doesn't support this property or method
3_3_3.Finalorg.ajax4jsf.javascript.AjaxScript, line 172 character 51
Odd - different line from the JS. Is there a sample you've got I can poke at?
I noticed the different line number as well.
Unfortunately I am seeing this on one of our most complicated pages, may take me some time to isolate but I'll look into it.
I'm also seeing the "3_3_3.Finalorg.ajax4jsf.javascript.AjaxScript, line 172 character 51" error message in IE9.
I'd be interested to hear of any fix or if SFDC will be issuing a further patch.
Thanks
R
Can someone getting the line 172 error post a code snippet? I wasn't seeing any errors from the earlier test code.
We've got a fix for this bug and are tentatively scheduling a fix for next week.
Cool, thanks for update.
Hi ,
We are having a similar issue , but compared to yours, we have the issue in IE8 itself.
Surprisingly, the same code is working in one Env in IE 8.0 but not working in another salesforce environment in the same IE 8.0.
I am wondering what Salesforce does differently in different environments where browsers are concerned.
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)Timestamp: Mon, 20 Jun 2011 23:05:43 UTC
Message: Invalid argument.Line: 146Char: 96Code: 0URI: https://yahoo.qe.cs4.force.com/faces/a4j/g/3_3_3.Finalorg.ajax4jsf.javascript.AjaxScript
This is the error we are gettign in IE 8.0
Regards,
Chellappa
I have an Standard controller extension and I added this solution line:
Apexpages.currentPage().getHeaders().put('X-UA-Compatible', 'IE=8');
inside the constructor... nothing changed...
what can I do more? rerender is not working :(
I have a client with this issue in their CS12 Sandbox (running Winter '12) . It's a brand new VF page that is in pilot. What's odd is that I can't replicate the error on my IE9, but this one user in the UK with IE9 has the issue. The debug error is "Line 205: Error: Unable to get the value of the property 'Submit':object is null or undefined". If I go into debug mode, the issue is on the line for A4J.AJAX.Submit(....). AJAX is not defined, which creates the error.
There are 2 buttons on the page. One with immdiate=true and one without it. The immedate=true button works fine, while the other one does not. Adding immediate=true isn't really option for the 2nd button, though I suppose worse case I can rework the page logic to allow it.
In the mean time, I modified the controller code to add the header line for IE=8, however that did not resolve the issue. I'd like to avoid dropping all that JavaScript into the VF page, especially since this issue was supposed to be resolved by now.
I'll point out that I have an identical version of IE9 installed on my home desktop and do not have this issue at all. So, I guess the question is what makes his IE9 different from my IE9?
Hopefully someone else has found another solution and/or Salesforce has a new pending fix.
Best Regards,
Mike
That you can't replicate it in IE9 and that the IE8 emulation trick doesn't work really seems to point to something outside the User Agent. Does the user have access to another browser they can test with?
Is it possible to test the page outside of Winter '12?
Josh,
Thanks for the response. In talking with the client, they suspect that this persons laptop is out-of-spec. The machine was behind 69 critical updates, one or more of which could be the root cause. I'm waiting to hear back on the status. It was in the hands of their outsourced tech service. I'll keep you posted.
Best Regards,
Mike
Josh,
Finally heard back from the client. Basically, they completely "reset" the computer (probably installing all pending critical updates and any other "fixes") and all is working fine now.
Best Regards,
Mike