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

Android: TableView - If you dynamically add items to the TableView, subsequent items will not appear in the table

    Details

      Description

      Details: If you dynamically add items to the TableView, subsequent items will not appear in the table.

      This is a regression. Bug does not appear in 2.1.4.GA and does not appear on iOS.

      Steps to reproduce:
      1. Add the following code to app.js:

      var win = Ti.UI.createWindow({
      	backgroundColor:'#000',
      	layout:'vertical'
      });
       
      var message = Ti.UI.createTextField({
          hintText: 'Enter message',
          height: 100,
          borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED
      });
       
      message.addEventListener('return', function (evt) {
          if (!message.value) {
              return;
          }
          addMessage(message.value);
          message.value = '';
          message.focus();
      });
      win.add(message);
       
      var tableView = Ti.UI.createTableView({});
       
      win.add(tableView);
       
      win.open();
       
      function addMessage(message) {
      	
      	var row = Ti.UI.createTableViewRow({});
      	
      	var container = Ti.UI.createView({
      		height: Ti.UI.SIZE,
      		backgroundColor: '#fff',
      		borderColor: '#ccc', borderWeight: 1
      	});
      	
      	var label = Ti.UI.createLabel({
      	    text: message,
      	    font: { fontSize: 12, fontWeight: 'bold' },
      	    height: 50
      	})
      	        
      	container.add(label);
      	row.add(container);
      	if (tableView.data.length == 0) {
                  tableView.appendRow(row);
          }
          else {
              tableView.insertRowBefore(0, row);
          }
      }
      

      2. Install and launch app to an Android device
      3. Enter at least 3 messages

      Actual: On the S3, three or more messages will not be added to the TableView (see s3_3_0_X.png)

      On the Droid 1, you will only see 1 message. Subsequent messages will not appear (see droid1_3_0_X.png)

      Expected: Adding messages should appear in the TableView (see 2_1_4_GA.png)

        Attachments

        1. 2_1_4_GA.png
          2_1_4_GA.png
          75 kB
        2. droid1_3_0_X.png
          droid1_3_0_X.png
          47 kB
        3. s3_3_0_X.png
          s3_3_0_X.png
          75 kB

          Issue Links

            Activity

              People

              • Assignee:
                ingo Ingo Muschenetz
                Reporter:
                wluu Wilson Luu (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration