Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11750] Android: missing row information when clicking on a View inside a TableViewRow

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2012-11-17T00:19:25.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.1.0, 2012 Sprint 24, 2012 Sprint 24 API
ComponentsAndroid
LabelsSupportTeam, module_tableviewrow, qe-testadded, regression, triage
ReporterDavide Cassenti
AssigneeIngo Muschenetz
Created2012-11-13T14:42:40.000+0000
Updated2013-09-20T08:58:31.000+0000

Description

Problem Description

With SDK 3.0.0, when a TableViewRow has a view inside, and this view is clicked, the listener does not return back the information about the row. In particular, these properties are missing: "detail", "index", "row", "rowData", "searchMode", "section". Clicking in the row itself works fine. This was working on 2.1.x

Steps to reproduce

Use this code to reproduce the problem:
var win = Ti.UI.createWindow({
	backgroundColor : 'white'
});

var table = Ti.UI.createTableView();

var row = Ti.UI.createTableViewRow({
    width: "100%",
    height: 100
});

var v = Ti.UI.createView({
   left: 0, top: 0,
   width: '50%', height: 100,
   backgroundColor : 'red'
});
    
row.add(v);
table.setData([row]);
    
table.addEventListener('click', function(e) {
    alert(e);
});

win.add(table);
win.open();
Clicking on the RED window does not show e.index, e.row etc., while clicking on the right part (white), you can see them. These are the results of the click on the red view:
{
  "type":"click",
  "source": {
    "backgroundColor":"red",
    "backgroundRepeat":false,
    "height":100,"left":0,"top":0,
    "rect":{"height":100,"y":0,"x":0,"width":360},
    "width":"50%",
    "size":{"height":100,"y":0,"width":360,"x":0},
    "keepScreenOn":false,
    "children":[],
    "bubbleParent":true
  },
  "bubbles":true,
  "y":60,
  "cancelBubble":false,
  "x":190
}
...and clicking on the row (white):
{
  "type":"click",
  "source":{
    "backgroundRepeat":false,
    "height":100,
    "children":[{
      "backgroundColor":"red",
      "backgroundRepeat":false,
      "height":100,"left":0,"top":0,
      "rect":{"height":100,"y":0,"x":0,"width":360},
      "width":"50%",
      "size":{"height":100,"y":0,"width":360,"x":0},
      "keepScreenOn":false,
      "children":[],
      "bubbleParent":true
    }],
    "rect":{"height":0,"y":0,"x":0,"width":0},
    "width":"100%",
    "size":{"height":0,"y":0,"width":0,"x":0},
    "keepScreenOn":false,
    "bubbleParent":true
  },
  "detail":false,
  "index":0,
  "bubbles":true,
  "rowData":{
    "backgroundRepeat":false,
    "width":"100%","height":100
  },
  "searchMode":false,
  "row":{
    "backgroundRepeat":false,
    "height":100,
    "children":[{
      "backgroundColor":"red",
      "backgroundRepeat":false,
      "height":100,"left":0,"top":0,
      "rect":{"height":100,"y":0,"x":0,"width":360},
      "width":"50%",
      "size":{"height":100,"y":0,"width":360,"x":0},
      "keepScreenOn":false,
      "children":[],
      "bubbleParent":true
    }],
    "rect":{"height":0,"y":0,"x":0,"width":0},
    "width":"100%",
    "size":{"height":0,"y":0,"width":0,"x":0},
    "keepScreenOn":false,
    "bubbleParent":true
  },
  "section":{
    "children":[],
    "rect":{"height":0,"y":0,"x":0,"width":0},
    "size":{"height":0,"y":0,"width":0,"x":0},
    "keepScreenOn":false,
    "rows":[{
      "backgroundRepeat":false,
      "height":100,
      "children":[{
        "backgroundColor":"red",
        "backgroundRepeat":false,
        "height":100,"left":0,"top":0,
        "rect":{"height":100,"y":0,"x":0,"width":360},
        "width":"50%",
        "size":{"height":100,"y":0,"width":360,"x":0},
        "keepScreenOn":false,
        "children":[],
        "bubbleParent":true
      }],
      "rect":{"height":0,"y":0,"x":0,"width":0},
      "width":"100%",
      "size":{"height":0,"y":0,"width":0,"x":0},
      "keepScreenOn":false,
      "bubbleParent":true
    }],
    "rowCount":1,
    "bubbleParent":true
  },
  "cancelBubble":false
}

Comments

  1. Ping Wang 2012-11-15

    Seems like the same issue as TIMOB-11530 which has been already resolved against the master (3.1.0).
  2. Paras Mishra 2013-04-10

    Closing as its the duplicate issue which has been fixed and closed.

JSON Source