Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28388] Android: Calling updateRow does not update rows other than the first row

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2021-05-18T18:12:25.000+0000
Affected Version/sRelease 9.3.2
Fix Version/sRelease 10.0.0, Release 9.3.3
ComponentsAndroid
LabelsTableView, android, regression
ReporterEwan Harris
AssigneeGary Mathews
Created2021-03-12T16:03:26.000+0000
Updated2021-05-18T18:12:29.000+0000

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

Comments

  1. Gary Mathews 2021-03-12

    master: https://github.com/appcelerator/titanium_mobile/pull/12558
  2. Lokesh Choudhary 2021-03-15

    FR Passed.
  3. Christopher Williams 2021-03-16

    merged to master; 10_0_X for 10.0.0 target; and 9_3_X branch.

JSON Source