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/06/10 06:11:46 UTC
[royale-asjs] branch develop updated: fix programmatic selection in
ADG.
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 2b04ee2 fix programmatic selection in ADG.
2b04ee2 is described below
commit 2b04ee20ccfb2f1e1992ccae7510c4dc257ce819
Author: Alex Harui <ah...@apache.org>
AuthorDate: Tue Jun 9 23:11:18 2020 -0700
fix programmatic selection in ADG.
---
.../main/royale/mx/controls/listClasses/AdvancedListBase.as | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/AdvancedListBase.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/AdvancedListBase.as
index 6bfef11..d4be093 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/AdvancedListBase.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/AdvancedListBase.as
@@ -2614,7 +2614,10 @@ public class AdvancedListBase extends ListBase /* extends UIComponent
if (collection)
value = Math.min(collection.length - 1, value);
clearSelected();
- super.selectedIndex = value;
+ if (allowMultipleSelection)
+ commitSelectedIndices([value]);
+ else
+ super.selectedIndex = value;
}
//----------------------------------
@@ -5545,6 +5548,7 @@ public class AdvancedListBase extends ListBase /* extends UIComponent
*/
private function setSelectionIndicesLoop(index:int, indices:Array, firstTime:Boolean = false):void
{
+
while (indices.length)
{
if (index != indices[0])
@@ -5565,6 +5569,8 @@ public class AdvancedListBase extends ListBase /* extends UIComponent
indices.shift();
var data:Object = collectionIterator.current;
+ addSelectionData(itemToUID(data), new ListBaseSelectionData(data, index, false));
+ // trace("uid = " + itemToUID(data));
if (firstTime)
{
(model as ISelectionModel).selectedIndex = index; //_selectedIndex = index;
@@ -5575,8 +5581,6 @@ public class AdvancedListBase extends ListBase /* extends UIComponent
anchorBookmark = collectionIterator.bookmark;
firstTime = false;
}
- addSelectionData(itemToUID(data), new ListBaseSelectionData(data, index, false));
- // trace("uid = " + itemToUID(data));
}
if (initialized)