I have a WebAsyncRefreshPanel that contains a div with an image control in it. The idea is that the image will change every 10 seconds unless the mouse is over it which triggers a tooltip with information. After the mouse is moved off of the image the refreshes should resume.
In the mouseover event of the div I use setTimer(0) to stop the refreshes which works fine. In the mouseout event I use setTimer(10000) and refresh()...this triggers the refresh the first time but it doesn't refresh after the 10 seconds has elapsed. If I move the mouse back over the image and then off again it again triggers the refresh but only once. Am I missing something here.
<script type="text/javascript">
var panel;
panel.setTimer(0);
}
panel.setTimer(10000);
panel.refresh();
</script>
<igmisc:WebAsyncRefreshPanel ID="WebRefreshPanel" Width="550px" Height="412px" runat="server"
RefreshInterval="10000" RefreshTargetIDs="lblTesting,DestImg">
<div id="divImg" runat="server" onmouseover="BLOCKED SCRIPTdivImg_MouseOver();" onmouseout="BLOCKED SCRIPTdivImg_MouseOut();" >
<asp:Image title="" ID="DestImg" runat="server"/>
</div>
<input runat="server" type="hidden" id="hdnIndex" value="1" />
</igmisc:WebAsyncRefreshPanel>
Hi,
The timer is not really timer/interval, but timeout: window.setTimeout(), but not window.setInterval().The "refresh" functionality is not part of WARP, but CallBackManager. The CallBackManager sets timeout after previous timeout was recieved and processed. The value defined by warp.getTimer() is used for next timeout. That means if any of timeout was lost, then that stops all following actions. The warp.setTimer(0) has effect and stops next timeout only after previous request was processed. The setTimer(newValue) is not able to restart that process if chain was once broken. Actual interval between timer ticks is defined by getTimer() plus time required to send request and and get response.
The "restart" can not be used as a built-in feature, because there is no guarantee that previous request was already processed and that parallel multiple threads will not be started.
If application is absolutely sure that previous timeout was processed and it wants to restart timer again, then it may try to use internal function of CallBackManager (unfortunately no support in case of misbehavior). Source of ig_shared.js is public, so anybody can look at its implementation and figure out how it works. Below is example to start timer for a warp.
<script type="text/javascript">function restart(){ var warp = ig$('WebAsyncRefreshPanel1'); var man = ig_shared.getCBManager(); if(!warp || !man) return; warp.setTimer(1000); man._timer(warp.getUniqueID());}</script>
<igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server"></igmisc:WebAsyncRefreshPanel><input id="Button2" type="button" value="button" onclick="restart()" />
Did they mention when they were going to fix it?
I have the same problem, infragistics told me that's it's a bug.