From 78efc0a870d07a0dede91e5e0863d7a9f4225412 Mon Sep 17 00:00:00 2001 From: Ivan Tyagov <ivan@nexedi.com> Date: Wed, 25 Aug 2010 06:40:41 +0000 Subject: [PATCH] Do not use HTML tag id attributes as in gadget mode multiple gadgets having listboxes can produce same conflicting ids. Use class attribute. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37999 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../page_navigation_render.xml | 63 ++++++++----------- .../bootstrap/erp5_xhtml_style/bt/revision | 2 +- 2 files changed, 28 insertions(+), 37 deletions(-) diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/page_navigation_render.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/page_navigation_render.xml index 4904653e4a..2f1f54311f 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/page_navigation_render.xml +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/page_navigation_render.xml @@ -46,21 +46,18 @@ <tal:block metal:define-macro="first_previous_page_navigation">\n \n <tal:block tal:condition="python: here.current_page > 0">\n - <button id="listbox_first_page" \n - type="image" src="2leftarrowv.png"\n + <button type="image" src="2leftarrowv.png"\n title="First Page" name="firstPage:method"\n class="listbox_first_page"\n - tal:attributes="id string:${field_id}_first_page;\n - name string:${field_id}_firstPage:method;\n + tal:attributes="name string:${field_id}_firstPage:method;\n src string:${portal_url_string}/images/2leftarrowv.png"\n i18n:domain="ui" i18n:attributes="title">\n <span class="image"/>\n </button>\n - <button id="listbox_previous_page" type="image" src="1leftarrowv.png"\n + <button type="image" src="1leftarrowv.png"\n title="Previous Page" name="previousPage:method"\n class="listbox_previous_page"\n - tal:attributes="id string:${field_id}_previous_page;\n - name string:${field_id}_previousPage:method;\n + tal:attributes="name string:${field_id}_previousPage:method;\n src string:${portal_url_string}/images/1leftarrowv.png"\n i18n:domain="ui" i18n:attributes="title">\n <span class="image"/>\n @@ -74,18 +71,16 @@ <tal:block metal:define-macro="next_last_page_navigation">\n \n <tal:block tal:condition="python: here.current_page < here.total_pages - 1">\n - <button id="listbox_next_page" type="image" src="1rightarrowv.png"\n + <button type="image" src="1rightarrowv.png"\n title="Next Page" name="nextPage:method" class="listbox_next_page"\n - tal:attributes="id string:${field_id}_next_page;\n - name string:${field_id}_nextPage:method;\n + tal:attributes="name string:${field_id}_nextPage:method;\n src string:${portal_url_string}/images/1rightarrowv.png"\n i18n:domain="ui" i18n:attributes="title">\n <span class="image"/>\n </button>\n - <button id="listbox_last_page" type="image" src="2rightarrowv.png"\n + <button type="image" src="2rightarrowv.png"\n title="Last Page" name="lastPage:method" class="listbox_last_page"\n - tal:attributes="id string:${field_id}_last_page;\n - name string:${field_id}_lastPage:method;\n + tal:attributes="name string:${field_id}_lastPage:method;\n src string:${portal_url_string}/images/2rightarrowv.png"\n i18n:domain="ui" i18n:attributes="title" >\n <span class="image"/>\n @@ -97,30 +92,28 @@ \n <!-- First & Previous button navigation (asynchronous mode) --> \n <tal:block metal:define-macro="first_previous_page_navigation_asynchronous">\n +\n \n <tal:block tal:condition="python: here.current_page > 0">\n - <button tal:define ="params python: {field_id+\'_firstPage:method\':\'\', \'list_style\':list_style}"\n + <button tal:define ="params python: {field_id+\'_firstPage:method\':\'\', \'list_style\':list_style}"\n title="First Page" \n name="firstPage"\n type = "button" \n class = "listbox_first_page"\n - tal:attributes="id string:${field_id}_first_page;\n - value string:|<;\n + tal:attributes="value string:|<;\n onclick python:\n real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params)"\n - i18n:domain="ui" i18n:attributes="title">\n + i18n:domain="ui" i18n:attributes="title">\n <span class="image"/>\n </button>\n <button tal:define ="params python: {field_id+\'_previousPage:method\':\'\',\'page_start\':here.current_page+1,\'list_style\':list_style}"\n - title="Previous Page"\n - name="previousPage"\n - type="button"\n - class="listbox_previous_page"\n - tal:attributes="id string:${field_id}_previous_page;\n - value string:<<;\n - onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params)"\n - i18n:domain="ui" i18n:attributes="title">\n - \n + title="Previous Page"\n + name="previousPage"\n + type="button"\n + class="listbox_previous_page"\n + tal:attributes="value string:<<;\n + onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params)"\n + i18n:domain="ui" i18n:attributes="title">\n <span class="image"/>\n </button>\n </tal:block>\n @@ -135,8 +128,7 @@ name="nextPage"\n type="button"\n class="listbox_next_page"\n - tal:attributes="id string:${field_id}_next_page;\n - onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params)"\n + tal:attributes="onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params)"\n i18n:domain="ui" i18n:attributes="title">\n <span class="image"/>\n </button>\n @@ -145,8 +137,7 @@ name="lastPage"\n type="button"\n class="listbox_last_page"\n - tal:attributes="id string:${field_id}_last_page;\n - onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params)"\n + tal:attributes="onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params)"\n i18n:domain="ui" i18n:attributes="title">\n <span class="image"/>\n </button>\n @@ -156,9 +147,9 @@ \n <!-- Type in listbox navigation --> \n <tal:block metal:define-macro="type_in_page_navigation">\n - <input id="listbox_set_page" name="page_start" onblur="this.value=this.defaultValue"\n - tal:attributes="id string:${field_id}_set_page;\n - name string:${field_id}_page_start;\n + <input class="listbox_set_page" \n + name="page_start" onblur="this.value=this.defaultValue"\n + tal:attributes="name string:${field_id}_page_start;\n value python:here.current_page + 1;\n size python:len(str(here.total_pages));\n onkeypress string:submitFormOnEnter(event, this.form, \'${field_id}_setPage\')" />\n @@ -168,10 +159,10 @@ <!-- Type in listbox page number navigation (asyncronous) --> \n <tal:block metal:define-macro="type_in_page_navigation_asynchronous">\n \n - <input id="listbox_set_page" name="page_start" onblur="this.value=this.defaultValue"\n + <input class="listbox_set_page" \n + name="page_start" onblur="this.value=this.defaultValue"\n tal:define="params python: {field_id+\'_setPage:method\':\'\',field_id+\'_page_start\':\'this.value\',\'list_style\':list_style}"\n - tal:attributes=\'id string:${field_id}_set_page;\n - name string:${field_id}_page_start;\n + tal:attributes=\'name string:${field_id}_page_start;\n value python:here.current_page + 1;\n size python:len(str(here.total_pages));\n onkeypress python:"if(event.keyCode==13){" + real_context.KnowledgePad_generateAjaxCall(context_url+"/"+form_id,box,dom_id,params).replace("\\"this.value\\"","this.value")+ "return false;;}"\'/>\n diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision index 14e963ae25..dca5ef64f9 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision +++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision @@ -1 +1 @@ -975 \ No newline at end of file +976 \ No newline at end of file -- GitLab