Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3201] Android: touchstart or touchend doesn't fire on tableview.

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-08-31T13:57:00.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, defect, reported-1.6.1
ReporterJohn Scanlon
AssigneeNeeraj Gupta
Created2011-04-15T03:39:18.000+0000
Updated2017-03-21T21:19:36.000+0000

Description

Problem

The "touchstart" and "touchend" events aren't firing on a table view.

Tested On

BROKEN on Titanium Mobile SDK 1.5.1, 1.5.2, 1.6.0, several 1.7.0

Sample Code

var win = Ti.UI.createWindow({ backgroundColor: '#000099' });

// create table view data object
var data = [];

data[0] = Ti.UI.createTableViewRow({title:'Row 1',backgroundColor:'#900'});
data[1] = Ti.UI.createTableViewRow({title:'Row 2',backgroundColor:'#fff'});
data[2] = Ti.UI.createTableViewRow({title:'Row 3',backgroundColor:'#900'});
data[3] = Ti.UI.createTableViewRow({title:'Row 4',backgroundColor:'#fff'});

// create table view
var tableview = Titanium.UI.createTableView({
    data:data,
    bottom:30,
    left:20,
    right:20,
    height:178,
    borderWidth:2,
    borderRadius:10,
    borderColor:'#222'
});

// create table view event listener
tableview.addEventListener('touchstart', function(e)
{
    Ti.API.info('touchstart fired');
});

// create table view event listener
tableview.addEventListener('touchend', function(e)
{
    Ti.API.info('touchend fired');
});

// add table view to the window
win.add(tableview);

win.open();

Comments

  1. John Scanlon 2011-04-15

    Workaround

    I was playing around with this more and if you create a view that is the width and height of each row and add it to each tableviewrow the touchstart and touchend get fired. This isn't desireable since the properties for the tableviewrow are no longer accessable.

  2. Joe iEntry 2011-04-15

    I'm having this issue as well. [can this be high priority? :)]

  3. Joe iEntry 2011-04-15

    I'm using Ti Mobile 1.6.1 and Android 1.6. Using John's workaround does work!

  4. John Kalberer 2011-08-26

    Why is this bug marked as trivial? I would think that having events fire correctly would be a high priority as it is a basic feature of any framework.
  5. Junaid Younus 2012-08-31

    Tested on a Samsung Galaxy S2 using TiSDK 2.2.0v20120830102513, unable to reproduce the issue. Ticket marked as resolved.
  6. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced.

JSON Source