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

Windows: Cannot add data to Picker on SDK 5.4.0

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: Release 5.4.0
    • Fix Version/s: None
    • Component/s: None
    • Environment:

      Description

      When I try to add data to Picker, my application crash with Unknown exception.

      I tried with SDK 5.2.0.GA and it's work. But on SDK 5.4.0.v20160402025807 it crash.

      I tried this

      var picker = Ti.UI.createPicker({
         columns: [ column1, column2 ]
      });
      

      ==> CRASH
      and I tried to create the picker and after add columns or data like this and it crash too.

      picker.add([ column1, column2 ]);
      

      ==> CRASH
      OR

      picker.add(data1);
      

      ==> CRASH
      OR

      picker.add([data1]);
      

      ==> CRASH

      Please help.

      The source code :

      //index.xml

      <Alloy>
      	<Window class="container" onClick="doClick">
      	</Window>
      </Alloy>
      

      //index.js

      function doClick(e) {
          var win = Ti.UI.createWindow({});
       
      	var data1  = [];
      	data1[0] = Ti.UI.createPickerRow({ title: 'Bananas'});
      	data1[1] = Ti.UI.createPickerRow({ title: 'Strawberries'});
      	data1[2] = Ti.UI.createPickerRow({ title: 'Mangos' });
      	data1[3] = Ti.UI.createPickerRow({ title: 'Grapes' });
      	
      	var data2 = [];
      	data2[0] = Ti.UI.createPickerRow({ title: 'red', color: 'red', font: { fontSize: 30, fontFamily: 'Times New Roman' } });
      	data2[1] = Ti.UI.createPickerRow({ title: 'blue',   color: 'blue' });
      	data2[2] = Ti.UI.createPickerRow({ title: 'yellow', color: 'yellow' });
      	data2[3] = Ti.UI.createPickerRow({ title: 'green',  color: 'green' });
      	
      	var column1 = Ti.UI.createPickerColumn();
      	var column2 = Ti.UI.createPickerColumn();
      	
      	for (var i = 0; i < data1.length; i++) {
      	    column1.addRow(data1[i]);
      	}
      	
      	for (var i = 0; i < data2.length; i++) {
      	    column2.addRow(data2[i]);
      	}
      	
      	var picker = Ti.UI.createPicker({
      	   columns: [ column1, column2 ]
      	});
      	// picker.add([ column1, column2 ]);
      	
      	picker.addEventListener('change', function (e) {
      	    Ti.API.info("User selected: " + JSON.stringify(e.selectedValue));
      	});
      	
      	win.add(picker);
      	win.open();
      }
       
      $.index.open();
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jmarty jmarty
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

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

                  Git Integration