diff options
Diffstat (limited to 'install/ui/field.js')
-rw-r--r-- | install/ui/field.js | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/install/ui/field.js b/install/ui/field.js index 5f073705d..162ec81ba 100644 --- a/install/ui/field.js +++ b/install/ui/field.js @@ -487,6 +487,23 @@ IPA.checkbox_field = function(spec) { var that = IPA.field(spec); that.checked = spec.checked || false; + that.boolean_formatter = IPA.boolean_formatter(); + + that.load = function(record) { + + that.record = record; + + that.values = that.get_value(record, that.param); + + var value = that.boolean_formatter.parse(that.values); + if (value === '') value = that.widget.checked; //default value + + that.values = [value]; + + that.load_writable(record); + + that.reset(); + }; that.widgets_created = function() { @@ -510,13 +527,6 @@ IPA.checkboxes_field = function(spec) { var that = IPA.field(spec); - that.checkbox_load = that.load; -/* - // a checkbox will always have a value, so it's never required - that.is_required = function() { - return false; - }; -*/ return that; }; |