Commit 7f23b152 authored by Ivan Tyagov's avatar Ivan Tyagov

Gadget listboxes will have an unique field_prefix which will guaranteed that...

Gadget listboxes will have an unique field_prefix which will guaranteed that multiple gadgets and multiple asynchronous gadgets can safely co exists in same DOM space within same HTML form without collisions.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43459 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9b857f22
...@@ -79,7 +79,8 @@ ...@@ -79,7 +79,8 @@
show_list_action_link python: here.field.get_value(\'list_action\');\n show_list_action_link python: here.field.get_value(\'list_action\');\n
page_navigation_template python: request.get(\'page_navigation_template\', here.getPageNavigationTemplate());\n page_navigation_template python: request.get(\'page_navigation_template\', here.getPageNavigationTemplate());\n
is_slider_mode python: \'Slider\' in page_navigation_template;\n is_slider_mode python: \'Slider\' in page_navigation_template;\n
is_default_listbox_field python: field_id==\'listbox\';">\n is_default_listbox_field python: field_id==\'listbox\';\n
field_prefix python: \'\';">\n
\n \n
<!-- Define hidden input. -->\n <!-- Define hidden input. -->\n
<input type="hidden" \n <input type="hidden" \n
...@@ -111,7 +112,8 @@ ...@@ -111,7 +112,8 @@
<tal:block tal:define="global box_relative_url python: request.get(\'box_relative_url\', \'\');\n <tal:block tal:define="global box_relative_url python: request.get(\'box_relative_url\', \'\');\n
global box python: real_context.restrictedTraverse(box_relative_url); \n global box python: real_context.restrictedTraverse(box_relative_url); \n
global box_id python: \'%s_content\' %box_relative_url.replace(\'/\', \'_\');\n global box_id python: \'%s_content\' %box_relative_url.replace(\'/\', \'_\');\n
global dom_id python: request.get(\'dom_id\',None) or box_id;">\n global dom_id python: request.get(\'dom_id\',None) or box_id;\n
global field_prefix string:${box_id}_">\n
<input tal:condition="python:form_id" \n <input tal:condition="python:form_id" \n
type="hidden" \n type="hidden" \n
name="gadget_form_id"\n name="gadget_form_id"\n
...@@ -470,7 +472,7 @@ ...@@ -470,7 +472,7 @@
<input tal:condition="not: repeat/value/index"\n <input tal:condition="not: repeat/value/index"\n
type="hidden" value="1" name="listbox_uid:list"\n type="hidden" value="1" name="listbox_uid:list"\n
tal:attributes="value python: line.getUid() or \'\';\n tal:attributes="value python: line.getUid() or \'\';\n
name string:${field_id}_uid:list" />\n name string:${field_prefix}${field_id}_uid:list" />\n
<tal:block tal:replace="structure html"/>\n <tal:block tal:replace="structure html"/>\n
</td>\n </td>\n
</tal:block>\n </tal:block>\n
...@@ -533,9 +535,7 @@ ...@@ -533,9 +535,7 @@
</div>\n </div>\n
</div>\n </div>\n
\n \n
</tal:block>\n </tal:block>
\n
]]></unicode> </value> ]]></unicode> </value>
</item> </item>
...@@ -553,7 +553,7 @@ ...@@ -553,7 +553,7 @@
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value> <value> <string>iso-8859-15</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
class = "listbox_first_page"\n class = "listbox_first_page"\n
tal:attributes="value string:|&lt;;\n tal:attributes="value string:|&lt;;\n
onclick python:\n onclick python:\n
real_context.KnowledgePad_generateAjaxCall(context_url,box,dom_id,params);\n real_context.KnowledgePad_generateAjaxCall(context_url,box,dom_id,params, field_prefix=field_prefix);\n
class python: test(is_default_listbox_field, \'listbox_first_page\', \'listbox_first_page %s_first_page\' %field_id)"\n class python: test(is_default_listbox_field, \'listbox_first_page\', \'listbox_first_page %s_first_page\' %field_id)"\n
i18n:domain="ui" i18n:attributes="title">\n i18n:domain="ui" i18n:attributes="title">\n
<span class="image"/>\n <span class="image"/>\n
...@@ -261,7 +261,7 @@ ...@@ -261,7 +261,7 @@
type="button"\n type="button"\n
class="listbox_previous_page"\n class="listbox_previous_page"\n
tal:attributes="value string:&lt;&lt;;\n tal:attributes="value string:&lt;&lt;;\n
onclick python: real_context.KnowledgePad_generateAjaxCall(context_url,box,dom_id,params);\n onclick python: real_context.KnowledgePad_generateAjaxCall(context_url,box,dom_id,params,field_prefix=field_prefix);\n
class python: test(is_default_listbox_field, \'listbox_previous_page\', \'listbox_previous_page %s_previous_page\' %field_id)"\n class python: test(is_default_listbox_field, \'listbox_previous_page\', \'listbox_previous_page %s_previous_page\' %field_id)"\n
i18n:domain="ui" i18n:attributes="title">\n i18n:domain="ui" i18n:attributes="title">\n
<span class="image"/>\n <span class="image"/>\n
...@@ -279,7 +279,7 @@ ...@@ -279,7 +279,7 @@
name="nextPage"\n name="nextPage"\n
type="button"\n type="button"\n
class="listbox_next_page"\n class="listbox_next_page"\n
tal:attributes="onclick python: real_context.KnowledgePad_generateAjaxCall(context_url,box,dom_id,params);\n tal:attributes="onclick python: real_context.KnowledgePad_generateAjaxCall(context_url,box,dom_id,params,field_prefix=field_prefix);\n
class python: test(is_default_listbox_field, \'listbox_next_page\', \'listbox_next_page %s_next_page\' %field_id)"\n class python: test(is_default_listbox_field, \'listbox_next_page\', \'listbox_next_page %s_next_page\' %field_id)"\n
i18n:domain="ui" i18n:attributes="title">\n i18n:domain="ui" i18n:attributes="title">\n
<span class="image"/>\n <span class="image"/>\n
...@@ -289,7 +289,7 @@ ...@@ -289,7 +289,7 @@
name="lastPage"\n name="lastPage"\n
type="button"\n type="button"\n
class="listbox_last_page"\n class="listbox_last_page"\n
tal:attributes="onclick python: real_context.KnowledgePad_generateAjaxCall(context_url,box,dom_id,params);\n tal:attributes="onclick python: real_context.KnowledgePad_generateAjaxCall(context_url,box,dom_id,params,field_prefix=field_prefix);\n
class python: test(is_default_listbox_field, \'listbox_last_page\', \'listbox_last_page %s_last_page\' %field_id)"\n class python: test(is_default_listbox_field, \'listbox_last_page\', \'listbox_last_page %s_last_page\' %field_id)"\n
i18n:domain="ui" i18n:attributes="title">\n i18n:domain="ui" i18n:attributes="title">\n
<span class="image"/>\n <span class="image"/>\n
...@@ -320,7 +320,7 @@ ...@@ -320,7 +320,7 @@
class python: test(is_default_listbox_field, "listbox_set_page", "listbox_set_page %s_set_page" %field_id);\n class python: test(is_default_listbox_field, "listbox_set_page", "listbox_set_page %s_set_page" %field_id);\n
value python:here.current_page + 1;\n value python:here.current_page + 1;\n
size python:len(str(here.total_pages));\n size python:len(str(here.total_pages));\n
onkeypress python:"if(event.keyCode==13){" + real_context.KnowledgePad_generateAjaxCall(context_url,box,dom_id,params).replace("\\"this.value\\"","this.value")+ "return false;;}"\'/>\n onkeypress python:"if(event.keyCode==13){" + real_context.KnowledgePad_generateAjaxCall(context_url,box,dom_id,params,field_prefix=field_prefix).replace("\\"this.value\\"","this.value")+ "return false;;}"\'/>\n
/ <tal:block content="here/total_pages" />\n / <tal:block content="here/total_pages" />\n
</tal:block>\n </tal:block>\n
\n \n
...@@ -338,7 +338,7 @@ ...@@ -338,7 +338,7 @@
<tal:block metal:define-macro="text_link_page_navigation_asynchronous">\n <tal:block metal:define-macro="text_link_page_navigation_asynchronous">\n
<tal:block tal:repeat="page_index page_index_list ">\n <tal:block tal:repeat="page_index page_index_list ">\n
<a tal:define="params python: {field_id+\'_setPage:method\':\'\',field_id+\'_page_start\':page_index,\'list_style\':list_style, \'list_selection_name\':selection_name, \'listbox_uid\':[]}"\n <a tal:define="params python: {field_id+\'_setPage:method\':\'\',field_id+\'_page_start\':page_index,\'list_style\':list_style, \'list_selection_name\':selection_name, \'listbox_uid\':[]}"\n
tal:attributes="onclick python: real_context.KnowledgePad_generateAjaxCall(context_url,box,dom_id,params);\n tal:attributes="onclick python: real_context.KnowledgePad_generateAjaxCall(context_url,box,dom_id,params,field_prefix=field_prefix);\n
class python: test(page_index==current_page, \'selected\', \'\');\n class python: test(page_index==current_page, \'selected\', \'\');\n
title string:Page ${page_index}"\n title string:Page ${page_index}"\n
tal:content="page_index"/>\n tal:content="page_index"/>\n
......
1063 1064
\ No newline at end of file \ No newline at end of file
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