This is an automated email from the ASF dual-hosted git repository. harbs 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 d1593dd Handle dataProvider with existing data before strand is set, and add legacy behavior that TabBar.dataProvider doesn't have to be MX ViewStack (though, selected event is currently different). new 3bf307f Merge pull request #1032 from estanglerbm/tabbarcontroller-legacy d1593dd is described below commit d1593dd0674c2619328e7e8f7bd066116e9a31f5 Author: Edward Stangler <estang...@bradmark.com> AuthorDate: Mon Jan 4 05:39:35 2021 -0600 Handle dataProvider with existing data before strand is set, and add legacy behavior that TabBar.dataProvider doesn't have to be MX ViewStack (though, selected event is currently different). --- .../spark/components/beads/controllers/TabBarController.as | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/beads/controllers/TabBarController.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/beads/controllers/TabBarController.as index 816632a..f605ac2 100644 --- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/beads/controllers/TabBarController.as +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/beads/controllers/TabBarController.as @@ -58,6 +58,7 @@ import org.apache.royale.core.IViewport; _strand = value; var eventDispatcher:IEventDispatcher = (_strand.getBeadByType(IViewport) as IViewport).contentView as IEventDispatcher; eventDispatcher.addEventListener("itemsCreated", handleDataProviderChanged); + handleDataProviderChanged(null); } private function clickHandler(event:org.apache.royale.events.MouseEvent):void @@ -69,6 +70,16 @@ import org.apache.royale.core.IViewport; { (list as ISelectableList).selectedIndex = index; } + else + { + // legacy behavior + var tabbar:ListBase = _strand as ListBase; + if (tabbar) + { + tabbar.selectedIndex = index; + tabbar.dispatchEvent(new Event("selectedIndexChanged")); + } + } }