[Zope3-checkins] CVS: Zope3/src/zope/app/browser/component - interfacewidget.py:1.30

Stuart Bishop zen@shangri-la.dropbear.id.au
Tue, 15 Jul 2003 12:09:21 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/component
In directory cvs.zope.org:/tmp/cvs-serv12287/src/zope/app/browser/component

Modified Files:
	interfacewidget.py 
Log Message:
Fix up Widget subclasses that redefined row() and/or label() to
output error codes and descriptions.


=== Zope3/src/zope/app/browser/component/interfacewidget.py 1.29 => 1.30 ===
--- Zope3/src/zope/app/browser/component/interfacewidget.py:1.29	Fri Jun  6 17:35:16 2003
+++ Zope3/src/zope/app/browser/component/interfacewidget.py	Tue Jul 15 12:08:47 2003
@@ -27,10 +27,11 @@
 from zope.schema.interfaces import ValidationError
 from zope.component.exceptions import ComponentLookupError
 from xml.sax.saxutils import quoteattr
+from zope.app.browser.form.widget import BrowserWidget
 
 from zope.app.i18n import ZopeMessageIDFactory as _
 
-class InterfaceWidget(Widget, BrowserView):
+class InterfaceWidget(BrowserWidget, BrowserView):
     implements(IBrowserWidget)
 
     def haveData(self):
@@ -118,16 +119,6 @@
                         % (self.name, interfaceToName(data))
                         )
 
-    def label(self):
-        return '<label for="%s">%s</label>' % (
-            self.name,
-            self.title,
-            )
-
-    def row(self):
-        return '<div class="label">%s</div><div class="field">%s</div>' % (
-                self.label(), self())
-
     # --- deprecated methods of IBrowserWidget
 
     def renderHidden(self, value):
@@ -141,7 +132,7 @@
 
 # A MultiInterfaceWidget is for use with an InterfacesField,
 # which is a tuple of interfaces.
-class MultiInterfaceWidget(Widget, BrowserView):
+class MultiInterfaceWidget(BrowserWidget, BrowserView):
 
     implements(IBrowserWidget)
 
@@ -307,12 +298,14 @@
     def label(self):
         return '<label for="%s">%s</label>' % (
             self.name,
-            self.title,
+            self._tooltip(self.title, self.context.description),
             )
-
+    '''
     def row(self):
-        return '<div class="label">%s</div><div class="field">%s</div>' % (
-                self.label(), self())
+        return '<div class="label">%s</div><div class="field">%s</div>%s' % (
+                self.label(), self(), self._errorSnippet()
+                )
+    '''
 
     # --- deprecated methods of IBrowserWidget