Commit 5ad60e06 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Fix form_validation_error handling

As form_validation_error was not set in render, validation errors were still visible after an edit.
parent 021df785
......@@ -82,8 +82,8 @@
options: options,
view: options.view,
url: url,
erp5_document: result,
erp5_form: erp5_form
erp5_document: JSON.stringify(result),
erp5_form: JSON.stringify(erp5_form)
});
});
});
......@@ -104,13 +104,8 @@
page_template_gadget = result;
var sub_options = options.fg || {},
erp5_document = gadget.state.erp5_document,
erp5_form = gadget.state.erp5_form;
// Render the page template form
if (options.hasOwnProperty("form_validation_error")) {
erp5_document._embedded._view = options.form_validation_error;
}
erp5_document = JSON.parse(gadget.state.erp5_document),
erp5_form = JSON.parse(gadget.state.erp5_form);
loadFormContent(gadget, erp5_document._embedded._view);
......@@ -139,7 +134,12 @@
});
})
.allowPublicAcquisition("displayFormulatorValidationError", function (param_list) {
return this.changeState({form_validation_error: param_list[0]});
var erp5_document = JSON.parse(this.state.erp5_document);
erp5_document._embedded._view = param_list[0];
// Force refresh
erp5_document._now = Date.now();
return this.changeState({erp5_document: JSON.stringify(erp5_document)});
});
}(window, rJS, URI));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.23027.11225.50944</string> </value>
<value> <string>954.44527.39200.57275</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1476194208.6</float>
<float>1476793905.11</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment