Hi,
I use the 8.3 latest nightly of 17th of april. I noticed that in some cases when saving a form that values changed on the server are not set back into the form.
I debugged the code and it seems that the method DataBoundComponent.fieldValuesAreEqual does not handle custom types, even if the custom type extends date/datetime.
So server-side changes in fields which have a custom simple type are not detected.
It may make sense to even use the field.compareValues method. At least that solves it in our case.
I did a local workaround for this and noticed something else also:
- if the server changes a value then the form field is not refreshed, so with my workaround the change is detected, the value is set in the form but not directly in the formitem but through the _saveValues of the form.
- In the _saveDataReply there is this code:
currentValues[i] = data[i];
hasChanges = true;
when a value on the server changes, this results in this being executed:
which again results in that this is never done (as the internal form values are now the same as the server values and unequal to the submitted values):
Does it make somewhat sense what I am saying?
gr. Martin
I use the 8.3 latest nightly of 17th of april. I noticed that in some cases when saving a form that values changed on the server are not set back into the form.
I debugged the code and it seems that the method DataBoundComponent.fieldValuesAreEqual does not handle custom types, even if the custom type extends date/datetime.
So server-side changes in fields which have a custom simple type are not detected.
It may make sense to even use the field.compareValues method. At least that solves it in our case.
I did a local workaround for this and noticed something else also:
- if the server changes a value then the form field is not refreshed, so with my workaround the change is detected, the value is set in the form but not directly in the formitem but through the _saveValues of the form.
- In the _saveDataReply there is this code:
currentValues[i] = data[i];
hasChanges = true;
when a value on the server changes, this results in this being executed:
Code:
if (hasChanges) { // apply changed field values from data directly to this.values this._saveValues(currentValues); }
Code:
var submittedVal = isc.DynamicForm._getFieldValue(path, item, submittedValues, this); if (this.fieldValuesAreEqual(item, submittedVal, this.getValue(path))) { if (hasChanges) { var serverVal = isc.DynamicForm._getFieldValue(path, item, data, this); if (!this.fieldValuesAreEqual(item, submittedVal, serverVal)) { item.setValue(serverVal); } }
Does it make somewhat sense what I am saying?
gr. Martin
Comment