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

Android: Event bubbling runtime error when deleting rows from a table

    Details

      Description

      problem

      When attempting to delete a row in a table by clicking on a UI element in that row, Titanium generates a runtime error on Android (attached).

      What appears to be happening is that the event (click) triggered on the UI element within the row is attempting to bubble to the row itself, which no longer exists if the action is to delete the row. This makes a lot more sense in the test case. This may be preventable by messing with the event bubbling properties, but still presents a regression from previous versions.

      This error does not occur on iOS with this test case.

      test case

      This problem surfaced in an Alloy app when I updated to TiSDK 3.0.0.GA, but I have created a pure Titanium test case to make things easier. Click the "delete" button and you should get the runtime error.

      var win = Ti.UI.createWindow({
      	backgroundColor: '#fff',
      	fullscreen: false,
      	exitOnClose: true
      });
       
      var table = Ti.UI.createTableView();
      var row = Ti.UI.createTableViewRow({
      	height: '50dp',
      });
      var button = Ti.UI.createButton({
      	title: 'delete'
      });
      button.addEventListener('click', function(e) {
      	table.setData([]);
      });
      row.add(button);
       
      table.setData([row]);
       
      win.add(table);
      win.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sunila Sunila
                Reporter:
                tlukasavage Tony Lukasavage
                Reviewer:
                Ping Wang
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration