Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9867] Android: TableView does not receive events when it contains complex rows

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-10-03T20:45:12.000+0000
Affected Version/sRelease 2.1.0, Release 3.0.0, Release 1.8.3
Fix Version/sn/a
ComponentsAndroid
LabelsSupportTeam, api, parity
ReporterIvan Skugor
AssigneeKarl Rowley
Created2012-06-13T07:18:05.000+0000
Updated2017-03-29T20:13:13.000+0000

Description

The problem

Events are not propagated to table view when it contains complex rows (that is, rows that contain other components like buttons and labels).

Test case

To see this issue, run this example:
var win = Ti.UI.createWindow({
    backgroundColor: '#000',
    navBarHidden: true
});


var tableView = Ti.UI.createTableView();

var rows = [], row;
	
for (var i = 0; i < 10; ++i) {
	row = Ti.UI.createTableViewRow({ layout: 'horizontal' }),
	row.add(Ti.UI.createLabel({ left: 20, text: 'Label ' + i }));
	row.add(Ti.UI.createButton({ left: 20, title: 'Button ' + i }));
	rows[i] = row;
}

tableView.setData(rows);

var counter = 0;
tableView.addEventListener('click', function(e) {
	Ti.API.info('Table view clicked ' + (++counter));
	Ti.API.info(e.source);
});

win.add(tableView);
 
win.open();
Click on label or button and you'll see that output is generated. Click on row (right from button) and the output won't be generate, which means event is not triggered.

Expected behavior

Click on table view row should trigger table view's click event. This works fine on iOS. This is not regression, doesn't work with 1.8.3 either.

Comments

  1. Ivan Skugor 2012-06-14

    Interesting is that if row's content is wrapped with TiUIView, this issue does not happen.
  2. Eduardo Gomez 2012-09-05

    Background environment

    It happens on Android OS 2.2 & 2.3.5 versions as well not only on Android 3.1 tablets

    Tested on

    Razr 2.3.5 device LG Ally 2.2
  3. Karl Rowley 2012-09-26

    Appears to be fixed with changes for TIMOB-10238, TIMOB-6723, and TIMOB-10458. Note that the pull requests for TIMOB-6723 and TIMOB-10458 are pending at this time.
  4. Karl Rowley 2012-10-03

    I can't reproduce with latest changes to 3.0.X.
  5. Lee Morris 2017-03-29

    Closing ticket as I am unable to reproduce the issue using the following environment; Pixel (7.1) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.3 GA Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80

JSON Source