[ALOY-611] Add <Require> support to ListView
GitHub Issue | n/a |
---|---|
Type | Sub-task |
Priority | High |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2013-07-31T20:40:36.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.2.0, 2013 Sprint 16, 2013 Sprint 08 |
Components | XML |
Labels | notable |
Reporter | Tony Lukasavage |
Assignee | Unknown |
Created | 2013-04-08T14:43:39.000+0000 |
Updated | 2018-03-07T22:25:39.000+0000 |
Description
isViewTemplate
condition so that they can return ListView compatible code. Right now only explicit UI components are handled in the markup.
<Alloy>
<ListView>
<Templates>
<ItemTemplate name="template1" height="100">
<ImageView bindId="image" left="15" top="6" bottom="6"/>
<Label bindId="label" left="100" right="10"/>
</ItemTemplate>
<ItemTemplate name="template2" height="100">
<!-- this won't work until this is resolved -->
<Require src="someRequire"/>
</ItemTemplate>
</Templates>
</ListView>
</Alloy>
test app: https://github.com/appcelerator/alloy/tree/master/test/apps/ui/listview it includes required itemtemplates and listitems
The test app does *not* include the very example of this ticket. It [does include](https://github.com/appcelerator/alloy/blob/master/test/apps/ui/listview/views/templates.xml) a test where the
<Require />
is on the same level as the other<ItemTemplate />
, but does not test for a<Require />
used *IN* an<ItemTemplate />
, like in the description of this ticket. When using a<Require />
inside an<ItemTemplate />
on the master version from Git, you'll get the following error during compile, which obviously should at least be caught to display a clear syntax error:Thanks to Matthew Lanham fro [bringing this under my attention](https://github.com/FokkeZB/nl.fokkezb.cachedImageView/issues/5).
Thanks for the heads up guys. I'll address this specific situation.
PR: https://github.com/appcelerator/alloy/pull/198 After additional research, controllers within ItemTemplates don't make a great deal of sense given the entirely new structure used by the ListView API. There's no way to tie the UI components that compose the ItemTemplate back to the originating controller code. Due to this fact, the elements inside the
I'm going to resolve this issue, but will revisit it to be addressed with more than a compile error message at a future date. There would need to be significant work done on code generation just to facilitate this particular usage of ItemTemplate, and I don't believe the large effort necessary to do that is warranted right now.
Agree 100%
I still have the same problem in version 1.3.1. The resolution should not be "fixed" but "won't fix"
Can this ticket be re-opened until there's a workaround? As André mentioned this was not fixed. Using Widgets and Require in Templates would be awesome.
The original issue *IS* fixed. I think [~manuellehner] you better create a new issue asking for using
<Require />
and<Widget />
in item templates.