Commit 08e44d70 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: add first support of multilistfield

parent f37dbece
......@@ -104,7 +104,7 @@ def renderField(field, meta_type=None):\n
\n
if meta_type == "ProxyField":\n
result = renderField(field, meta_type=field.getRecursiveTemplateField().meta_type)\n
elif meta_type in ("ListField", "ParallelListField", "MultiListField"):\n
elif meta_type == "ListField":\n
result = {\n
"type": meta_type,\n
"key": field.generate_field_key(),\n
......@@ -118,6 +118,22 @@ def renderField(field, meta_type=None):\n
# XXX Message can not be converted to json as is\n
"items": field.get_value("items"),\n
}\n
elif meta_type in ("ParallelListField", "MultiListField"):\n
result = {\n
"type": meta_type,\n
"key": field.generate_field_key(),\n
"default": field.get_value("default"),\n
"editable": field.get_value("editable"),\n
"css_class": field.get_value("css_class"),\n
"hidden": field.get_value("hidden"),\n
"description": field.get_value("description"),\n
"title": field.get_value("title"),\n
"required": field.get_value("required"),\n
# XXX Message can not be converted to json as is\n
"items": field.get_value("items"),\n
}\n
result["sub_select_key"] = traversed_document.Field_getSubFieldKeyDict(field, \'default:list\', key=result["key"])\n
result["sub_input_key"] = "default_" + traversed_document.Field_getSubFieldKeyDict(field, \'default:list:int\', key=result["key"])\n
elif meta_type in ("StringField", "FloatField", "EmailField", "TextAreaField",\n
"LinesField", "ImageField", "FileField", "IntegerField",\n
"PasswordField", "EditorField"):\n
......
......@@ -145,6 +145,8 @@ gadget_erp5_field_list.html\n
gadget_erp5_field_list.js\n
gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n
gadget_erp5_field_multilist.html\n
gadget_erp5_field_multilist.js\n
gadget_erp5_field_readonly.html\n
gadget_erp5_field_readonly.js\n
gadget_erp5_field_string.html\n
......@@ -327,7 +329,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>940.56086.25956.64870</string> </value>
<value> <string>940.57527.43918.57497</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -345,7 +347,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1423560460.16</float>
<float>1423645129.22</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -214,9 +214,10 @@
field_element.appendChild(label_element);\n
}\n
if (renderered_field.type === \'ListField\') {\n
// (renderered_field.type === \'ParallelListField\') ||\n
// (renderered_field.type === \'MultiListField\')) {\n
field_url = \'gadget_erp5_field_list.html\';\n
} else if ((renderered_field.type === \'ParallelListField\') ||\n
(renderered_field.type === \'MultiListField\')) {\n
field_url = \'gadget_erp5_field_multilist.html\';\n
} else if (renderered_field.type === \'CheckBoxField\') {\n
field_url = \'gadget_erp5_field_checkbox.html\';\n
} else if (renderered_field.type === \'StringField\') {\n
......@@ -509,7 +510,7 @@
</tuple>
<state>
<tuple>
<float>1423560248.21</float>
<float>1423565705.92</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