form.save() triggers double POST

Hello,

I have a simple scenario: A form is bound to a grid.

var dp = new dataProcessor(url);
dp.setTransactionMode('POST', true);
dp.init(grid);
...
var form_items = [
    ...
];
var form = win.attachForm(form_items);
form.bind(grid);
grid.setCursor(id);
form.attachEvent("onButtonClick", function(id) {
    ...
    form.save();
}

Form is loaded fine. After I press the submit button form is POSTed twice.

Is it an expected behavior? If not, what I am doing wrong? If yes, how can I avoid double POST?

TIA,

George

For someone who might be in the same boat:

I have found the simillar thread @ http://forum.dhtmlx.com/viewtopic.php?f=14&t=10915.

Seems, for every cell which is modified, a separate event is queued and as soon as I use form.save(), these events are triggered. The following code did the trick for me:

form.attachEvent("onButtonClick", function(id) {
    ...
    // set update mode to manual
    dp.setUpdateMode('off');
    // save changes
    form.save(); dp.sendData();
    // restore update mode to it's initial value
    dp.setUpdateMode('cell');
}