Titanium JIRA Archive
Alloy (ALOY)

[ALOY-785] Pass TabGroup as __parentSymbol to widgets providing a tab

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sAlloy 1.2.0
Fix Version/sn/a
Componentsn/a
Labelsalloy, parent, tabgroup
ReporterDaniel Sefton
AssigneeUnknown
Created2013-08-14T15:05:56.000+0000
Updated2018-03-07T22:26:03.000+0000

Description

In 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*
<Alloy>
  <TabGroup>
    <Widget src="myTab" />
  </TabGroup>
</Alloy>
*widgets/myTab/views/widget.xml*
<Alloy>
  <Tab>
    <Window />
  </Tab>
</Alloy>

Solution

This could easily be solved by having Alloy pass the TabGroup via the __parentSymbol property 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.

Comments

No comments

JSON Source