[ALOY-1223] iOS: Events on Custom Template of ListView does not work well, when add Scrollable View into Template

GitHub Issuen/a
Resolution Date2015-03-27T02:54:09.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.7.0
LabelsListView, ScrollView, Templates, event
ReporterShuo Liang
AssigneeIngo Muschenetz


IOS: Events on Custom Template of ListView does not work well, when add Scrollable View into Template


1.Run the following test case on Alloy Project.


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],
		height: 200,
        selectionStyle: 0

function testClick(e) {
	Ti.API.info("test single tap");

	<Window class="container">
		<ListView id="listView" defaultItemTemplate="template">
                        <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" />                
                <ListSection id="section" headerTitle="Test"/>
Here is the [Wiki Ref](https://wiki.appcelerator.org/display/guides2/Alloy+ListView+Guide#AlloyListViewGuide-HandlingEventsonTemplateViews)


  1. Ingo Muschenetz 2015-01-09 I'm not positive why you would want to add a scrollable view. Can you give more information?
  2. Ingo Muschenetz 2015-01-09 [~skypanther] Might this be an ALOY issue?
  3. Shuo Liang 2015-02-03 Any update one this?
  4. Tim Poulsen 2015-02-03 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.
  5. Shuo Liang 2015-03-27 [~ingo], Sorry for the late update. I will close this ticket as invalid, since customer might change design.

JSON Source