Hi, I realize queueing in SmartGWT has been already discussed a lot, but I still have a question. Here is my code:
RPCManager.startQueue();
form1.saveData(form1Callback);
form2.saveData(form2Callback);
dataSource1.removeData(record1, ds1Callback);
dataSource2.addData(record2, ds2Callback);
RPCManager.sendQueue();
Suppose dataSource2 action depends on dataSource1 action. How can I guarantee that dataSource2 is executed only after dataSource1 has completed? One solution might be to invoke dataSource2 action from within the callback of dataSource1 action, but I don't think this is right. I do run into a situation when dataSource1 action has not completed by the time dataSource2 action starts to execute. What is the best practice to handle this situation?
Thank you very much for your input.
RPCManager.startQueue();
form1.saveData(form1Callback);
form2.saveData(form2Callback);
dataSource1.removeData(record1, ds1Callback);
dataSource2.addData(record2, ds2Callback);
RPCManager.sendQueue();
Suppose dataSource2 action depends on dataSource1 action. How can I guarantee that dataSource2 is executed only after dataSource1 has completed? One solution might be to invoke dataSource2 action from within the callback of dataSource1 action, but I don't think this is right. I do run into a situation when dataSource1 action has not completed by the time dataSource2 action starts to execute. What is the best practice to handle this situation?
Thank you very much for your input.