source: Dev/trunk/client/qed/widgets/_ComplexValueMixin.js @ 441

Last change on this file since 441 was 441, checked in by hendrikvanantwerpen, 12 years ago

Big cleanup of the question content.

  • Replaced old list implementations with a new one that behaves like a form widget.
  • All question content is now in separate widgets, not in the factory itself.
  • Added form and widget validation for question editing.
File size: 974 bytes
Line 
1define([
2    "dijit/_Container",
3    "dijit/form/_FormMixin",
4    "dojo/_base/array",
5    "dojo/_base/declare"
6], function(_Container, _FormMixin, array, declare) {
7    return declare([_Container,_FormMixin],{
8        name: "",
9        value: null,
10        disabled: false,
11        readOnly: false,
12        _setDisabledAttr: function(value) {
13            this._set("disabled", value);
14            array.forEach(this._getDescendantFormWidgets(), function(child){
15                child.set("disabled", value);
16            });
17        },
18        _setReadOnlyAttr: function(value) {
19            this._set("readOnly", value);
20            array.forEach(this._getDescendantFormWidgets(), function(child){
21                child.set("readOnly", value);
22            });
23        },
24        focus: function() {
25            var children = this._getDescendantFormWidgets();
26            if ( children.length > 0 ) {
27                children[0].focus();
28            }
29        }
30    });
31});
Note: See TracBrowser for help on using the repository browser.