Changeset 500 for Dev/trunk/src/client/qed-client/pages/_ObjectPage.js
- Timestamp:
- 03/10/14 16:07:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/pages/_ObjectPage.js
r492 r500 22 22 _load: function() { 23 23 if ( this.object ) { 24 this._refresh( );24 this._refresh(true); 25 25 } else if ( this.objectId ) { 26 26 if ( this.objectId === "new" ) { 27 27 this.object = this.classStore.create(); 28 this._refresh(); 28 this.markDirty(); 29 this._refresh(true); 29 30 } else { 30 31 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 })); 35 37 } 36 38 } else { 37 this.die("No valid uid or object passed!");39 this.die("No valid id or object passed!"); 38 40 } 39 41 }, 40 _setObject: function(object ) {42 _setObject: function(object,initial) { 41 43 this.object = object; 42 44 if ( this.objectId === "new" ) { 43 45 this.go(this.classStore.getObjectPath(this.object),{},true); 44 46 } 45 this._refresh(); 47 this.markClean(); 48 this._refresh(initial); 46 49 }, 47 _refresh: function( ) {},50 _refresh: function(initial) {}, 48 51 _save: function() { 49 52 return this.classStore.save(this.object) 50 53 .then(lang.hitch(this,function(object){ 51 this.markClean();52 54 this._setObject(object); 53 55 this.notify(this.classStore.getName()+" successfully saved.");
Note: See TracChangeset
for help on using the changeset viewer.