Ignore:
Timestamp:
03/10/14 16:07:00 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Indicate of refresh is due to load or due to save in _ObjectPage.
  • _ComplexValueMixin & ListWidget? catch all change events and drops them if still being created.
Location:
Dev/trunk/src/client/qed-client/pages
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/pages/_ObjectPage.js

    r492 r500  
    2222        _load: function() {
    2323            if ( this.object ) {
    24                 this._refresh();
     24                this._refresh(true);
    2525            } else if ( this.objectId ) {
    2626                if ( this.objectId === "new" ) {
    2727                    this.object = this.classStore.create();
    28                     this._refresh();
     28                    this.markDirty();
     29                    this._refresh(true);
    2930                } else {
    3031                    this.classStore.load(this.objectId)
    31                     .then(lang.hitch(this,'_setObject'),
    32                           lang.hitch(this,function(err){
    33                                 this.die(err.error);
    34                             }));
     32                    .then(lang.hitch(this,function(object){
     33                        this._setObject(object,true);
     34                    }),lang.hitch(this,function(err){
     35                        this.die(err.error);
     36                    }));
    3537                }
    3638            } else {
    37                 this.die("No valid uid or object passed!");
     39                this.die("No valid id or object passed!");
    3840            }
    3941        },
    40         _setObject: function(object) {
     42        _setObject: function(object,initial) {
    4143            this.object = object;
    4244            if ( this.objectId === "new" ) {
    4345                this.go(this.classStore.getObjectPath(this.object),{},true);
    4446            }
    45             this._refresh();
     47            this.markClean();
     48            this._refresh(initial);
    4649        },
    47         _refresh: function() {},
     50        _refresh: function(initial) {},
    4851        _save: function() {
    4952            return this.classStore.save(this.object)
    5053            .then(lang.hitch(this,function(object){
    51                 this.markClean();
    5254                this._setObject(object);
    5355                this.notify(this.classStore.getName()+" successfully saved.");
  • Dev/trunk/src/client/qed-client/pages/question.js

    r498 r500  
    2323            this._load();
    2424        },
    25         _refresh: function() {
    26             this.propertiesForm.set('value',this.object,null);
    27             this.contentList.set('value',this.object.content,null);
    28             this._internalRefresh();
    29         },
    30         _internalRefresh: function(){
     25        _refresh: function(initial) {
     26            if ( initial === true ) {
     27                this.propertiesForm.set('value',this.object,null);
     28                this.contentList.set('value',this.object.content,null);
     29            }
    3130            this.titleNode.innerHTML = this.object.title || "";
    3231        },
     
    3433            this._updateObject();
    3534            this.markDirty();
    36             this._internalRefresh();
     35            this._refresh();
    3736        },
    3837        _handleContentChange: function() {
    3938            this._updateObject();
    4039            this.markDirty();
    41             this._internalRefresh();
     40            this._refresh();
    4241        },
    4342        _updateObject: function() {
  • Dev/trunk/src/client/qed-client/pages/survey.js

    r498 r500  
    6161            this.questionList.startup();
    6262        },
    63         _refresh: function() {
    64             this.propertiesForm.set('value',{survey:this.object},null);
    65             this.questionList.set('value',this.object.questions,null);
    66             this._internalRefresh();
    67         },
    68         _internalRefresh: function() {
     63        _refresh: function(initial) {
     64            if ( initial === true ) {
     65                this.propertiesForm.set('value',{survey:this.object},null);
     66                this.questionList.set('value',this.object.questions,null);
     67            }
    6968            this.titleNode.innerHTML = this.object.title || "(set title in properties)";
    7069        },
     
    7574            this.object.questions = this.questionList.get('value');
    7675            this.markDirty();
    77             this._internalRefresh();
     76            this._refresh();
    7877        },
    7978        _onShowProperties: function(evt) {
     
    8685            lang.mixin(this.object, this.propertiesForm.get('value').survey);
    8786            this.markDirty();
    88             this._internalRefresh();
     87            this._refresh();
    8988            if ( evt ) { event.stop(evt); }
    9089            return false;
  • Dev/trunk/src/client/qed-client/pages/surveyRun.js

    r498 r500  
    2929            this._load();
    3030        },
    31         _refresh: function() {
    32             this.surveySummaryWidget.set('value',this.object.survey,null);
    33             this.surveyRunWidget.set('value',this.object,null);
    34             this._internalRefresh();
    35             this._loadResponses();
    36         },
    37         _internalRefresh: function() {
     31        _refresh: function(initial) {
     32            if ( initial === true ) {
     33                this.surveySummaryWidget.set('value',this.object.survey,null);
     34                this.surveyRunWidget.set('value',this.object,null);
     35                this._loadResponses();
     36            }
    3837            this.titleNode.innerHTML = this.object.title || "";
    3938            if ( this.object.mode === "open" ) {
     
    7776            this._updateObject();
    7877            this.markDirty();
    79             this._internalRefresh();
     78            this._refresh();
    8079        },
    8180        _buildGeneralURL: function(surveyRun) {
Note: See TracChangeset for help on using the changeset viewer.