Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1427] Android 2.2: TableViewRow click event not firing

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:56:09.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
ComponentsAndroid
Labelsandroid, defect, tableviewrow
ReporterMichael Hoisie
AssigneeDon Thorp
Created2011-04-15T02:52:04.000+0000
Updated2011-04-17T01:56:09.000+0000

Description

I expect to get some kind of alert, but nothing fires. According to the docs, the click events should work.


Titanium.UI.setBackgroundColor('#000');

var win =  Titanium.UI.createWindow({  
    title:'TiFourgen',
    backgroundColor:'#000'
});

var text = 'Document 1';


var table = Ti.UI.createTableView({});
win.add(table);


for (var i = 0; i < 10; i++) {
    var row = Ti.UI.createTableViewRow({
        height: 100,
        className: 'document',
        touchEnabled: true
    });

    row.addEventListener('click',function()
    {
            alert("row click!");
    });
    
    var label = Titanium.UI.createLabel({
        text: text,
        width:200,
        height:150,
        top:10,
        color:'#336699',
        font:{fontSize:16, fontStyle:'italic'},
        textAlign:'left', 
        touchEnabled: true,
        backgroundColor:'#ffffff'
    });

    label.addEventListener('click',function()
    {
            alert("label click!");
    });
    
    
    row.add(label);
    table.appendRow(row);
}

win.open();

Comments

  1. Bill Dawson 2011-04-15

    Confirmed. Also pre-2.2, AFAICT.

  2. Don Thorp 2011-04-15

    (from [8fa74758d1ecb7c3082bc771b44ea8f86a6a5c8c]) [#1427 state:fixed-in-qa] Detect if row has a click listener and fire it. If the tableview has a listener that will fire as well. http://github.com/appcelerator/titanium_mobile/commit/8fa74758d1ecb7c3082bc771b44ea8f86a6a5c8c"> http://github.com/appcelerator/titanium_mobile/commit/8fa74758d1ecb...

  3. Thomas Huelbert 2011-04-15

    confirmed on a nexus 1 (2.2) and a g1 (1.6), ipod touch (4.1)

JSON Source