Commit cf2f200e authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

ElementUpdate.js: when updating a `value` attribute, use `$().val()`.

QfqForm.js: When handling responses to `save`, handle `element-update` independently from `form-update`
parent 4186d647
...@@ -78,6 +78,9 @@ var QfqNS = QfqNS || {}; ...@@ -78,6 +78,9 @@ var QfqNS = QfqNS || {};
n.ElementUpdate.setAttribute = function ($element, attributeName, attributeValue) { n.ElementUpdate.setAttribute = function ($element, attributeName, attributeValue) {
$element.attr(attributeName, attributeValue); $element.attr(attributeName, attributeValue);
if (attributeName.toLowerCase() === "value") {
$element.val(attributeValue);
}
}; };
n.ElementUpdate.deleteAttribute = function ($element, attributeName) { n.ElementUpdate.deleteAttribute = function ($element, attributeName) {
......
...@@ -895,6 +895,9 @@ var QfqNS = QfqNS || {}; ...@@ -895,6 +895,9 @@ var QfqNS = QfqNS || {};
// do we have to update the HTML Form? // do we have to update the HTML Form?
if (data['form-update']) { if (data['form-update']) {
this.applyFormConfiguration(data['form-update']); this.applyFormConfiguration(data['form-update']);
}
if (data['element-update']) {
this.applyElementConfiguration(data['element-update']); this.applyElementConfiguration(data['element-update']);
} }
......
...@@ -168,6 +168,7 @@ ...@@ -168,6 +168,7 @@
</div> </div>
</div> </div>
<input type="hidden" id="hidden" value="bla"/>
</form> </form>
</div> </div>
......
Supports Markdown
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