Author: max
Date: 2007-08-13 16:19:30 -0700 (Mon, 13 Aug 2007)
New Revision: 6037

Modified:
   openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicator.lzx
Log:
Change 20070813-maxcarlson-j by [EMAIL PROTECTED] on 2007-08-13 14:20:00 PDT
    in /Users/maxcarlson/openlaszlo/wafflecone
    for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone

Summary: replicator performance improvements, safety

New Features:

Bugs Fixed: LPP-4405 'Implement ExplicitReplication'

Technical Reviewer: ptw
QA Reviewer: promanik
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: Only call setVisible() if visibility changed.  Lock layouts before 
replication, and unlock after.  Only call applyData() if it exists.
    
Tests: 
http://localhost:8080/wafflecone/test/explicit-replicators/lazy-replicator.lzx, 
http://localhost:8080/wafflecone/test/explicit-replicators/replicator.lzx and 
http://localhost:8080/wafflecone/test/explicit-replicators/test-replicator.lzx 
pass in SWF and DHTML.



Modified: 
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicator.lzx
===================================================================
--- 
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicator.lzx   
    2007-08-13 21:49:56 UTC (rev 6036)
+++ 
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicator.lzx   
    2007-08-13 23:19:30 UTC (rev 6037)
@@ -231,7 +231,7 @@
         var v;
         if ( this._clonepool.length ) {
             v  = this._clonepool.pop();
-            v.setVisible( true );
+            if (v.visible != true) v.setVisible( true );
         } else {
             v =  this._makeClone();
         }
@@ -248,7 +248,7 @@
     //  @keywords private
     function poolClone (c) {
         if ( c.clonenumber ) this.unbind( c );
-        c.setVisible( false );
+        if (c.visible != false) c.setVisible( false );
         this._clonepool.push( c );
     }
 
@@ -265,15 +265,24 @@
     //          @param n: The node to which it is being set.
 
     function setData (v, n) {
-        v.setData( this.nodes[ n ] );
-        v.applyData(this.nodes[n]);
+        if (v) {
+            for (var l in v.layouts) {
+                v.layouts[l].lock();
+            }
+            v.setData( this.nodes[ n ] );
+            if (v['applyData']) v.applyData(this.nodes[n]);
+            for (var l in v.layouts) {
+                v.layouts[l].unlock();
+            }
+        }
     }
 
     //  @keywords private
     function __adjustVisibleClones () {
         while( this.clones.length ) this.poolClone( this.clones.pop() );
-        if (this.nodes != null) {
-            for( var i = 0;i < this.nodes.length; i++ ){
+        if (this['nodes'] != null) {
+            var l = this.nodes.length;
+            for( var i = 0;i < l; i++ ){
                 var cl = this.getClone( );
                 this.bind( cl, i );
                 this.clones[ i ] = cl;


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to