Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26887] Android: TableView "headerTitle" and "footerTitle" cannot be changed after creation

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sRelease 9.3.0
ComponentsAndroid
LabelsTableView, android, engSchedule, header, parity
ReporterJoshua Quick
AssigneeGary Mathews
Created2019-03-08T03:37:02.000+0000
Updated2020-11-20T00:24:30.000+0000

Description

*Summary:* The Ti.UI.TableView properties "headerTitle" and "footerTitle" can only be set via creation properties on Android. They cannot be changed dynamically afterwards. iOS supports changing the title dynamically. And our documentation states that they can be changed on all platforms as well. Android should be changed to match iOS' behavior. https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView-property-headerTitle https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView-property-footerTitle *Steps to reproduce:*

Build and run the below code on Android.

Watch the header and footer text in the table view.

Notice header/footer never changes. (Below code will update them every 2 seconds.)

var rows = [];
for (var index = 1; index <= 5; index++) {
	rows.push(Ti.UI.createTableViewRow({ title: "Row " + index }));
}

var window = Ti.UI.createWindow({
	fullscreen: Ti.App.iOS ? true : false,
});
var tableView = Ti.UI.createTableView({
	headerTitle: "Header",
	data: rows,
	footerTitle: "Footer",
	width: Ti.UI.FILL,
	height: Ti.UI.FILL,
});
tableView.headerTitle = "Header (Updated)";
tableView.footerTitle = "Footer (Updated)";
window.add(tableView);
window.open();

var updateCount = 0;
setInterval(function() {
	updateCount++;
	tableView.headerTitle = "Header (" + updateCount + ")"; 
	tableView.footerTitle = "Footer (" + updateCount + ")"; 
}, 2000);
*Work-Around:* Use the "headerView" and "footerView" instead.

Comments

  1. Gary Mathews 2020-10-26

    master: https://github.com/appcelerator/titanium_mobile/pull/12029

JSON Source