The Forging Titanium Episode 10 located here
http://developer.appcelerator.com/blog/2011/10/forging-titanium-episode-10-forms.html/comment-page-1#comment-85110
Does not show how to get the picker value. If you look at the video at approximately 5:06 mark you will see on Android the value of State is undefined. I can't seem to get it to work. Can anyone please help me?
Thanks!
2 Answers
To get the picker value use the following code
myButton.addEventListener('click',function(event){ Titanium.API.info('Picker custom value is - ' + picker.getSelectedRow(0).custom_item); Titanium.API.info('Picker title value is - ' + picker.getSelectedRow(0).title); }Hope this helps you
Insert the following code on line 104 in forms.js and it will work as I also faced the same issue which is resolved now.
fieldObject.addEventListener('change', function(e) {
this.value = e.selectedValue[0];
});
fieldObject.getValue = function() {
return this.value; };
fieldObject.setValue = function(value) {
fieldObject.value = value;
};
Your Answer
Think you can help? Login to answer this question!