[TIMOB-28292] Android: bindId undefined for child templates
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Unresolved |
| Affected Version/s | Release 9.3.0 |
| Fix Version/s | Release 9.3.1 |
| Components | Android |
| Labels | android, listview, regression |
| Reporter | sandeep |
| Assignee | Gary Mathews |
| Created | 2020-12-16T10:04:35.000+0000 |
| Updated | 2021-03-07T22:07:51.000+0000 |
Description
- Getting Value undefined of e.bindId in Itemclick event of Listview. Same issue only observe with Android. For iOS version it is working fine
Please Resolve it on priority
Hi, do you have reproducible code?
Any sample listView code with itemClick event giving above issue in android with Ti SDK 9.3.0.GA
var win = Ti.UI.createWindow({ backgroundColor:'white' }); var myTemplate = { properties: { height: Ti.UI.SIZE, width: Ti.UI.FILL }, childTemplates: [ { type: 'Ti.UI.View', bindId: 'outerView', properties: { backgroundColor: '#fcf', height: Ti.UI.SIZE, //layout: 'vertical', left: 15, right: 15, width: Ti.UI.FILL }, childTemplates: [ { type: 'Ti.UI.Label', bindId: 'idClick', properties: { color: 'black', height: "150dp", font: { fontFamily:'Arial', fontSize: '20dp', fontWeight:'bold' }, //left: 0 } }, ] } ] }; // Create the list view var listView = Ti.UI.createListView({ templates: { 'template': myTemplate }, defaultItemTemplate: 'template', top: Ti.Platform.osname === 'iphone' ? 20 : 0 // Allow for iOS status bar }); // Create the list data set var fruitSection = Ti.UI.createListSection({ }); var fruitDataSet = [ { idClick: {text: 'Click me!!!'}}, ]; fruitSection.setItems(fruitDataSet); // Add the data set to the list view var sections = [fruitSection]; listView.setSections(sections); listView.addEventListener('itemclick', function(e) { Ti.API.info("BindId: " + e.bindId +".."+JSON.stringify(e)) alert( "BindId: " + e.bindId ); }); // Add the list view to the main window and open it win.add(listView); win.open();Thanks, that is helpful. I'll have a look
I can reproduce the problem. Thanks for the code. Looks like this issue is related to TIMOB-28291, I recommend monitoring that ticket.
master: https://github.com/appcelerator/titanium_mobile/pull/12348
FR Passed, waiting on Jenkins build.
merged to master, backport for 9_3_X merged for 9.3.1 target.
This is still an issue in SDK 9.3.2 if you have a bindId in the parent view and tap on one of the child views. The same works on iOS - I need to get together a test case.