You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2020/03/18 04:22:41 UTC

[royale-asjs] branch develop updated: handle label changes in TabBar. Should fix #758

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

aharui 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 a51ba9e  handle label changes in TabBar.  Should fix #758
a51ba9e is described below

commit a51ba9e6592acb95715685ce91bd504848aa1377
Author: Alex Harui <ah...@apache.org>
AuthorDate: Tue Mar 17 21:22:16 2020 -0700

    handle label changes in TabBar.  Should fix #758
---
 .../components/supportClasses/SparkTextButtonItemRenderer.as     | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SparkTextButtonItemRenderer.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SparkTextButtonItemRenderer.as
index 71d4d3f..bea69d8 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SparkTextButtonItemRenderer.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SparkTextButtonItemRenderer.as
@@ -25,6 +25,7 @@ package spark.components.supportClasses
     import org.apache.royale.core.IChild;
     import org.apache.royale.core.IParent;
     import org.apache.royale.core.IStrand;
+    import org.apache.royale.events.Event;
     import org.apache.royale.events.IEventDispatcher;
     import org.apache.royale.events.MouseEvent;
     import org.apache.royale.html.util.getLabelFromData;
@@ -247,9 +248,17 @@ package spark.components.supportClasses
         public function set data(value:Object):void
         {
             _data = value;
+			if (_data is IEventDispatcher)
+				(_data as IEventDispatcher).addEventListener("labelChanged", labelChangedHandler);
+				
             text = dataToString(value);
         }
 
+		private function labelChangedHandler(event:Event):void
+		{
+            text = dataToString(data);
+		}
+		
         public function get nestLevel():int
         {
             throw new Error("Method not implemented.");