You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2020/08/31 17:51:14 UTC

[royale-asjs] branch develop updated: uibase: separate load of beads to its own method to avoid overrides of "addedToParent" in subclases and get the beads loaded after "beadsAdded" event is sent since is incoherent

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new cabd0af  uibase: separate load of beads to its own method to avoid overrides of "addedToParent" in subclases and get the beads loaded after "beadsAdded" event is sent since is incoherent
cabd0af is described below

commit cabd0af0fd22e6fd63bcbe50c6c0284644f1be34
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Aug 31 19:50:20 2020 +0200

    uibase: separate load of beads to its own method to avoid overrides of "addedToParent" in subclases and get the beads loaded after "beadsAdded" event is sent since is incoherent
---
 .../src/main/royale/org/apache/royale/core/UIBase.as  | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
index 90e4cc0..fb87c11 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
@@ -1394,11 +1394,26 @@ package org.apache.royale.core
             
             for each (var bead:IBead in beads)
                 addBead(bead);
-                
+            
+            loadBeads();
+            sendEvent(this,"beadsAdded");
+        }
+
+        /**
+         *  load necesary beads. This method can be override in subclasses to
+         *  add other custom beads needed, so all requested beads be loaded before
+         *  signal the "beadsAdded" event.
+         * 
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.10.0
+         */
+        protected function loadBeads():void
+        {
 			loadBeadFromValuesManager(IBeadModel, "iBeadModel", this);
             loadBeadFromValuesManager(IBeadView, "iBeadView", this);
 			loadBeadFromValuesManager(IBeadController, "iBeadController", this);
-            sendEvent(this,"beadsAdded");
         }
 
         private var _measurementBead:IMeasurementBead;