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

Android: 'longpress' event is not working in ListView

    Details

    • Story Points:
      5
    • Sprint:
      2014 Sprint 09 Tooling, 2014 Sprint 19 SDK

      Description

      'longpress' event is not working in listView. Here is the test case:

      var win = Ti.UI.createWindow({backgroundColor: 'white'});
       
      var plainTemplate = {
          childTemplates: [
              {
                  type: 'Ti.UI.Label', // Use a label
                  bindId: 'rowtitle',  // Bind ID for this label
                  properties: {        // Sets the Label.left property
                      left: '10dp'
                  }
              },
              {
                  type: 'Ti.UI.ImageView',  // Use an image view
                  bindId: 'pic',            // Bind ID for this image view
                  properties: {             // Sets the ImageView.image property
                  	image: 'KS_nav_ui.png'
                  }
              },                    
              {
                  type: 'Ti.UI.Button',   // Use a button
                  bindId: 'button',       // Bind ID for this button
                  properties: {           // Sets several button properties
                      width: '80dp',
                      height: '30dp',                        	
                      right: '10dp',
                      title: 'press me'
                  }
                 
              }
          ]
      };
       
      function report(e) {
      	Ti.API.info(e.type);
      }
       
      var listView = Ti.UI.createListView({
          // Maps the plainTemplate object to the 'plain' style name
          templates: { 'plain': plainTemplate },
          // Use the plain template, that is, the plainTemplate object defined earlier
          // for all data list items in this list view
          defaultItemTemplate: 'plain'               
      });
       
      var data = [];
      for (var i = 0; i < 3; i++) {
          data.push({
              // Maps to the rowtitle component in the template
              // Sets the text property of the Label component
              rowtitle : { text: 'Row ' + (i + 1) },
              // Sets the regular list data properties
              properties : {
                  itemId: 'row' + (i + 1),
                  accessoryType: Ti.UI.LIST_ACCESSORY_TYPE_NONE
              }
          });
      }
       
      listView.addEventListener('longpress', function(e){
         alert("longpress fired!!!");
      });
      win.add(listView);
      win.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hpham Hieu Pham
                Reporter:
                mpathak Meenakshi Pathak
                Tester:
                Visalakshi Chidambaram
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration