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

Windows: Picker.setSelectedRow doesn't work

    Details

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

      Ti SDK 6.1.2.GA,6.2.0.v20170906064110, 7.0.0.v20170906135653

    • Story Points:
      5
    • Sprint:
      2017 Sprint 19 SDK

      Description

      Description

      Calling setSelectedRow causes no change in the UI

      var _window = Ti.UI.createWindow();
      var picker = Ti.UI.createPicker({
          type: Ti.UI.PICKER_TYPE_PLAIN,
          selectionIndicator: true
      });
      var data = [];
      var answerLoop = 0;
      // add answers
      for (answerLoop = 0; answerLoop < 11; answerLoop++) {
          data.push(Ti.UI.createPickerRow({
              title: 'Answer ' + answerLoop,
              custom_item: answerLoop
          }));
      }
      picker.add(data);
      picker.setSelectedRow(0, 5, true);
      console.log(picker.selectedRow);
      var selectedButton = Ti.UI.createButton({
          title: 'Select Answer 6',
          width: 300,
          height: 'auto',
          top: 50
      });
      selectedButton.addEventListener('click', function(e) {
          picker.setSelectedRow(0, 6, true);
          console.log(picker.selectedRow);
      });
      _window.add(picker);
      _window.add(selectedButton);
      _window.open()
      
      

      Steps to reproduce

      1. Add the above code to an existing app.js
      2. Build for Windows
      3. Click 'Select Answer 6'

      Actual

      On startup Answer 5 should be shown, after clicking the button home Answer 6 should be shown

      Expected

      Picker remains blank

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code