Commit 1e21a536 authored by Boxiang Sun's avatar Boxiang Sun Committed by Eteri

erp5_officejs_support_request_ui: Fix the field_listbox_begin_from can not found issue

This issue was reported by Nicolas. When embedding the
support request application in other App. The `options`
parameter in the `render` function is undefined, so the
`field_listbox_begin_from` can not be found. Use
`getUrlParameter` to retrieve it from URL.
parent 0b4e17f5
......@@ -16,6 +16,7 @@
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("updateHeader", "updateHeader")
......@@ -80,15 +81,18 @@
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) {
.declareMethod("render", function () {
var gadget = this;
return gadget.changeState({
render: true
})
.push(function () {
return gadget.getUrlParameter('field_listbox_begin_from');
})
.push(function (field_listbox_begin_from) {
return gadget.changeState({
field_listbox_begin_from: options.field_listbox_begin_from
field_listbox_begin_from: field_listbox_begin_from
});
})
.push(function () {
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.1253.58085.39031</string> </value>
<value> <string>962.1258.50557.40021</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1505136646.23</float>
<float>1505136885.5</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