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
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
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>