TeamDev-Archive / OpenFaces

OpenFaces JSF library
28 stars 15 forks source link

Access denied script error with changing tabs in IE8 modes #11

Open openfaces opened 10 years ago

openfaces commented 10 years ago

Geoff Groskreutz Receive an Access denied script error when changing tabs when using an IE browser in IE8 or lower standards mode (including IE5 quirks mode).

location: webapp/faces/javax.faces.resource/util/util.js?ln=openfaces&ofver=3.1.EA1.c1_aug2012_43
SCRIPT70: Permission denied
util.js, line 3226 character 7

This occurs when using other components as well, but my current case is when the user switches tabs.

<o:tabSet id="cohortlist_tabs" value="#{cohortBean.cohortTab}" styleClass="TabSet" tabClass="TabItem" rolloverTabClass="TabItemRollover" selectedTabClass="TabItemSelected">
     <o:tabSetItem itemValue="Public">Public</o:tabSetItem>
     <o:tabSetItem itemValue="Private">Private</o:tabSetItem>
     <o:ajax event="change" render=":cohort_form:cohortlist_table :cohort_form:pnlMessages"></o:ajax>
    </o:tabSet>

I am using the latest nightly build, as shown below, at least thats the one referenced on the Nightly build download page. And using Mojarra 2.1.22 on Tomact 7.0.42, it is also a problem with Mojarra 2.1.11, 2.1.14, 2.1.22 and 2.1.24

The code link below, shows that when running in IE8 Standards (this is max support for IE8 browsers of course) or below, or IE5 Quirks mode, IE is throwing an Access Denied exception when retrieving the style attribute of the current css rule. I am not sure why IE8 prevents this, it occurs both when used in a Iframe or when this page has its own window. When running IE9 Standards mode or higher, then you do not receive this script error, and the page renders just fine. A short term fix would be just to trap any exceptions in the script around this usage, and just ignore it, and continue on, and assume that the style is null, and make a check for that in further usage of it. That way it will not cause any further scripts to fail, but it will just skip whatever styling it was suppose to do, because it couldn't get access to it.

var ruleStyle = cssRule.style;

openfaces commented 10 years ago

Geoff Groskreutz An exception catch has been added in the nightly build: 3.1.EA1.1257, which mitigates this issue. It does not fix the underlying cause, which leads to some Css styles not getting applied correctly. But, at least it no longer fails all scripts on the page, and the AJAX calls continue to function...more or less.

openfaces commented 10 years ago

Sergey Pensov Thanks for detailed request. We will check this issue, and if we find a better way to do this , we will fix and let you know.