[ALOY-785] Pass TabGroup as __parentSymbol to widgets providing a tab
|Affected Version/s||Alloy 1.2.0|
|Labels||alloy, parent, tabgroup|
DescriptionIn the following code the widget providing the tab gets no reference to the TabGroup. Because of this, it cannot change the TabGroup's activeTab, ActionBar or perform other context-aware actions. *views/index.xml*
*widgets/myTab/views/widget.xml*<Alloy> <TabGroup> <Widget src="myTab" /> </TabGroup> </Alloy>
<Alloy> <Tab> <Window /> </Tab> </Alloy>
SolutionThis could easily be solved by having Alloy pass the TabGroup via the
__parentSymbolproperty also found in other places where a widget is used. IMHO this property should/could *always* be passed to widgets/required controllers.
Notes* Any workaround requiring code in the index-controller is not honoring the fact that widgets should be self-sustained. * Having said the above, even assign the TabGroup to
Alloy.Globals.won't work since the tabs will be created before the controller code is executed.