Ignore:
Timestamp:
03/13/14 22:21:55 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Another shot at getting change events right for _ComplexValueMixin. Our previous approach made it impossible to detect if a change was cause during startup. Now we work purely with widget 'change' events. Children are connected during postCreate, addChild. If you add children otherwise you need to call connectChildsChanges yourself. Also to make sure events are generated, use _setValueInternal if you really need to set the value attribute yourself.
  • Removed unused widget.
Location:
Dev/trunk/src/client/qed-client/model/widgets
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/model/widgets/QuestionEditorPreviewItem.js

    r512 r513  
    4444            return false;
    4545        },
    46         _getValueAttr: function(value) {
     46        _getValueAttr: function() {
    4747            if ( this._editing === true ) {
    48                 this.value = this.innerWidget.get('value');
     48                return this.innerWidget.get('value');
    4949            }
    5050            return this.value;
    5151        },
    52         _setValueAttr: function(value) {
    53             this.value = value;
     52        _setValueAttr: function(value,priorityChange) {
     53            this._setValueInternal(value,priorityChange);
    5454            if ( this._editing  === true ) {
    5555                this._showEditWidget();
     
    9797            if ( this._editing === true ) {
    9898                if (!this.innerWidget.validate || this.innerWidget.validate() ) {
    99                     this.value = this.innerWidget.get('value');
     99                    this._setValueInternal(this.innerWidget.get('value'));
    100100                    this._showViewWidget();
    101101                }
     
    149149            if ( this.innerWidget !== null ) {
    150150                if ( this._editing === true ) {
    151                     this.triggerOnChange();
     151                    this._onChange();
     152                    // how to force event on widget here?
    152153                }
    153154                this.removeChild(this.innerWidget);
  • Dev/trunk/src/client/qed-client/model/widgets/SurveyRenderWidget.js

    r511 r513  
    3838                lang.mixin(newValue,widget.get('value'));
    3939            },this);
    40             this.value = newValue;
    41             return this.value;
     40            return newValue;
    4241        },
    43         _setValueAttr: function(value) {
     42        _setValueAttr: function(value,priorityChange) {
     43            this._setValueInternal(value,priorityChange);
    4444            array.forEach(this._getDescendantFormWidgets(),function(widget){
    4545                widget.set('value',value);
    4646            },this);
    47             this.value = value;
    4847        }
    4948    });
  • Dev/trunk/src/client/qed-client/model/widgets/SurveyRunWidget.js

    r512 r513  
    1414            }));
    1515        },
    16         startup: function() {
    17             this.inherited(arguments);
    18         },
    1916        _getValueAttr: function() {
    2017            var value = this.inherited(arguments);
  • Dev/trunk/src/client/qed-client/model/widgets/templates/QuestionEditorToolkit.html

    r502 r513  
    66                <label>Code:</label><input data-dojo-type="dijit/form/ValidationTextBox" required="required" name="code"/>
    77                <label>Categories:</label>
    8                 <div data-dojo-attach-point="categoryListNode" class="rftLineListView"></div> 
     8                <div data-dojo-attach-point="categoryListNode" class="rftLineListView"></div>
    99                <div data-dojo-attach-point="categoryBoxNode"></div>
    1010                <button class="inheritBgColor" data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:_onCategoryAdd" data-dojo-props="baseClass:'rftBlockButton', iconClass: 'rftIcon rftIconPlus'">Add</button><br/>
  • Dev/trunk/src/client/qed-client/model/widgets/templates/SurveyRunWidget.html

    r508 r513  
    33    <div>
    44        <label for="mode" class="qedLabel">Title</label>
    5         <textarea name="title" class="qedField"
    6                   data-dojo-props="required: true"
    7                   data-dojo-type="dijit/form/ValidationTextBox"></textarea>
     5        <div name="title" class="qedField"
     6             data-dojo-props="required: true"
     7             data-dojo-type="dijit/form/ValidationTextBox"></div>
    88    </div>
    99
    1010    <div>
    1111        <label for="mode" class="qedLabel">Description</label>
    12         <textarea name="description" class="qedField"
    13                   data-dojo-type="dijit/form/Textarea"></textarea>
     12        <div name="description" class="qedField"
     13             data-dojo-type="dijit/form/Textarea"></div>
    1414    </div>
    1515
    1616    <div>
    1717        <label for="startDate" class="qedLabel">Start date</label>
    18         <input type="text" name="startDate" class="qedField"
    19                data-dojo-type="dijit/form/DateTextBox"
    20                data-dojo-attach-point="startDateBox" />
     18        <div name="startDate" class="qedField"
     19             data-dojo-type="dijit/form/DateTextBox"
     20             data-dojo-attach-point="startDateBox"></div>
    2121    </div>
    2222
    2323    <div>
    2424        <label for="endDate" class="qedLabel">End date</label>
    25         <input type="text" name="endDate" class="qedField"
    26                data-dojo-type="dijit/form/DateTextBox"
    27                data-dojo-attach-point="endDateBox" />
     25        <div name="endDate" class="qedField"
     26             data-dojo-type="dijit/form/DateTextBox"
     27             data-dojo-attach-point="endDateBox"></div>
    2828    </div>
    2929
    3030    <div>
    3131        <label for="endDate" class="qedLabel">Allow respondents to delete their unsubmitted response</label>
    32         <input type="text" name="respondentCanDeleteOwnResponse"
    33                class="qedField"
    34                data-dojo-type="dijit/form/CheckBox" />
     32        <div type="text" name="respondentCanDeleteOwnResponse"
     33             class="qedField"
     34             data-dojo-type="dijit/form/CheckBox"></div>
    3535    </div>
    3636
    3737    <div>
    3838        <label for="mode" class="qedLabel">Mode</label>
    39         <select name="mode" class="qedField" data-dojo-type="dijit/form/Select">
     39        <div name="mode" class="qedField" data-dojo-type="dijit/form/Select">
    4040            <option value="open" selected="selected">Open</option>
    4141            <option value="closed">Closed</option>
    42         </select>
     42        </div>
    4343    </div>
    4444
Note: See TracChangeset for help on using the changeset viewer.