Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-766

Alloy: Usage of Picker events in ListView crashes app

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Duplicate
    • Affects Version/s: None
    • Component/s: None
    • Environment:

      Ti.SDK 3.4.1.GA, 3.5.0.GA, 3.5.1.GA (all current versions)

      Description

      Picker events cannot be used inside the <ItemTemplate> to be displayed in a ListView. The error is "undefined is not an object (evaluating 'e._views._alloyId91.addEventListener')".

      Test case:

      index.xml

      <Alloy>
      	<Window id="win" title="Picker in ListView">
      		<ListView id="listView" onItemclick="handleListViewClick">
      			<Templates>
      				<ItemTemplate name="DateTimePicker">
      					<Picker class="picker" onChange="setPickerValue" />
      				</ItemTemplate>
      			</Templates>
      		</ListView>
      	</Window>
      </Alloy>
      

      index.js

      var section = Ti.UI.createListSection({
      	items : [{
      		template : "DateTimePicker",
      		properties : {
      			height : 200
      		}
      	}]
      });
       
      $.listView.setSections([section]);
      $.win.open();
       
      function setPickerValue(e) {
      	Ti.API.warn(e);
      }
      

      index.tss

      ".picker": {
      	type: Titanium.UI.PICKER_TYPE_DATE_AND_TIME,
      	height: 200
      }
      

        Attachments

          Activity

            People

            • Assignee:
              shossain Shak Hossain (Inactive)
              Reporter:
              hknoechel Hans Knöchel
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Integration