Skip to content
Browse files

Include UID of object in widget DOM ids, eg:

id="parent-fieldname-$fieldName-$UID". This makes it possible to render
multiple Archetype objects in the same view without duplicate DOM ids.
This fixes http://dev.plone.org/ticket/9464
  • Loading branch information...
1 parent 695842f commit f6dbf3097ceabef628b974613e4df4c54b1d53f3 @rochecompaan rochecompaan committed
View
6 CHANGES.txt
@@ -15,6 +15,12 @@ Changelog
- Add new viewletmanger that enable extra markup before the fieldsets
[jfroche]
+- Include UID of object in widget DOM ids, eg:
+ id="parent-fieldname-$fieldName-$UID". This makes it possible to
+ render multiple Archetype objects in the same view without duplicate
+ DOM ids. This fixes http://dev.plone.org/ticket/9464
+ [rochecompaan]
+
1.7.9 (2011-09-19)
------------------
View
3 Products/Archetypes/Renderer.py
@@ -51,7 +51,8 @@ def setupContext(self, field_name, mode, widget, instance, field, \
context.setLocal('widget', widget)
context.setLocal('field', field)
context.setLocal('mode', mode)
-
+ context.setLocal('UID',instance.UID())
+
if kwargs:
for k,v in kwargs.items():
context.setLocal(k, v)
View
2 Products/Archetypes/skins/archetypes/widgets/boolean.pt
@@ -16,7 +16,7 @@
tal:define="kss_class python:getKssClasses(fieldName,
templateId='widgets/boolean', macro='boolean-field-view');"
tal:attributes="class kss_class;
- id string:parent-fieldname-$fieldName">
+ id string:parent-fieldname-$fieldName-$UID">
<span metal:define-slot="inside"
tal:define="voc field/Vocabulary; key accessor;
value python:voc and voc.getValue(str(key)) or key"
View
2 Products/Archetypes/skins/archetypes/widgets/calendar.pt
@@ -23,7 +23,7 @@
tlt nocall:context/toLocalizedTime|nothing;
result python:(format and formatted) or (d and tlt and tlt(d, long_format=1)) or None;"
tal:attributes="class kss_class;
- id string:parent-fieldname-$fieldName">
+ id string:parent-fieldname-$fieldName-$UID">
<span metal:define-slot="inside"
tal:replace="structure result">calendar</span>
</div>
View
2 Products/Archetypes/skins/archetypes/widgets/field.pt
@@ -56,7 +56,7 @@
<div metal:define-macro="view" tal:define="fieldName fieldName|field/getName;
fieldtypename python:field.getType().split('.')[-1];"
tal:attributes="class string:field ArchetypesField-${fieldtypename};
- id string:archetypes-fieldname-${fieldName}">
+ id string:archetypes-fieldname-${fieldName}-${UID}">
<metal:use_base_view use-macro="context/widgets/field/macros/base_view" />
</div>
View
2 Products/Archetypes/skins/archetypes/widgets/integer.pt
@@ -14,7 +14,7 @@
tal:define="kss_class python:getKssClasses(fieldName,
templateId='widgets/integer', macro='integer-field-view');"
tal:attributes="class kss_class;
- id string:parent-fieldname-$fieldName">
+ id string:parent-fieldname-$fieldName-$UID">
<span metal:define-slot="inside"
tal:replace="accessor">string</span>
</div>
View
2 Products/Archetypes/skins/archetypes/widgets/keyword.pt
@@ -15,7 +15,7 @@
tal:define="kss_class python:getKssClasses(fieldName,
templateId='widgets/keyword', macro='keyword-field-view');"
tal:attributes="class kss_class;
- id string:parent-fieldname-$fieldName">
+ id string:parent-fieldname-$fieldName-$UID">
<ul metal:define-slot="inside">
<li tal:repeat="item accessor"
tal:content="item"/>
View
2 Products/Archetypes/skins/archetypes/widgets/rich.pt
@@ -15,7 +15,7 @@
tal:define="kss_class python:getKssClasses(fieldName,
templateId='widgets/rich', macro='rich-field-view');"
tal:attributes="class kss_class;
- id string:parent-fieldname-$fieldName">
+ id string:parent-fieldname-$fieldName-$UID">
<span metal:define-slot="inside"
tal:define="transformable python: context.isTransformable(fieldName);"
tal:condition="transformable"
View
2 Products/Archetypes/skins/archetypes/widgets/selection.pt
@@ -19,7 +19,7 @@
tal:define="kss_class python:getKssClasses(fieldName,
templateId='widgets/selection', macro='selection-field-view');"
tal:attributes="class kss_class;
- id string:parent-fieldname-$fieldName">
+ id string:parent-fieldname-$fieldName-$UID">
<span metal:define-slot="inside"
tal:define="vocab python:field.Vocabulary(context);
value python:accessor();
View
2 Products/Archetypes/skins/archetypes/widgets/string.pt
@@ -14,7 +14,7 @@
tal:define="kss_class python:getKssClasses(fieldName,
templateId='widgets/string', macro='string-field-view');"
tal:attributes="class kss_class;
- id string:parent-fieldname-$fieldName">
+ id string:parent-fieldname-$fieldName-$UID">
<span metal:define-slot="inside"
tal:replace="accessor">string</span>
</span>
View
2 Products/Archetypes/skins/archetypes/widgets/textarea.pt
@@ -17,7 +17,7 @@
tal:define="kss_class python:getKssClasses(fieldName,
templateId='widgets/textarea', macro='textarea-field-view');"
tal:attributes="class kss_class;
- id string:parent-fieldname-$fieldName">
+ id string:parent-fieldname-$fieldName-$UID">
<span metal:define-slot="inside"
tal:replace="accessor">textarea</span>
</span>

0 comments on commit f6dbf30

Please sign in to comment.
Something went wrong with that request. Please try again.