Commit 9f7f8762 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Add getTextContent on string field

parent a9107863
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
.setState({ .setState({
tag: 'p' tag: 'p'
}) })
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
var field_json = options.field_json || {}, var field_json = options.field_json || {},
state_dict = { state_dict = {
...@@ -19,6 +20,7 @@ ...@@ -19,6 +20,7 @@
state_dict.text_content = state_dict.value; state_dict.text_content = state_dict.value;
return this.changeState(state_dict); return this.changeState(state_dict);
}) })
.onStateChange(function (modification_dict) { .onStateChange(function (modification_dict) {
var element = this.element, var element = this.element,
gadget = this, gadget = this,
...@@ -46,7 +48,6 @@ ...@@ -46,7 +48,6 @@
.push(function (input) { .push(function (input) {
return input.render(gadget.state); return input.render(gadget.state);
}); });
}) })
.declareMethod('getContent', function () { .declareMethod('getContent', function () {
...@@ -59,6 +60,13 @@ ...@@ -59,6 +60,13 @@
return {}; return {};
}) })
.declareMethod('getTextContent', function () {
return this.getDeclaredGadget('sub')
.push(function (gadget) {
return gadget.getTextContent();
});
})
.declareMethod('checkValidity', function () { .declareMethod('checkValidity', function () {
if (this.state.editable) { if (this.state.editable) {
return this.getDeclaredGadget('sub') return this.getDeclaredGadget('sub')
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>954.34570.5720.55227</string> </value> <value> <string>954.35858.57287.35225</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1476197972.06</float> <float>1476273908.28</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