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

Windows: setData does not add UI elements that already existed

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Release 6.1.2, Release 7.0.0, Release 6.2.0
    • Fix Version/s: Release 7.1.0
    • Component/s: Windows
    • Labels:
      None
    • Environment:

      Ti SDK: 6.1.2.GA, 6.2.0.v20170912203804, 7.0.0.v20170906135653

    • Story Points:
      5
    • Sprint:
      2017 Sprint 22 SDK, 2017 Sprint 25 SDK, 2017 Sprint 26 SDK, 2018 Sprint 01 SDK, 2018 Sprint 02 SDK

      Description

      Description

      When calling setData, child elements of the TableViewRow that have been added once are not added

      var _window = Ti.UI.createWindow({ backgroundColor: 'green' });
      var data = [];
      var row = Ti.UI.createTableViewRow();
      var lbl = Ti.UI.createLabel({
          text: 'label'
      })
      row.add(lbl)
      data.push(row);
      var table = Titanium.UI.createTableView({
          top: 100,
          data: data
      });
      var btn = Ti.UI.createButton({
          title: 'Add new data',
          top: 5
      });
      btn.addEventListener('click', function() {
          var newData = [];
          var newRow = Ti.UI.createTableViewRow();
          var newLbl = Ti.UI.createLabel({
              text: 'label again'
          })
          newRow.add(newLbl)
          newData.push(newRow);
          table.setData(newData)
      });
      var oldbtn = Ti.UI.createButton({
          title: 'Add old data',
          top: 50
      });
      oldbtn.addEventListener('click', function() {
          table.setData(data)
      })
      _window.add(btn);
      _window.add(oldbtn)
      _window.add(table);
      _window.open()
      

      Steps to reproduce
      1. Add the above code to an existing app.js and build for Windows
      2. Click 'Add old data' button
      3. Click 'Add new data' button
      Actual

      'Add old data' does not add the label to the tableviewrow

      Expected

      The label should be visible in both cases

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kiguchi Kota Iguchi
                Reporter:
                eharris Ewan Harris
                Reviewer:
                Gary Mathews
                Tester:
                Samir Mohammed
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code