Entitlement quantity validation.

The widget base class has been modified to validate integer value
if the type is specified in the metadata. This is used to validate
entitlement quantity.
This commit is contained in:
Endi S. Dewata
2011-04-26 16:21:25 -05:00
committed by Endi Sukma Dewata
parent 000ba0531e
commit f256b8857f
7 changed files with 101 additions and 38 deletions

View File

@@ -74,11 +74,19 @@ IPA.dialog = function(spec) {
that.fields_by_name[field.name] = field;
};
that.field = function(field){
that.field = function(field) {
that.add_field(field);
return that;
};
that.is_valid = function() {
for (var i=0; i<that.fields.length; i++) {
var field = that.fields[i];
if (!field.valid) return false;
}
return true;
};
that.text = function(name){
that.field(IPA.text_widget({
name: name,