From 3ba3296e3d96bf103ce62a76fd2b13c27bde6c33 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 22 Jan 2017 21:06:37 +0100 Subject: [PATCH] Fix json serialization --- Message/Response/Response.js | 5 ++--- UI/FormManager.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Message/Response/Response.js b/Message/Response/Response.js index ee0efa8..37b3304 100644 --- a/Message/Response/Response.js +++ b/Message/Response/Response.js @@ -28,12 +28,11 @@ jsOMS.Message.Response.Response.prototype.getByIndex = function (index) { - //return this.responses[Object.keys(this.responses).sort()[index]]; - return this.responses; + return this.responses[index]; }; jsOMS.Message.Response.Response.prototype.count = function () { - return 1; + return this.responses.length; }; }(window.jsOMS = window.jsOMS || {})); \ No newline at end of file diff --git a/UI/FormManager.js b/UI/FormManager.js index d4fbf75..ed30edc 100644 --- a/UI/FormManager.js +++ b/UI/FormManager.js @@ -214,7 +214,7 @@ request.setSuccess(function (xhr) { try { - const o = JSON.parse(xhr.response), + const o = JSON.parse(xhr.response), response = new jsOMS.Message.Response.Response(o), responseLength = response.count(); let tempResponse = null,