Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1061] Alloy: Require a specific view via XML

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsXML
Labelsrequire, views, xml
ReporterFokke Zandbergen
AssigneeUnknown
Created2014-06-12T06:44:35.000+0000
Updated2018-03-07T22:25:37.000+0000

Description

In JS you can get a specific controller view (including its children of course) by passing its ID to getView() like this:
var view = Alloy.createController('foo').getView('bar');
I'd like to do the same in XML:
<Alloy>
  <Require src="foo" view="header">
  <View id="someOtherContent">..</View>
  <Require src="foo" view="footer">
</Alloy>
Please note that the implementation should only create the foo controller *once*, so that both the header and footer view share the same controller. Otherwise it wouldn't make much sense since the actual benefit/use-case is that these 2 views can interact with/on each other while providing views at 2 or more different locations in te parent controller/view.

Comments

  1. Mauro Parra-Miranda 2014-06-30

    Reported by [~fokke] (changed by jira).

JSON Source