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

Android: TableView "headerTitle" and "footerTitle" cannot be changed after creation

    Details

      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:

      1. Build and run the below code on Android.
      2. Watch the header and footer text in the table view.
      3. 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.

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

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

                  Git Source Code