Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25843] Android: 7.1.0.RC - Setting data in Ti.UI.TableView does not work as before

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-03-08T00:03:20.000+0000
Affected Version/sRelease 7.1.0, Release 7.0.2
Fix Version/sRelease 7.1.0
ComponentsAndroid
LabelsANDROID, CLI7.0.2.GA, SDK7.1.0.RC, Studio5.0.0.GA, regression
ReporterAndreas Pingas
AssigneeGary Mathews
Created2018-03-06T11:57:19.000+0000
Updated2018-03-14T18:08:55.000+0000

Description

*This is a regression from 7.0.2 to 7.1.0* I have tried 7.1.0.RC It used to work properly in the past ...
tableData[2] = tableViewSection3;
tableView.data = tableData;
However, now it only works this:
tableView.updateSection(2, tableViewSection3);
function createTableViewRow(e) {
	
	var rowView = Titanium.UI.createTableViewRow({
		height: 120
	});
	
	rowView.add(Titanium.UI.createLabel({
		text:'Text',
	}));
	
	return rowView;
}

var win = Ti.UI.createWindow();

var tableData = [];

var tableView = Titanium.UI.createTableView({
	separatorStyle:Ti.UI.TABLE_VIEW_SEPARATOR_STYLE_NONE
});
	
var tableViewSection1 = Ti.UI.createTableViewSection();
var tableViewSection2 = Ti.UI.createTableViewSection();
var tableViewSection3 = Ti.UI.createTableViewSection();

tableData.push(tableViewSection1);
tableData.push(tableViewSection2);
tableData.push(tableViewSection3);
	
tableView.data = tableData;
	
win.add(tableView);

var setData = function(e) {

	tableViewSection3.add(createTableViewRow());
	tableViewSection3.add(createTableViewRow());
	tableViewSection3.add(createTableViewRow());
	
	//tableView.updateSection(2, tableViewSection3);
	tableData[2] = tableViewSection3;
	tableView.data = tableData;	
	
};

win.addEventListener('open', function(e) {
	setData();
});

win.open();

Comments

  1. Gary Mathews 2018-03-07

    Here's another test case:
       var win = Ti.UI.createWindow({ backgroundColor: 'gray' }),
           data = [
               Ti.UI.createTableViewSection({ headerTitle: 'SECTION #1' }),
               Ti.UI.createTableViewSection({ headerTitle: 'SECTION #2' }),
               Ti.UI.createTableViewSection({ headerTitle: 'SECTION #3'})
           ],
           tv = Ti.UI.createTableView();
       
       // section #1 data
       data[0].add(Ti.UI.createTableViewRow({ title: 'Square' }));
       data[0].add(Ti.UI.createTableViewRow({ title: 'Circle' }));
       data[0].add(Ti.UI.createTableViewRow({ title: 'Triangle' }));
       
       // section #2 data
       data[1].add(Ti.UI.createTableViewRow({ title: 'Square' }));
       data[1].add(Ti.UI.createTableViewRow({ title: 'Circle' }));
       data[1].add(Ti.UI.createTableViewRow({ title: 'Triangle' }));
       
       // set table data
       tv.data = data;
       
       win.addEventListener('open', function (e) {
       
           // section #3 data
           data[2].add(Ti.UI.createTableViewRow({ title: 'Square' }));
           data[2].add(Ti.UI.createTableViewRow({ title: 'Circle' }));
           data[2].add(Ti.UI.createTableViewRow({ title: 'Triangle' }));
       
           // set table data
           tv.data = data;
       });
       
       win.add(tv);
       win.open();
       
    Tested on 7.1.0.v20180306061214, issue is present.
  2. Gary Mathews 2018-03-07

    Regression caused by: master: https://github.com/appcelerator/titanium_mobile/pull/9701 7_1_X: https://github.com/appcelerator/titanium_mobile/pull/9874
  3. Gary Mathews 2018-03-07

    master: https://github.com/appcelerator/titanium_mobile/pull/9916 7_1_X: https://github.com/appcelerator/titanium_mobile/pull/9917
  4. Lokesh Choudhary 2018-03-08

    FR Passed. PR's merged.
  5. Lokesh Choudhary 2018-03-14

    Verified the fix in SDK 7.1.0.v20180308150545 & 7.2.0.v20180313125304. Closing. Studio Ver: 5.0.0.201712081732 OS Ver: 10.13.2 Xcode Ver: Xcode 9.2 Appc NPM: 4.2.12 Appc CLI: 7.0.2 Daemon Ver: 1.0.1 Ti CLI Ver: 5.0.14 Alloy Ver: 1.11.0 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 1.8.0_101 Devices: ⇨ google Nexus 5 — Android 6.0.1 ⇨ google Nexus 6P — Android 8.0.0

JSON Source