Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13064] iOS: Date Picker getValue() returns null

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2013-03-27T20:53:41.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.1.0, 2013 Sprint 07 Core, 2013 Sprint 07
ComponentsiOS
Labelsdatepicker, getvalue, module_picker, qe-testadded, triage
ReporterSameeh Harfoush
AssigneeMax Stepanov
Created2013-03-13T15:09:59.000+0000
Updated2013-09-25T07:05:40.000+0000

Description

Problem description

When i call getValue() of date picker it returns null. It is necessary to store the date value form the picker 'change' event to be able to retrieve it.

Steps to reproduce

Use the following code to reproduce:
var mainWindow = Ti.UI.createWindow({
    title : 'Lab',
    backgroundColor : 'white',
    fullscreen : false,
    navBarHidden : true,
    exitOnClose : true,
    orientationModes : [Titanium.UI.PORTRAIT]
});

var picker = Ti.UI.createPicker({
    type : Ti.UI.PICKER_TYPE_DATE,
    selectionIndicator : true,
    useSpinner : true
});

var showDate = Ti.UI.createButton({
    title : 'show date',
    bottom : 20
});
showDate.addEventListener('click', function(e) {
    alert(picker.getValue());
});

var view = Ti.UI.createView({
    width : Ti.UI.FILL,
    height : Ti.UI.FILL
});
view.add(picker);
view.add(showDate);

mainWindow.add(view);
mainWindow.open();

Comments

  1. Eric Merriman 2013-03-14

    Verified occurs with sample code above and: SDK: 2.1.3.GA SDK 3.0.0.GA SDK: 3.0.2.GA SDK: 3.1.0.v20130314120115 Titanium Studio, build: 3.0.2.201302191606
  2. Max Stepanov 2013-03-26

    PR https://github.com/appcelerator/titanium_mobile/pull/4037
  3. Paras Mishra 2013-04-06

    getValue() method is returning the appropriate values on alert. Verified on: Device : iPad mini, iOS version: 6+ SDK: 3.1.0.v20130405170202 CLI version : 3.1.0-beta OS : MAC OSX 10.7.5 Appcelerator Studio, build: 3.1.0.201304011603

JSON Source