[ALOY-1223] iOS: Events on Custom Template of ListView does not work well, when add Scrollable View into Template
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2015-03-27T02:54:09.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.7.0 |
Components | n/a |
Labels | ListView, ScrollView, Templates, event |
Reporter | Shuo Liang |
Assignee | Ingo Muschenetz |
Created | 2015-01-09T05:26:08.000+0000 |
Updated | 2015-03-27T02:54:09.000+0000 |
Description
IOS: Events on Custom Template of ListView does not work well, when add Scrollable View into Template
Reproduce:
1.Run the following test case on Alloy Project.Problem:
When add onSingletap event to Label inside template, it works well. But If add same event to scrollable View inside template, build will failed with "undefined" error.Test Case:
var view1 = Ti.UI.createView({ backgroundColor:'#123', width:"200"});
var view2 = Ti.UI.createView({ backgroundColor:'#246', width:"200"});
var view3 = Ti.UI.createView({ backgroundColor:'#48b', width:"200"});
var dataSet = [{
scroll: {
views:[view1, view2, view3],
},
properties:{
height: 200,
selectionStyle: 0
},
}];
$.section.appendItems(dataSet);
function testClick(e) {
Ti.API.info("test single tap");
};
$.index.open();
<Alloy>
<Window class="container">
<ListView id="listView" defaultItemTemplate="template">
<Templates>
<ItemTemplate name="template">
<Label buildId="label" left="0" text="test" width="Ti.UI.SIZE" color="black" onSingletap="testClick"/>
<ScrollableView bindId="scroll" backgroundColor="white" clipViews="false" left="100" showPagingControl="ture" width="200" />
</ItemTemplate>
</Templates>
<ListSection id="section" headerTitle="Test"/>
</ListView>
</Window>
</Alloy>
Here is the [Wiki Ref](https://wiki.appcelerator.org/display/guides2/Alloy+ListView+Guide#AlloyListViewGuide-HandlingEventsonTemplateViews)
I'm not positive why you would want to add a scrollable view. Can you give more information?
[~skypanther] Might this be an ALOY issue?
Any update one this?
As stated earlier, the customer is attempting to use an antipattern here and should consider the alternatives proposed earlier. The ListView is not intended for this sort of use. Events will not propagate and be accessible in a useful manner, even if we made the Alloy compiler were made to work.
[~ingo], Sorry for the late update. I will close this ticket as invalid, since customer might change design.