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/07/16 10:27:31 UTC

[royale-asjs] branch develop updated: ArrayListView: Dispatch lengthChanged binding event if necessary after a refresh

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 1a3f743  ArrayListView: Dispatch lengthChanged binding event if necessary after a refresh
     new f953791  Merge pull request #887 from brianraymes/develop
1a3f743 is described below

commit 1a3f743c8f5614d7223770ef355c3878f49d7b81
Author: Brian Raymes <br...@teotech.com>
AuthorDate: Tue Jul 14 14:01:33 2020 -0700

    ArrayListView: Dispatch lengthChanged binding event if necessary after a refresh
---
 .../src/main/royale/org/apache/royale/collections/ArrayListView.as | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/Collections/src/main/royale/org/apache/royale/collections/ArrayListView.as b/frameworks/projects/Collections/src/main/royale/org/apache/royale/collections/ArrayListView.as
index 1d52cbb..d581407 100644
--- a/frameworks/projects/Collections/src/main/royale/org/apache/royale/collections/ArrayListView.as
+++ b/frameworks/projects/Collections/src/main/royale/org/apache/royale/collections/ArrayListView.as
@@ -522,8 +522,13 @@ public class ArrayListView extends EventDispatcher implements IArrayListView, IA
      *  @productversion Royale 0.0
      */
     public function refresh():Boolean {
+        var lengthChanged:Boolean = internalRefresh(true);
 
-        return internalRefresh(true);
+        if (lengthChanged) {
+            dispatchEvent(new Event('lengthChanged'));
+        }
+
+        return lengthChanged;
     }
 
     //--------------------------------------------------------------------------