1
votes

I have developed an XPages application (on an XWorks Server) which works well with Firefox, Chrome and Internet Explorer 11. However, with Internet Explorer 9 I frequently get the error message "application is not responding due to a long running script" when switching between Read Mode and Edit Mode (and also when clicking on buttons which execute Dojo CSJS and SSJS). I have tried deselecting "runtime optimized JS and CSS" but the problem remains. What else can I try to resolve this problem?

The code behind the Edit Button is:

<xp:button id="button2">

                    <xp:this.value><![CDATA[${javascript:
applicationScope.get("actEditDocument")}]]></xp:this.value>
                    <xp:this.rendered><![CDATA[#{javascript:
var aLevel = getComponent("HasAuthorRights").getValue();

var hasStatusAccess = getComponent("HasStatusAccess2").getValue();
var cLevel = @If((!currentDocument.isEditable() && (hasStatusAccess == @True() 
|| @IsNewDoc() == 1)),"1","0");
@If(aLevel == "1" && cLevel == "1",true,false)}]]></xp:this.rendered>
                    <xp:eventHandler event="onclick" submit="true"
                        refreshMode="partial" id="eventHandler1"
                        refreshId="AllJobReferencePanel" disableValidators="true"
                        execMode="partial">
                        <xp:this.action>

                            <xp:actionGroup>

                                <xp:changeDocumentMode
                                    mode="edit">
                                </xp:changeDocumentMode>
                            </xp:actionGroup>
                        </xp:this.action>

                        <xp:this.script>
                            <xe:dojoFadeOut
                                node="AllJobReferencePanel" duration="10000">
                            </xe:dojoFadeOut>
                        </xp:this.script></xp:eventHandler>
                </xp:button>

EDIT: I also added

var exCon = facesContext.getExternalContext();
var response = exCon.getResponse();
response.setHeader("X-UA-Compatible", "IE=EmulateIE7");

to the beforeRenderResponse event of each XPage

1
Definitely don't just turn off the aggregation of JS and CSS. Posting some code of the running script and HOW it's kicked off might help. So we can better see what exactly is going on.David Leedy
Have added this code nowuser1358852
ten seconds fadeout - dojo animations may cause poor performance, by the way.Frantisek Kossuth

1 Answers

2
votes

You can try increasing the time out and see if that helps. Put this at the top of your pages that are causing issues. This changes to 10s from the default of 6s. You can adjust the time by changing the number. Changing the "run optimized JS and CSS" not going to make a difference but to slow things down.

<xp:scriptBlock id="setLatencyBlock">
        <xp:this.value><![CDATA[XSP.addOnLoad(function() { 
//increase Ajax request timeout to 10 seconds 
XSP.submitLatency = 10 * 1000; 
});]]></xp:this.value>
    </xp:scriptBlock>

Code credit: http://www.mindoo.de/web/x2ewiki.nsf/dx/XSPSubmitLatency

You can use the isIE() method to load this for old Internet Explorer only, as it sounds like you don't need it for modern user agents. (IE 11 doesn't work with isIE() which works to your benefit)


UPDATE: Tony, I agree with Frantisek in his comment above. If you try an different approach there, you might not need to up the timeout. I use the above code to wait for a long java process that I don't have a lot of control over. Increasing the timeout is a band aid, and should be avoided unless necessary