Commit 33bfadcb authored by Xiaowu Zhang's avatar Xiaowu Zhang

Modifie test files and gadgetfield js with the new formulator GadgetField

Use field key instead of field id
parent 6c04613d
......@@ -94,7 +94,7 @@
<!-- Initialize -->\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title=\'field_my_language\']</td>\n
<td>//input[@title=\'null\']</td>\n
<td></td>\n
</tr>\n
\n
......@@ -102,7 +102,7 @@
\n
<tr>\n
<td>type</td>\n
<td>//input[@title=\'field_my_language\']</td>\n
<td>//input[@title=\'null\']</td>\n
<td>couscous</td>\n
</tr>\n
\n
......@@ -122,14 +122,14 @@
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title=\'field_my_language\']</td>\n
<td>//input[@title=\'null\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@title=\'field_my_language\']</td>\n
<td>//input[@title=\'null\']</td>\n
<td></td>\n
</tr>\n
\n
......
......@@ -84,12 +84,27 @@
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/bar_module/0/Bar_viewGadgetField</td>\n
<td>${base_url}/bar_module/0/Bar_viewGadgetField/my_language/manage_main</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@name=\'field_js_sandbox\']</td>\n
<td>iframe</td>\n
</tr>\n
\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@type=\'submit\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/bar_module/0/Bar_viewGadgetField</td>\n
<td></td>\n
</tr>\n
<!-- Initialize -->\n
<tr>\n
<td>waitForElementPresent</td>\n
......@@ -99,7 +114,7 @@
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title=\'field_my_format\']</td>\n
<td>//input[@title=\'null\']</td>\n
<td></td>\n
</tr>\n
\n
......@@ -111,7 +126,7 @@
\n
<tr>\n
<td>type</td>\n
<td>//input[@title=\'field_my_format\']</td>\n
<td>//input[@title=\'null\']</td>\n
<td>couscous</td>\n
</tr>\n
\n
......@@ -136,7 +151,7 @@
\n
<tr>\n
<td>waitForElementPresent</td>\n
<td>//input[@title=\'field_my_format\']</td>\n
<td>//input[@title=\'null\']/</td>\n
<td></td>\n
</tr>\n
<tr>\n
......@@ -147,7 +162,25 @@
\n
<tr>\n
<td>verifyValue</td>\n
<td>//input[@title=\'field_my_format\']</td>\n
<td>//input[@title=\'null\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/bar_module/0/Bar_viewGadgetField/my_language/manage_main</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>type</td>\n
<td>//input[@name=\'field_js_sandbox\']</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@type=\'submit\']</td>\n
<td></td>\n
</tr>\n
\n
......
......@@ -61,7 +61,6 @@
<value>
<list>
<string>my_right</string>
<string>my_format</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="GadgetField" module="Products.ERP5Form.GadgetField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_format</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string>iframe</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Format</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: field.restrictedTraverse(\'gadget_stringfield.html\').absolute_url()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17000485.95</string> </value>
<value> <string>ts17097929.83</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -100,8 +100,8 @@
tmp = {};\n
list.push(g.getDeclaredGadget(scope));\n
tmp.sandbox = list_gadget[i].getAttribute("data-gadget-sandbox");\n
tmp.key = scope;\n
tmp.editable = list_gadget[i].getAttribute("data-gadget-editable");\n
tmp.key = tmp.editable;\n
tmp.value = list_gadget[i].getAttribute("data-gadget-value");\n
gadget_attributes.push(tmp);\n
}\n
......@@ -216,7 +216,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>6257</int> </value>
<value> <int>6264</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -30,7 +30,7 @@ class GadgetWidget(Widget.TextWidget):
def render_view(self, field, value, REQUEST=None, render_prefix=None, key=None):
kw = {}
kw['data-gadget-url'] = field.get_value('gadget_url')
kw['data-gadget-scope'] = 'field_' + field.id
kw['data-gadget-scope'] = field.id
if key is not None:
kw['data-gadget-editable'] = key
kw['class'] = "gadget"
......
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