Commit e9d81b69 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Listbox: check the validity of all cells

parent 87d0fe78
...@@ -826,6 +826,33 @@ ...@@ -826,6 +826,33 @@
}); });
}, {mutex: 'changestate'}) }, {mutex: 'changestate'})
.declareMethod("checkValidity", function checkValidity(options) {
var form_gadget = this,
k,
field_gadget,
count = form_gadget.props.cell_gadget_list.length,
result = true,
queue = new RSVP.Queue();
function extendData(is_valid) {
result = result && is_valid;
}
for (k = 0; k < count; k += 1) {
field_gadget = form_gadget.props.cell_gadget_list[k];
// XXX Hack until better defined
if (field_gadget.checkValidity !== undefined) {
queue
.push(field_gadget.checkValidity.bind(field_gadget, options))
.push(extendData);
}
}
return queue
.push(function () {
return result;
});
}, {mutex: 'changestate'})
.onEvent('click', function click(evt) { .onEvent('click', function click(evt) {
// For some reason, Zelenium can click even if button has the disabled // For some reason, Zelenium can click even if button has the disabled
// attribute. So, it is needed for now to manually checks // attribute. So, it is needed for now to manually checks
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>969.29026.17236.63829</string> </value> <value> <string>969.37531.32072.23688</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1533741912.73</float> <float>1536324257.52</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </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