Commit c0b35430 authored by Ayush Tiwari's avatar Ayush Tiwari

[erp5_core]: Add hidden gadget field to facilitate lodaing required javascript...

[erp5_core]: Add hidden gadget field to facilitate lodaing required javascript files for the templates
parent ecfdbab0
......@@ -90,6 +90,7 @@
<value>
<list>
<string>your_reportbox</string>
<string>my_hidden_gadget</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_hidden_gadget</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_gadget_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -70,19 +70,7 @@ class ReportBoxWidget(Widget.Widget):
if callable(report_method):
return report_method()
def get_javascript_list(self, field, REQUEST=None):
"""
Returns list of javascript needed by the widget
"""
js_list = ['rsvp.js', 'renderjs.js', 'erp5_gadgetfield.js']
result = []
try:
for js_file in js_list:
result.append(field.restrictedTraverse(js_file).absolute_url())
except KeyError:
LOG('keyError:', ERROR, 'Error Value: %s' % js_file)
return []
return result
class ReportBoxValidator(Validator.Validator):
......
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