Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3065] Android - click and longclick handlers for TableView receive different event objects

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2011-10-20T13:10:38.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, mobilesdk
ReporterSteen Hive
AssigneePaul Dowsett
Created2011-10-17T08:58:26.000+0000
Updated2016-03-08T07:48:06.000+0000

Description

Given the following program
var win = Titanium.UI.createWindow({  
    title:'Window',
    backgroundColor:'#fff',
    fullscreen: true
});


var tableData=[];

var row = Ti.UI.createTableViewRow({
	className: "grid",
        height: 120
});

var cell = Ti.UI.createView({
	
	width: 'auto',
	height: '120'

});
var label = Ti.UI.createLabel({
	width: 'auto',
	height:'auto',
	textAlign: 'center',
	text: 'Hello, World!',
	touchEnabled:false
}) 

cell.add(label);

row.add(cell);

tableData.push(row);

var tv = Ti.UI.createTableView({
data: tableData
});

tv.addEventListener('click',function(e){
	Ti.API.info(JSON.stringify(e.source));
});


tv.addEventListener('longclick',function(e){
	Ti.API.info(JSON.stringify(e.source));
	
});
win.add(tv);
win.open();
'click' event handler receives "[Ti.UI.View]" as source 'longclick' event handler receives "[Ti.UI.TableView]" as source

Comments

  1. Anthony Decena 2011-10-20

    Thank you for raising this ticket. If this is still an issue, then we need all the information listed in the [Jira Ticket Checklist](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-Summary%3AJiraTicketChecklist) in order to accept the ticket. Once the ticket is complete, we will look into moving it to the main project. Thank you.
  2. Paul Dowsett 2012-02-17

    Closing due to inactivity. If this issue still exists, please raise a new ticket, including all the information in the [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist) to ensure that we can escalate it quickly. Read [How to Submit a Bug Report](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report) if you have not read it before, and always start a ticket using the [JIRA Ticket Template](https://wiki.appcelerator.org/display/guides/JIRA+Ticket+Template). Thanks in advance

JSON Source