Commit 696602e1 authored by Romain Courteaud's avatar Romain Courteaud

WIP [erp5_web_renderjs_ui] Prototype update dialog support

update_method has to be send
parent 913edbfb
......@@ -35,7 +35,8 @@
data-gadget-scope="erp5_form"
data-gadget-sandbox="public">
</div>
<input class="dialogconfirm" data-theme="b" data-inline="true" type="submit" data-i18n="[value]Proceed" value="Proceed" data-icon="check" />
<input name="action_confirm" class="dialogconfirm" data-theme="b" data-inline="true" type="submit" data-i18n="[value]Proceed" value="Proceed" data-icon="check" />
<button name="action_update" type="submit" data-i18n="Update">Update</button>
<a class="dialogcancel" data-i18n="Cancel">Cancel</a>
</form>
</body>
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.14191.38290.31931</string> </value>
<value> <string>965.626.11255.31692</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1506093694.63</float>
<float>1516722470.92</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -10,7 +10,7 @@
return [obj];
}
function submitDialog(gadget) {
function submitDialog(gadget, submit_action_id, is_update_method) {
var form_gadget = gadget,
action = form_gadget.state.erp5_document._embedded._view._actions.put,
form_id = form_gadget.state.erp5_document._embedded._view.form_id,
......@@ -30,7 +30,10 @@
data[form_id.key] = form_id['default'];
// XXX Hardcoded
data.dialog_id = form_id['default'];
data.dialog_method = action.action;
data.dialog_method = form_gadget.state.form_definition[submit_action_id];
if (is_update_method) {
data.update_method = data.dialog_method;
}
//XXX hack for redirect, difined in form
redirect_to_parent = content_dict.field_your_redirect_to_parent;
for (key in content_dict) {
......@@ -383,8 +386,14 @@
})
.onEvent('submit', function () {
return submitDialog(this);
}, false, true);
return submitDialog(this, "action");
}, false, true)
.onEvent('click', function (evt) {
if (evt.target.name === "action_update") {
evt.preventDefault();
return submitDialog(this, "update_action", true);
}
}, false, false);
}(window, rJS, RSVP, URI, calculatePageTitle, Blob, URL, document, jIO));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.670.53338.41130</string> </value>
<value> <string>965.684.47475.20787</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1516725149.52</float>
<float>1516801577.56</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