Ignore:
Timestamp:
03/08/14 22:51:23 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Mark content as dirty to prevent moving away from unsaved data.
  • Better change propagation from lists and our own widgets.
  • Generate notifications for errors and show correct message.
  • Moved all path/url generation to the class stores, not everywhere we use it.
  • Give user always a choice between Save and Save & Close.
  • Better refresh behaviour on form changes and saves.
  • Don't generate duplicate code error when existing object is the one you're storing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/model/classes/_Class.js

    r487 r490  
    2727        },
    2828        load: function(id) {
    29             return this._store.get(id).then(lang.hitch(this,'_doDeserialize'));
     29            return this._store.get(id)
     30            .then(lang.hitch(this,'_doDeserialize'),
     31                  lang.hitch(this,'_deserializeError'));
    3032        },
    3133        save: function(obj) {
    32             return this._store.put(this._doSerialize(obj));
     34            return this._store.put(this._doSerialize(obj))
     35            .otherwise(lang.hitch(this,'_deserializeError'));
    3336        },
    3437        remove: function(objOrId,rev) {
     
    4043                rev = this.getRev(objOrId);
    4144            }
    42             return this._store.remove(id,{headers:{'If-Match':'"'+rev+'"'}});
     45            return this._store.remove(id,{headers:{'If-Match':'"'+rev+'"'}})
     46            .otherwise(lang.hitch(this,'_deserializeError'));
    4347        },
    4448        getRev: function(obj) {
    4549            return obj._rev;
     50        },
     51        getName: function() {
     52            return this._type;
     53        },
     54        getObjectPath: function(idOrObj) {
     55            return '/'+this._collection+'/'+(typeof idOrObj === "string" ?
     56                                             idOrObj :
     57                                             this.getId(idOrObj));
    4658        }
    4759    });
Note: See TracChangeset for help on using the changeset viewer.