Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28292] Android: bindId undefined for child templates

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionUnresolved
Affected Version/sRelease 9.3.0
Fix Version/sRelease 9.3.1
ComponentsAndroid
Labelsandroid, listview, regression
Reportersandeep
AssigneeGary Mathews
Created2020-12-16T10:04:35.000+0000
Updated2021-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

Comments

  1. Rene Pot 2020-12-16

    Hi, do you have reproducible code?
  2. sandeep 2020-12-16

    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();
       
  3. Rene Pot 2020-12-16

    Thanks, that is helpful. I'll have a look
  4. Rene Pot 2020-12-16

    I can reproduce the problem. Thanks for the code. Looks like this issue is related to TIMOB-28291, I recommend monitoring that ticket.
  5. Gary Mathews 2020-12-17

    master: https://github.com/appcelerator/titanium_mobile/pull/12348
  6. Samir Mohammed 2021-01-18

    FR Passed, waiting on Jenkins build.
  7. Christopher Williams 2021-01-19

    merged to master, backport for 9_3_X merged for 9.3.1 target.
  8. Hans Knöchel 2021-03-07

    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.

JSON Source