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/pages/response.js

    r487 r490  
    11define([
    2     "../app/Content",
    32    "../app/Page",
    4     "../lib/async",
    53    "../model/classes/responses",
    64    "dojo/_base/declare",
     
    1311    "require",
    1412    "dojo/text!./templates/response.html"
    15 ], function(Content, Page, async, responses, declare, event, json, lang, all, request, when, require, template) {
     13], function(Page, responses, declare, event, json, lang, all, request, when, require, template) {
    1614    return declare([Page],{
    1715        contextRequire: require,
     
    6058            .then(lang.hitch(this,function(response){
    6159                this.response = response;
    62                 Content.notify("Your response is saved.");
    63             }), function(err){
    64                 Content.notify(err,'error');
    65             });
     60                this.notify("Your response is saved.");
     61            }), lang.hitch(this,function(err){
     62                this.notify(err.error,'error');
     63            }));
    6664        },
    6765        _onSubmit: function(e) {
     
    8987            .then(lang.hitch(this,function(res){
    9088                this._showInfo("<div>Your response has been deleted, no answers have been saved.</div>");
    91                 Content.notify("Your response is deleted.");
    92             }), function(err){
    93                 Content.notify(err,'error');
    94             });
     89                this.notify("Your response is deleted.");
     90            }), lang.hitch(this,function(err){
     91                this.notify(err.error,'error');
     92            }));
    9593            if ( e ) { event.stop(e); }
    9694            return false;
Note: See TracChangeset for help on using the changeset viewer.