By default, don't throw an exception from EditPane.getFieldValue when a
field is required and the value is null. Otherwise, external code is
unable to use this method for inspecting the pane. Make checkRequired
an additional method flag.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
}
},
- getFieldValue : function(field) {
+ getFieldValue : function(field, checkRequired) {
for(var i in this.fieldList) {
if(field == this.fieldList[i].name) {
var val = this.fieldList[i].widget.getFormattedValue();
- if (val == null && /* XXX stricter check needed? */
+ if (checkRequired &&
+ val == null && /* XXX stricter check needed? */
this.fieldList[i].widget.isRequired()) {
throw new Error("req");
}
return val;
+
}
}
},
try {
for(var idx in fields) {
this.fmObject[fields[idx]](
- this.getFieldValue(fields[idx])
+ this.getFieldValue(fields[idx], true)
);
}
} catch (E) {