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.
File:
1 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);
Note: See TracChangeset for help on using the changeset viewer.