Details
-
Type:
Bug
-
Status: Closed
-
Priority:
High
-
Resolution: Fixed
-
Affects Version/s: Release 3.1.3
-
Fix Version/s: 2013 Sprint 22, 2013 Sprint 22 API, Release 3.2.0
-
Component/s: iOS
-
Environment:
Titanium Studio 3.1.3
Description
Problem Description
The source of events like click, singletap, are not being reported. Instead, you get random internal information.
Steps to Reproduce
1. Create new mobile project with 3.1.3 in iOS
2. Paste the testcase to app.js
3. Run the app, click on the row.
4. You will see the source.
Testcase
var rowdata = [
|
{title: 'row_0'},
|
{title: 'row_1'},
|
{title: 'row_2'},
|
];
|
var win = Ti.UI.createWindow( { backgroundColor: '#FFFFFF' } );
|
var table = Ti.UI.createTableView( { data: rowdata } );
|
|
// Either:
|
|
table.addEventListener('singletap', eventArrived);
|
//table.addEventListener('doubletap', eventArrived);
|
|
// Or:
|
|
//table.addEventListener('click', eventArrived);
|
|
win.add(table);
|
win.open();
|
|
function eventArrived(e) {
|
alert('Event from table: ' + JSON.stringify(e));
|
}
|
Extra info
With singletap and doubletap events, the event contains no row information:
[TRACE] : Event from table: {'x':222,'y':31,'bubbles':true,'type':'singletap','source':
{'hideSearchOnSelection':true,'horizontalWrap':true,'searchHidden':false},'cancelBubble':false}
[TRACE] : Event from table: {'x':91,'y':61,'bubbles':true,'type':'singletap','source':
,'cancelBubble':false}
[TRACE] : Event from table: {'x':145,'y':101,'bubbles':true,'type':'singletap','source':
,'cancelBubble':false}
[TRACE] : Event from table: {'x':137,'y':22,'bubbles':true,'type':'doubletap','source':
,'cancelBubble':false}
[TRACE] : Event from table: {'x':130,'y':73,'bubbles':true,'type':'doubletap','source':
,'cancelBubble':false}
[TRACE] : Event from table: {'x':129,'y':100,'bubbles':true,'type':'doubletap','source':
,'cancelBubble':false}
With click events, the event object correctly contains row information:
[TRACE] : Event from table: {'x':122,'section':
{'horizontalWrap':true},'row':
{'horizontalWrap':true,'title':'row_0'},'index':0,'y':36,'rowData':
{'horizontalWrap':true,'title':'row_0'},'searchMode':false,'detail':false,'bubbles':true,'type':'click','source':
{'horizontalWrap':true,'title':'row_0'},'cancelBubble':false}
[TRACE] : Event from table: {'x':135,'section':
,'row':
{'horizontalWrap':true,'title':'row_1'},'index':1,'y':9,'rowData':
{'horizontalWrap':true,'title':'row_1'},'searchMode':false,'detail':false,'bubbles':true,'type':'click','source':
{'horizontalWrap':true,'title':'row_1'},'cancelBubble':false}
[TRACE] : Event from table: {'x':166,'section':
,'row':
{'horizontalWrap':true,'title':'row_2'},'index':2,'y':23,'rowData':
{'horizontalWrap':true,'title':'row_2'},'searchMode':false,'detail':false,'bubbles':true,'type':'click','source':
{'horizontalWrap':true,'title':'row_2'},'cancelBubble':false}
Expected Result
Row information from singletap, doubletap, and click events (as per current API documentation).