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

Windows: Pickers populated at run time do not fire change events

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 7.0.1
    • Fix Version/s: Release 7.1.0
    • Component/s: Windows
    • Labels:
      None
    • Story Points:
      5
    • Sprint:
      2018 Sprint 04 SDK

      Description

      Hello,
      When creating a picker on windows and populating it after the view has been opened the change event does not fire.

      Test Environment:
      Appcelerator Command-Line Interface, version 7.0.1
      SDK: 7.0.1.GA
      Operating System
      Name = Microsoft Windows 10 Enterprise 2016 LTSB
      Windows 10 emulator

      Test Code:

      <Alloy>
      	<Window id="win" class="container">
      		<Label id="label" onClick="createPicker">Create Picker</Label>
      		<Label id="label2" onClick="populatePicker">Populate Existing Picker</Label>
      		<Picker id="picker"/>
      	</Window>
      </Alloy>

      index.js

      function populatePicker(e) {
      	var column = Ti.UI.createPickerColumn();
      	var pickerRow1 = Ti.UI.createPickerRow({
      		title: 'One'
      	});
      	var pickerRow2 = Ti.UI.createPickerRow({
      		title: 'Two'
      	});
      	column.addRow(pickerRow1);
      	column.addRow(pickerRow2);
      	$.picker.add([column]);
      }
       
      function createPicker(e) {
      	var picker = Ti.UI.createPicker({
      		top: 200,
      		width: Ti.UI.FILL,
      		height: 60,
      		backgroundColor: 'white'
      	});
      	$.win.add(picker);
      	var column = Ti.UI.createPickerColumn();
      	var pickerRow1 = Ti.UI.createPickerRow({
      		title: 'One'
      	});
      	var pickerRow2 = Ti.UI.createPickerRow({
      		title: 'Two'
      	});
      	column.addRow(pickerRow1);
      	column.addRow(pickerRow2);
      	picker.add([column]);
      	picker.addEventListener('change', function(){
      		alert('Created Picker Changed');
      	});
      }
       
      $.win.open();
       
      $.picker.addEventListener('change', function(){
      	alert('Populated Picker Changed');
      });
      
      

      index.tss

      ".container": {
      	backgroundColor:"red"
      }
       
      "Label": {
       
      	width: Ti.UI.SIZE,
      	height: Ti.UI.SIZE,
      	color: "#000"
      }
       
      "#label": {
      	top: 100,
      	font: {
      		fontSize: 12
      	}
      },
      "#label2": {
      	top: 400,
      	font: {
      		fontSize: 12
      	}
      },
      "#picker":{
      	top: 500,
      	width: Ti.UI.FILL,
      	height: 60,
      	backgroundColor: 'white'
      }
      

      Steps to Reproduce:

      • Open the sample app attached
      • Click on the populate picker label
      • Select an item from the picker
      • Change event does not fire.
      • Click on the create picker label
      • Select an item from the new picker
      • Change event fires

      Expected Result:
      When clicking on one of the newly added properties of the picker the change event should fire.

      Actual Result:
      The new property is selected but the change event does not fire.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kiguchi Kota Iguchi
                Reporter:
                mrahman Mostafizur Rahman
                Reviewer:
                Gary Mathews
                Tester:
                Samir Mohammed
              • Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code