Oct 07, 2011, 2:30 PM
[CLOSED] Tasks stop running after store.save() is called
Hi,
I'm having a strange problem when using a task manager.
I'm trying to essentially poll, say every 5 mins, and check if a text editor control has been changed; if it has, I'm updating a store with the changed text content and then triggering the stores .save() method (which uses an UpdateProxy).
The problem is that after I've triggered the .save() (which is all fine, it saves) the tasks seem to stop running. They're not autoRun tasks, I trigger them when I load the related store (the one I'm saving later on).
Are TaskManager tasks meant to stop after a DirectEvent or something like that?
Cheers,
Peter
I'm having a strange problem when using a task manager.
I'm trying to essentially poll, say every 5 mins, and check if a text editor control has been changed; if it has, I'm updating a store with the changed text content and then triggering the stores .save() method (which uses an UpdateProxy).
The problem is that after I've triggered the .save() (which is all fine, it saves) the tasks seem to stop running. They're not autoRun tasks, I trigger them when I load the related store (the one I'm saving later on).
Are TaskManager tasks meant to stop after a DirectEvent or something like that?
<ext:TaskManager runat="server" ID="taskDraftSaver">
<Tasks>
<ext:Task TaskID="taskDrafts" Interval="10000" AutoRun="false">
<Listeners>
<Update Fn="syncStoreWithEditor" />
</Listeners>
</ext:Task>
</Tasks>
</ext:TaskManager>
syncStoreWithEditor:var syncStoreWithEditor = function (taskRunCount) {
if (typeof pnlDocumentEditor_IFrame != "undefined" || taskDraftSaver.task[0].executing) {
var editor = pnlDocumentEditor_IFrame.eong;
if (storeClientReportDocuments.getCount() > 0 && (typeof editor != "undefined")) {
if (editor.hasContentChanged()) {
var record = storeClientReportDocuments.getById(cboReportList.getSelectedItem().value);
record.set(cboReportView.getSelectedItem().text.split(' ').join(''), editor.getBodyFragment());
var s = storeClientReportDocuments.save();
}
}
}
return true;
}
.. on the UpdateProxy Save handler, I'm calling taskDraftSaver.startAll()
. This doesn't appear to actually be starting the polling again, though.Cheers,
Peter
Last edited by Daniil; Oct 17, 2011 at 9:02 AM.
Reason: [CLOSED]