Titanium JIRA Archive
Alloy (ALOY)

[ALOY-502] Unexpected error when requiring a widget that provides a valid view to it's parent

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2013-07-19T19:34:24.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.2.0, 2013 Sprint 15
ComponentsWidgets, XML
Labelsqe-testadded
ReporterFokke Zandbergen
AssigneeTony Lukasavage
Created2012-11-21T07:56:31.000+0000
Updated2013-08-01T01:06:47.000+0000

Description

I'm building a widget that provides a nice almost-twitter-like-experience within an app's tab. This widget can be required to provide a containing a list of tweets to a like so:
	<Tab id="tweetsTab" title="Tweets" icon="tweets.png">
		<Window id="tweetsWindow" title="Tweets">
			<Widget src="nl.fokkezb.tweetsView" id="tweetsWidget" />
		</Window>
	</Tab>
But I'd rather like the widget to provide the all together like:
	<Alloy>
		<Window>
 			<TableView id="tableView" />
		</Window>
	</Alloy>
But when I require the widget including the window like within the tab like this:
	<Tab id="tweetsTab" title="Tweets" icon="tweets.png">
		<Widget src="nl.fokkezb.tweetsView" id="tweetsWidget" />
	</Tab>
I get the following error during build: [ERROR] Invalid Tab child "Alloy.Widget" [ERROR] Tab must have only one child element, which must be a Window Shouldn't the build be aware that this widget provides (or a widget in general COULD provide) a and not trigger this error?

Comments

  1. Tony Lukasavage 2013-07-19

    *Note:* This appears to have been resolved by an earlier commit. A test case was created just to ensure no regressions. PR: https://github.com/appcelerator/alloy/pull/190 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-502 Functional testing can be passed on all platforms so long as the app compiles and runs. The initial issue was related to a compile time error, so the app loading enough is enough confirmation.
  2. Fokke Zandbergen 2013-07-21

    I think the issue was also related to cases with proxy components like:
       <Alloy>
       	<Window class="container">
       		<TableView>
       
       			<!-- This code...
       
       			<HeaderPullView>
       				<View backgroundColor="red">
       					<Label color="white" bottom="0">Pull me</Label>
       				</View>
       			</HeaderPullView>
       
       			.. in a widget now also works! -->
       
       			<Widget src="hpv" />
       			<TableViewRow title="hello world" />
       		</TableView>
       	</Window>
       </Alloy>
       
    But I just tested the above and works fine. Time to update my PullToRefresh widget ;)
  3. Federico Casali 2013-08-01

    Verified fixed. Titanium SDK 3.1.2.v20130730133101 Alloy 1.2.0-alpha Appcelerator Studio 3.1.2.201307261628 CLI 3.1.2 Node 0.8.22 Closing.

JSON Source