Functiondojox.off.sync.ActionLog.onReplay

dojo.require("dojox.off.sync");
defined in dojox/off/sync.js

This callback should be connected to by applications so that they can sync themselves when we go back online:

dojo.connect(dojox.off.sync.actions, "onReplay", function(action, actionLog){ // do something })

When we replay our action log, this callback is called for each of our action entries in the order they were added. The 'action' entry that was passed to add() for this action will also be passed in to onReplay, so that applications can use this information to do their syncing, such as contacting a server web-service to create a new item, for example.

Inside the method you connected to onReplay, you should either call

Usage

function (/*Object*/ action, /*dojox.off.sync.ActionLog*/ actionLog) (view source)
parametertypedescription
actionObjectreplaying or actionLog.continueReplay() to have the action log continue replaying its log and proceed to the next action; the reason you must call these is the action you execute inside of onAction will probably be asynchronous, since it will be talking on the network, and you should call one of these two methods based on the result of your network call.
actionLogdojox.off.sync.ActionLoghaltReplay(reason if an error occurred and you would like to halt
fieldtypedescription
.addto true. For applications that are rapidly adding many action log entries in a short period of time, it can be useful to set this to false and simply call save() yourself when you are ready to persist your command log -- otherwise performance could be slow as the default action is to attempt to persist the actions log constantly with calls to add().
.autoSaveBooleanWhether we automatically save the action log after each call to
.clearFunctionvoid Completely clears this action log of its entries
.continueReplayFunctionvoid Indicates that we should continue processing out list of actions.
.entriesArrayAn array of our action entries, where each one is simply a custom object literal that were passed to add() when this action entry was added.
.haltReplayFunctionvoid Halts replaying this command log.
.isReplayingBooleanIf true, we are in the middle of replaying a command log; if false, then we are not
.lengthFunctionNumber Returns the length of this action log
.onReplayFunctionvoid Called when we replay our log, for each of our action entries.
.onReplayFinishedFunctionFor advanced usage; most developers can ignore this. Called when we are finished replaying our commands; called if we have successfully exhausted all of our commands, or if an error occurred during replaying. The default implementation simply continues the synchronization process. Connect to this to register for the event: dojo.connect(dojox.off.sync.actions, "onReplayFinished", someFunc)
.reasonHaltedStringIf we halted, the reason why
.replayFunctionvoid For advanced usage; most developers can ignore this. Replays all of the commands that have been cached in this command log when we go back online; onCommand will be called for each command we have
.toStringFunction 
._loadFunction 
._saveFunction