Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-13141

Android: ListView itemclick event does not fire when clicking on the accessory

    Details

      Description

      Run the following code below in the Android emulator.

      Click on the accessories (checkmark, detail button, disclosure indicator). The itemclick event does not fire.

      Click anywhere else on the cell. The itemclick event fires.

      EXPECTED BEHAVIOR:
      itemclick should still fire when clicking on the accessory.

      var win = Ti.UI.createWindow({backgroundColor: 'white'});
      var listView = Ti.UI.createListView();
       
      var tasks = [
          {id: 'trash', name: 'Take Out the Trash', icon: 'KS_nav_views.png', accessory: Ti.UI.LIST_ACCESSORY_TYPE_DETAIL},
          {id: 'dishes', name: 'Do the Dishes', icon: 'KS_nav_views.png', accessory: Ti.UI.LIST_ACCESSORY_TYPE_DISCLOSURE},
          {id: 'doggie', name: 'Walk the Dog', icon: 'KS_nav_views.png', accessory: Ti.UI.LIST_ACCESSORY_TYPE_CHECKMARK}
      ];
       
      var data = [];
      for (var i = 0; i < tasks.length; i++) {
          data.push(
              { properties: {
                  itemId: tasks[i].id,
                  title: tasks[i].name,
                  image: tasks[i].icon,
                  accessoryType: tasks[i].accessory,
                  color: 'black'
              }
          });
      }
       
      var section = Ti.UI.createListSection();
      section.setItems(data);
      listView.sections = [section];
      listView.addEventListener('itemclick', function(e){
      	Ti.API.info(JSON.stringify(e));
      });
      win.add(listView);
      win.open();
      

        Attachments

          Activity

            People

            • Assignee:
              hpham Hieu Pham
              Reporter:
              bhatfield Benjamin Hatfield (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-15956
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code