[rhmessaging-commits] rhmessaging commits: r3928 - mgmt/newdata/wooly/python/wooly.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Apr 26 08:27:53 EDT 2010


Author: eallen
Date: 2010-04-26 08:27:52 -0400 (Mon, 26 Apr 2010)
New Revision: 3928

Modified:
   mgmt/newdata/wooly/python/wooly/forms.py
Log:
Don't show the "Show more options" button on forms if there are no fields added to the extra_fields child. 

Modified: mgmt/newdata/wooly/python/wooly/forms.py
===================================================================
--- mgmt/newdata/wooly/python/wooly/forms.py	2010-04-23 21:01:54 UTC (rev 3927)
+++ mgmt/newdata/wooly/python/wooly/forms.py	2010-04-26 12:27:52 UTC (rev 3928)
@@ -273,9 +273,9 @@
             return "disabled=\"disabled\""
 
 class FormInputItem(object):
-    def __init__(self, value):
+    def __init__(self, value, title=None):
         self.value = value
-        self.title = None
+        self.title = title
         self.description = None
         self.disabled = False
 
@@ -389,6 +389,10 @@
     def __init__(self, app, name):
         super(ShowableFieldSet, self).__init__(app, name)
 
+    def render(self, session):
+        return len(self.fields) and \
+            super(ShowableFieldSet, self).render(session) or ""
+
 class ScalarField(FormField):
     def __init__(self, app, name, input):
         super(ScalarField, self).__init__(app, name)
@@ -527,7 +531,7 @@
 
     def do_get_items(self, session):
         raise Exception("Not implemented")
-        
+
     class Inputs(CheckboxItemSet):
         def do_get_items(self, session):
             return self.parent.do_get_items(session)



More information about the rhmessaging-commits mailing list