Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: EE-2.0.0.Beta1
-
Component/s: Facelet Components
-
Labels:None
-
Environment:EE component showcase polling example, single or partial submit
Description
The polling example seems to be executing the polling JavaScript on every request resulting in a runaway timer.
Another example of the polling JavaScript call was implemented like this.
"<script language=\"JavaScript\" type=\"text/javascript\">\n" +
"// <![CDATA[\n" +
" function polingCall(){\n" +
" if (document.getElementById('polingForm')){\n"+
" document.getElementById('polingForm').submit();\n" +
" setTimeout( \"polingCall()\" , " + refreshFolderInterval + ");\n" +
" }\n" +
" }\n" +
"\n" +
"// ]]>\n" +
"</script>";
Where polingColl() was called from the body onload attribute. We did figure out away to suppress the setInterval() Javascript call in the polling call from getting executed on every request.
Another example of the polling JavaScript call was implemented like this.
"<script language=\"JavaScript\" type=\"text/javascript\">\n" +
"// <![CDATA[\n" +
" function polingCall(){\n" +
" if (document.getElementById('polingForm')){\n"+
" document.getElementById('polingForm').submit();\n" +
" setTimeout( \"polingCall()\" , " + refreshFolderInterval + ");\n" +
" }\n" +
" }\n" +
"\n" +
"// ]]>\n" +
"</script>";
Where polingColl() was called from the body onload attribute. We did figure out away to suppress the setInterval() Javascript call in the polling call from getting executed on every request.
Activity
Patrick Corless
created issue -
Patrick Corless
made changes -
Field | Original Value | New Value |
---|---|---|
Salesforce Case | [] | |
Fix Version/s | EE-2.0.0.Beta1 [ 10254 ] |
Patrick Corless
made changes -
Assignee | Brad Kroeger [ brad.kroeger ] | Carlo Guglielmin [ carlo.guglielmin ] |
Carlo Guglielmin
made changes -
Status | Open [ 1 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] |
r26018 - Updated the Javascript polling code so that it clears any previous poll before creating another one. This stops the runaway setInterval timers where three or four may be overlapping at once.
The new polling code:
<script type="text/javascript">
//<![CDATA[
var poll;
function doPoll()
{ clearInterval(poll); }{
if (poll != undefined)
poll = setInterval( "iceSubmit(formOf($('pollingRequest')),$('pollingRequest'),new Object());" , #
{interval});
}
doPoll();
//]]>
</script>