diff --git a/Message/Request/Request.js b/Message/Request/Request.js index 4c847ce..c5153ef 100644 --- a/Message/Request/Request.js +++ b/Message/Request/Request.js @@ -337,17 +337,17 @@ { const self = this; - if (self.xhr.readyState !== 1) { - self.xhr.open(this.method, jsOMS.Uri.UriFactory.build(this.uri)); + if (this.xhr.readyState !== 1) { + this.xhr.open(this.method, jsOMS.Uri.UriFactory.build(this.uri)); for (let p in this.requestHeader) { if (this.requestHeader.hasOwnProperty(p)) { - self.xhr.setRequestHeader(p, this.requestHeader[p]); + this.xhr.setRequestHeader(p, this.requestHeader[p]); } } } - self.xhr.onreadystatechange = function () + this.xhr.onreadystatechange = function () { switch (self.xhr.readyState) { case 4: @@ -370,12 +370,12 @@ if (this.type === jsOMS.Message.Request.RequestType.JSON) { if (typeof this.requestHeader !== 'undefined' && this.requestHeader['Content-Type'] === 'application/json') { - self.xhr.send(JSON.stringify(this.data)); + this.xhr.send(JSON.stringify(this.data)); } else { - self.xhr.send(this.queryfy(this.data)); + this.xhr.send(this.queryfy(this.data)); } } else if (this.type === jsOMS.Message.Request.RequestType.RAW) { - self.xhr.send(this.data); + this.xhr.send(this.data); } }; }(window.jsOMS = window.jsOMS || {})); diff --git a/UI/Component/Form.js b/UI/Component/Form.js index ea90609..8383ead 100644 --- a/UI/Component/Form.js +++ b/UI/Component/Form.js @@ -164,8 +164,8 @@ for (let property in injects) { if (injects.hasOwnProperty(property)) { counter++; - this.app.eventManager.addGroup(form.getId(), counter); - const result = injects[property](form, counter, form.getId()); + //this.app.eventManager.addGroup(form.getId(), counter); + const result = injects[property](form, form.getId()); if (result === false) { return; @@ -175,9 +175,7 @@ } } - if (counter === 0) { - this.app.eventManager.trigger(form.getId()); - } + this.app.eventManager.trigger(form.getId()); }; /** @@ -215,6 +213,8 @@ request.setRequestHeader('Content-Type', 'application/json'); request.setSuccess(function (xhr) { + console.log(xhr.response); + try { const o = JSON.parse(xhr.response), response = new jsOMS.Message.Response.Response(o), @@ -224,11 +224,7 @@ if (typeof o.status !== 'undefined') { self.app.notifyManager.send( - new jsOMS.Message.Notification.NotificationMessage( - o.status, - o.title, - o.message - ), jsOMS.Message.Notification.NotificationType.APP_NOTIFICATION + new jsOMS.Message.Notification.NotificationMessage(o.status, o.title, o.message), jsOMS.Message.Notification.NotificationType.APP_NOTIFICATION ); }