Author: jmorliaguet
Date: Fri Feb 17 17:19:03 2006
New Revision: 2402

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
Log:

- added a distinction between render(data) and display(data)

  - render(data) triggers no event

  - display(data) triggers a "diplayed" event

  this is needed to attach DOM events after the widget has been rendered.



Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Fri Feb 17 
17:19:03 2006
@@ -865,7 +865,7 @@
     // observers subscribes to events on the model
     CPSSkins.registerEventHandler('modified', view, function(event) {
       var data = event.publisher.def.data;
-      event.subscriber.render(data);
+      event.subscriber.display(data);
     });
     CPSSkins.subscribe('modified', {'subscriber': view, 'publisher': model});
     // create a back-reference
@@ -1224,18 +1224,20 @@
     }
   },
 
-  update: function() {
-    var data = this.getData();
-    if (data) this.render(data);
+  display: function(data) {
+    this.render(data);
+    CPSSkins.notify("displayed", {'publisher': this});
   },
 
   show: function() {
     if (this.visible) return;
 
-    CPSSkins.notify("gained focus", {'publisher': this, 'context': 
this.selected});
+    CPSSkins.notify("gained focus", {'publisher': this,
+                                     'context': this.selected});
 
-    // get new data
-    this.update();
+    // get new data and display the view
+    var data = this.getData();
+    if (data) this.display(data);
 
     // prepare the view
     this.prepare();
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to