Why does the timer below get triggered every second, popping up the
alert and crashing the browser? I expect it to be triggered every 10
seconds:
public class AlertEntryPoint implements EntryPoint {
Map<Integer, List<AlertDTO>> alertGroupByTypeDTOs = new
TreeMap<Integer, List<AlertDTO>>();
List locationsInfoDTOList = new ArrayList<LocationsInfoDTO>();
static class AlertTimer extends Timer {
AlertEntryPoint entryPoint = null;
public AlertTimer(AlertEntryPoint alertEntryPoint) {
entryPoint = alertEntryPoint;
}
boolean stop;
@Override
public void run() {
while (!stop) {
schedule(1000 * 10);
entryPoint.refreshData();
Window.alert("Somebody started me");
}
}
}
@Override
public void onModuleLoad() {
//refreshData();
AlertEntryPoint.AlertTimer timer = new AlertTimer(this);
timer.run();
}
.
.
.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.