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

Android: Calling updateRow does not update rows other than the first row

    Details

    • Story Points:
      3
    • Sprint:
      2021 Sprint 5, 2021 Sprint 6, 2021 Sprint 10

      Description

      Description

      When running the code below and clicking any headerview other than Label0 the row will not be made visible. When clicking Label0 the row in that section is made visible

      function formRow(isVisible, rowHeight){
      	var row = Ti.UI.createTableViewRow({
      		width : Ti.UI.FILL,
      		height : rowHeight,
      		backgroundColor : "white"
      	}); 
      	row.add(Ti.UI.createLabel({
      		text : "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
      		color: "black",
      		height : Ti.UI.SIZE,
      		visible : isVisible,
      		width : Ti.UI.FILL,
      	}));
       
      	return row;
      }
       
      function formHeaderView(index){
      	var headerView = Titanium.UI.createView({
      		layout : "vertical",
      		height : 55,
      		width : Ti.UI.FILL
      	}); 
       
      	var headerContentView = Titanium.UI.createView({
      		backgroundColor : "white",
      		height : 44,
      		sectionIndex : index,
      		width : Ti.UI.FILL,
      		touchEnabled : true
      	}); 
      	
      	var headerLabel = Titanium.UI.createLabel({
      		text : "Label" + index,
      		left : 0,
      		color : "black",
      		touchEnabled : false,
      		height : Ti.UI.SIZE
      	}); 
      	
      	headerView.addEventListener('click', function(e){
      		Ti.API.info('header view click:::::::::::::::'+JSON.stringify(e));
      		table.updateRow(e.source.sectionIndex, formRow(true,Ti.UI.SIZE));
      	});
      	
      	headerContentView.add(headerLabel);
      	headerView.add(headerContentView);
      	return headerView;
      }
       
      Ti.UI.backgroundColor = 'white';
      var win = Ti.UI.createWindow();
      var listSections = [];
      for (var i = 0; i < 5; i++) {
      	var section = Ti.UI.createTableViewSection({
      		headerView : formHeaderView(i)
      	});
      	section.add(formRow(false, 0));
      	listSections.push(section);
      }
       
      var table = Ti.UI.createTableView({
      	data: listSections
      });
       
      win.add(table);
      win.open();
      

      Steps to reproduce

      1. Add the code above to an existing app.js and build to Android
      2. Click Label0
      3. Click Label1

      Actual

      Row is shown when clicking Label0, is not when click Label1

      Expected

      Row should show in both cases

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                eharris Ewan Harris
                Reviewer:
                Joshua Quick
                Tester:
                Lokesh Choudhary
              • Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration