Repository: flex-asjs Updated Branches: refs/heads/develop 51cdd613d -> 3b82a00d1
FLEX-35256 - Refix: Use itemsCreatedHandler for complete setup of TabBarView and TabsView - It avoid problems in case of bracket Binding and constant binding Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/3b82a00d Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/3b82a00d Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/3b82a00d Branch: refs/heads/develop Commit: 3b82a00d1f745f392d31e092728f26c2d13b854e Parents: 51cdd61 Author: piotrz <pio...@apache.org> Authored: Sun Feb 12 22:41:21 2017 +0100 Committer: piotrz <pio...@apache.org> Committed: Sun Feb 12 22:41:21 2017 +0100 ---------------------------------------------------------------------- .../apache/flex/mdl/beads/views/TabBarView.as | 28 ++---------------- .../org/apache/flex/mdl/beads/views/TabsView.as | 31 ++------------------ 2 files changed, 4 insertions(+), 55 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3b82a00d/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/TabBarView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/TabBarView.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/TabBarView.as index c9afdcc..cb809ed 100644 --- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/TabBarView.as +++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/TabBarView.as @@ -21,7 +21,6 @@ package org.apache.flex.mdl.beads.views import org.apache.flex.core.IParent; import org.apache.flex.events.Event; import org.apache.flex.core.IContentViewHost; - import org.apache.flex.core.IStrand; import org.apache.flex.mdl.TabBarButton; import org.apache.flex.mdl.supportClasses.ITabItemRenderer; @@ -49,32 +48,9 @@ package org.apache.flex.mdl.beads.views super(); } - /** - * @copy org.apache.flex.core.IBead#strand - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.8 - */ - override public function set strand(value:IStrand):void - { - super.strand = value; - - host.addEventListener("initComplete", initCompleteHandler); - } - - /** - * init complete handler - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.8 - */ - private function initCompleteHandler(event:Event):void + override protected function itemsCreatedHandler(event:org.apache.flex.events.Event):void { - host.removeEventListener("initComplete", initCompleteHandler); + super.itemsCreatedHandler(event); completeSetup(); } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3b82a00d/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/TabsView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/TabsView.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/TabsView.as index 8138b95..65e6376 100644 --- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/TabsView.as +++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/views/TabsView.as @@ -25,7 +25,6 @@ package org.apache.flex.mdl.beads.views import org.apache.flex.core.IStrand; import org.apache.flex.mdl.TabBar; import org.apache.flex.mdl.TabBarPanel; - import org.apache.flex.mdl.beads.models.ITabModel; import org.apache.flex.mdl.supportClasses.ITabItemRenderer; /** @@ -93,37 +92,11 @@ package org.apache.flex.mdl.beads.views } _tabBar.model = (value as IStrandWithModel).model; - - host.addEventListener("initComplete", initCompleteHandler); - } - - /** - * init complete handler - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.8 - */ - private function initCompleteHandler(event:Event):void - { - host.removeEventListener("initComplete", initCompleteHandler); - - var model:ITabModel = (_strand as IStrandWithModel).model as ITabModel; - if (!model.dataProvider) - { - model.addEventListener("dataProviderChanged", onTabsDataProviderChangedHandler); - } - else - { - completeSetup(); - } } - private function onTabsDataProviderChangedHandler(event:Event):void + override protected function itemsCreatedHandler(event:org.apache.flex.events.Event):void { - var model:ITabModel = (_strand as IStrandWithModel).model as ITabModel; - model.removeEventListener("dataProviderChanged", onTabsDataProviderChangedHandler); + super.itemsCreatedHandler(event); completeSetup(); }