{ "id": "62644", "key": "TIMOB-2012", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2012-03-14T13:41:37.000+0000", "created": "2011-04-15T03:08:04.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "parity" ], "versions": [ { "id": "11225", "name": "Release 1.5.0", "archived": true, "released": true, "releaseDate": "2010-12-14" } ], "issuelinks": [], "assignee": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-03-14T13:41:37.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}
I'm running:
\r\nTitanium SDK Version: 1.4.0
\r\nIphone SDK Version: 3.2/4.0
\r\nTitanium Developer: 1.2.1
Unfortunately i cannot use this simple code to get the value of\r\na datepicker:
\r\n\r\nvar myDatePicker = Ti.UI.createPicker({\r\n type:Ti.UI.PICKER_TYPE_DATE_AND_TIME,\r\n top: 0\r\n});\r\n\r\ndebug( myDatePicker.value ); // returns null
\r\n
\r\nKitchenSink shows how to get the value with an event ( and it\r\nworks! ), but not when you need it outside an datepicker's\r\nevent.
I've also seen this issue.
\nThe workaround is manually updating the picker's value inside an\nonChange callback:
\npicker.addEventListener('change', function(e) { picker.value = e.value; });
\n
Continuously get 'null' using the following sample code - maybe\nanother Apple bug regarding the date picker? Wouldn't be the first\ntime.
\n\nvar win = Ti.UI.createWindow({backgroundColor:'white'});\nvar myDatePicker = Ti.UI.createPicker({\n type:Ti.UI.PICKER_TYPE_DATE_AND_TIME,\n top: 0\n});\n\nTi.API.info('Pre-add value: '+myDatePicker.value);\nwin.add(myDatePicker);\nTi.API.info('Post-add value: '+myDatePicker.value);\n\nwin.addEventListener('focus', function() {\n Ti.API.info('Focus value: '+myDatePicker.value);\n});\nwin.addEventListener('open', function() {\n Ti.API.info('Open value: '+myDatePicker.value);\n});\n\nwin.open();\n\nvar timer = setTimeout(function() {\n Ti.API.info('Timer value: '+myDatePicker.value);\n}, 1000);
\n