Commit a92ffff8 authored by Sven Franck's avatar Sven Franck

app: allow form widget to be updated (refreshed)

parent 9ce5d9c0
...@@ -1483,21 +1483,28 @@ ...@@ -1483,21 +1483,28 @@
container = document.createDocumentFragment(); container = document.createDocumentFragment();
form_id = "form_" + util.uuid(); form_id = "form_" + util.uuid();
item_id = spec.data ? (spec.data._id || undefined) : undefined; item_id = spec.data ? (spec.data._id || undefined) : undefined;
form = factory.element({ if (spec.update) {
"type": "form", form = document.createDocumentFragment();
"direct": { } else {
"id": form_id, form = factory.element({
"method": "POST", "type": "form",
"action": "#", "direct": {
"className": (spec.class_list || "") "id": form_id,
}, "method": "POST",
"attributes": {"data-ajax": false, "autocomplete": "off"}, "action": "#",
"logic": { "className": (spec.class_list || "")
"data-reference": spec.reference || null, },
"data-depend": spec.depend || null, "attributes": {
"data-reset": spec.reset || null "data-ajax": false,
} "autocomplete": "off",
}); "data-widget": "form"
},
"logic": {
"data-reference": spec.reference || null,
"data-map": spec.map_children || null
}
});
}
// NOTE: needed to differentiate between PUT/POST // NOTE: needed to differentiate between PUT/POST
// TODO: block_identifier is only used for release_install, find better! // TODO: block_identifier is only used for release_install, find better!
......
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