I was working with a build of 12-Jan and the following problem was not present, but in 12-March build yes.
If I define this widget
isc.DynamicForm.create({
ID: "exampleForm",
fields: [{
type: "TextItem",
blur : function () {
alert(this.validators[0].type);
},
validators : [{
type : "custom",
condition : function (form, item, value) {
return true;
}
}],
required: true
}]
});
no problem. At blur of the widget it appears the alert: “custom”
but if I define it as
isc.ClassFactory.defineClass("AdvancedTextItem", TextItem);
isc.AdvancedTextItem.addProperties({
blur : function () {
alert(this.validators[0].type);
},
validators : [{
type : "custom",
condition : function (form, item, value) {
return true;
}
}]
});
isc.DynamicForm.create({
ID: "exampleForm",
fields: [{
type: "AdvancedTextItem",
required: true
}]
});
At blur of the widget it appears the alert: “required”, which is wrong (since both behaviors in both cases should be the same)
Also this.validators.length is “1” in all cases, so is not that the “required” validation has been added to the array… the “required” validation has override the “custom” validation
Notice that it only happens when required: true. If required: false the alert is “custom” (which is ok)
So, the questions:
- This is an issue/bug, isn’t it?
- When it is planed to be solved? (in order to update my version)
Regards & Thanks.