[rhmessaging-commits] rhmessaging commits: r3295 - mgmt/trunk/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Wed Apr 15 16:12:14 EDT 2009


Author: eallen
Date: 2009-04-15 16:12:14 -0400 (Wed, 15 Apr 2009)
New Revision: 3295

Modified:
   mgmt/trunk/cumin/python/cumin/widgets.py
   mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
If a table is auto-updated, add an onclick handler to the checkbox to save its state in the hash.

Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py	2009-04-15 20:09:57 UTC (rev 3294)
+++ mgmt/trunk/cumin/python/cumin/widgets.py	2009-04-15 20:12:14 UTC (rev 3295)
@@ -927,9 +927,10 @@
         id = data[self.name]
         attr = id in self.param.get(session) and "checked=\"checked\"" or ""
         disa = disabled and "disabled=\"disabled\"" or ""
-        t = "<td><input type=\"checkbox\" name=\"%s\" value=\"%i\" %s %s/></td>"
+        click = self.parent.update_enabled and " onclick=\"cumin.clickTableCheckbox(this, '%s')\"" % name or ""
+        t = "<td><input type=\"checkbox\" name=\"%s\" value=\"%i\" %s %s%s/></td>"
 
-        return t % (name, id, attr, disa)
+        return t % (name, id, attr, disa, click)
 
 class CheckboxStringIdColumn(FormInput, SqlTableColumn):
     def __init__(self, app, name):

Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings	2009-04-15 20:09:57 UTC (rev 3294)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings	2009-04-15 20:12:14 UTC (rev 3295)
@@ -486,14 +486,15 @@
         elem = form.elements[i];
 
         if (elem.name == elem_name) {
-            elem.checked = control.checked;
+            if (elem.checked != control.checked)
+                elem.click();   // fires the onclick event
         }
     }
 }
 
 [CheckboxIdColumnHeader.html]
-<th><input id="{id}" type="checkbox"
-    onclick="checkAll('{id}', '{form_id}', '{elem_name}')"/></th>
+<th><input id="{id}" type="checkbox" name="all"
+    onclick="cumin.clickTableCheckbox(this, 'all'); checkAll('{id}', '{form_id}', '{elem_name}')" value="all"/></th>
 
 [TopN.html]
 <div>




More information about the rhmessaging-commits mailing list