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

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Thu Mar 26 13:32:44 EDT 2009


Author: justi9
Date: 2009-03-26 13:32:44 -0400 (Thu, 26 Mar 2009)
New Revision: 3216

Modified:
   mgmt/trunk/cumin/python/cumin/stat.py
   mgmt/trunk/cumin/python/cumin/stat.strings
Log:
Use widget update feature in stat tables.

Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py	2009-03-26 14:32:55 UTC (rev 3215)
+++ mgmt/trunk/cumin/python/cumin/stat.py	2009-03-26 17:32:44 UTC (rev 3216)
@@ -23,6 +23,8 @@
 
         self.category = category
 
+        self.update_enabled = True
+
         self.object = Attribute(app, "object");
         self.add_attribute(self.object);
 

Modified: mgmt/trunk/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.strings	2009-03-26 14:32:55 UTC (rev 3215)
+++ mgmt/trunk/cumin/python/cumin/stat.strings	2009-03-26 17:32:44 UTC (rev 3216)
@@ -1,46 +1,3 @@
-[StatSet.javascript]
-function updateStats(id, object) {
-    var table = wooly.doc().elembyid(id)
-    var trs = table.elem("tbody").elems("tr");
-    var tr = trs.next();
-
-    while (tr) {
-        var attr = tr.getattr("stat");
-
-        if (attr) {
-            var stat = object.stat[attr];
-            var tds = tr.elems("td", null, null, 0, 2);
-
-            var td = tds.next();
-
-            if (stat.value) {
-                td.text().set(stat.value);
-            }
-
-            td = tds.next();
-
-            var phs = td.elems("span", null, null, 0, 2);
-            var ph = phs.next();
-
-            if (false && ph) { // XXX disabled
-                if (stat.high) {
-                    ph.set(stat.high);
-                }
-
-                ph = phs.next();
-
-                if (stat.low) {
-                    ph.set(stat.low);
-                }
-            } else if (stat.rate) {
-                td.text().set(stat.rate);
-            }
-        }
-
-        tr = trs.next();
-    }
-}
-
 [StatSet.css]
 table.StatSet {
     width: 100%;
@@ -88,12 +45,9 @@
     {items}
   </tbody>
 </table>
-<script type="text/javascript">
-  cumin.objectListeners["{id}"] = updateStats;
-</script>
 
 [StatSet.item_html]
-<tr stat="{item_name}" class="item">
+<tr class="item">
   <th>{item_title}</th>
   <td class="ralign"> {item_value}</td>
   <td class="ralign"> {item_rate}</td>




More information about the rhmessaging-commits mailing list