[Zope3-checkins] SVN: Zope3/branches/Zope-3.1/src/zope/app/form/browser/ Apply revision 37976 from trunk (add missing id attribute to select widget).

Gary Poster gary at zope.com
Tue Aug 16 21:02:10 EDT 2005


Log message for revision 37977:
  Apply revision 37976 from trunk (add missing id attribute to select widget).
  

Changed:
  U   Zope3/branches/Zope-3.1/src/zope/app/form/browser/ftests/test_intwidget.py
  U   Zope3/branches/Zope-3.1/src/zope/app/form/browser/itemswidgets.py
  U   Zope3/branches/Zope-3.1/src/zope/app/form/browser/tests/test_itemswidget.py
  U   Zope3/branches/Zope-3.1/src/zope/app/form/browser/tests/test_selectwidget.py

-=-
Modified: Zope3/branches/Zope-3.1/src/zope/app/form/browser/ftests/test_intwidget.py
===================================================================
--- Zope3/branches/Zope-3.1/src/zope/app/form/browser/ftests/test_intwidget.py	2005-08-17 00:38:32 UTC (rev 37976)
+++ Zope3/branches/Zope-3.1/src/zope/app/form/browser/ftests/test_intwidget.py	2005-08-17 01:02:10 UTC (rev 37977)
@@ -162,7 +162,7 @@
 
         # confirm that i1 is has a blank item at top with value=""
         self.assert_(patternExists(
-            '<select name="field.i1" .*>', response.getBody()))
+            '<select id="field.i1" name="field.i1" .*>', response.getBody()))
         self.assert_(patternExists(
             '<option value="">.*</option>', response.getBody()))
         self.assert_(patternExists(

Modified: Zope3/branches/Zope-3.1/src/zope/app/form/browser/itemswidgets.py
===================================================================
--- Zope3/branches/Zope-3.1/src/zope/app/form/browser/itemswidgets.py	2005-08-17 00:38:32 UTC (rev 37976)
+++ Zope3/branches/Zope-3.1/src/zope/app/form/browser/itemswidgets.py	2005-08-17 01:02:10 UTC (rev 37977)
@@ -400,6 +400,7 @@
         contents = "\n%s\n" %"\n".join(rendered_items)
         return renderElement('select',
                              name=self.name,
+                             id=self.name,
                              contents=contents,
                              size=self.size,
                              extra=self.extra)

Modified: Zope3/branches/Zope-3.1/src/zope/app/form/browser/tests/test_itemswidget.py
===================================================================
--- Zope3/branches/Zope-3.1/src/zope/app/form/browser/tests/test_itemswidget.py	2005-08-17 00:38:32 UTC (rev 37976)
+++ Zope3/branches/Zope-3.1/src/zope/app/form/browser/tests/test_itemswidget.py	2005-08-17 01:02:10 UTC (rev 37977)
@@ -246,7 +246,7 @@
             widget(),
             '<div>\n'
             '<div class="value">\n'
-            '<select name="field.choice" size="%i" >\n'
+            '<select id="field.choice" name="field.choice" size="%i" >\n'
             '<option value="">(no value)</option>\n'
             '<option selected="selected" value="token1">One</option>\n'
             '<option value="token2">Two</option>\n'
@@ -260,7 +260,7 @@
         widget.setPrefix('field.')
         self.assertEqual(
             widget.renderValue('one'),
-            '<select name="field.choice" size="%i" >\n'
+            '<select id="field.choice" name="field.choice" size="%i" >\n'
             '<option selected="selected" value="token1">One</option>\n'
             '<option value="token2">Two</option>\n'
             '<option value="token3">Three</option>\n'

Modified: Zope3/branches/Zope-3.1/src/zope/app/form/browser/tests/test_selectwidget.py
===================================================================
--- Zope3/branches/Zope-3.1/src/zope/app/form/browser/tests/test_selectwidget.py	2005-08-17 00:38:32 UTC (rev 37976)
+++ Zope3/branches/Zope-3.1/src/zope/app/form/browser/tests/test_selectwidget.py	2005-08-17 01:02:10 UTC (rev 37977)
@@ -41,7 +41,7 @@
 
 select_html = '''<div>
 <div class="value">
-<select name="field.terms" size="5" >
+<select id="field.terms" name="field.terms" size="5" >
 <option value="&lt; foo">&lt; foo</option>
 <option value="bar/&gt;">bar/&gt;</option>
 <option value="&amp;blah&amp;">&amp;blah&amp;</option>



More information about the Zope3-Checkins mailing list