Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1282] Picker setSelectedRow OS 4 SDK 1.3.3 (HEAD)

GitHub Issuen/a
Resolution Date2011-04-17T01:55:44.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M09
Labels1.3.3, 4, defect, ios, os, picker, release-1.6.0, sdk
AssigneeBlain Hamon


A customer reported that with SDK 1.3.2, after adding a picker to a window, using the setSelectedRow worked and this does not work in 1.3.3 from HEAD.

I was able to reproduce this with picker_basic.js in the Kitchen Sink. I was able to get it to work with a setTimeout of 100ms though which leaves me to believe that there is a delay in component creation and being able to use methods on a component. My picker_basic.js is attached and the setTimeout is at the bottom of the file.




  1. ranguard 2011-04-15

    It's obviously a known bug (since June 10th) as a work around was added to the end of contacts_groups.js here:

    http://github.com/appcelerator/titanium_mobile/commit/2998e9d0dc2933c00543072a51c87872077c0cf5#diff-4"> http://github.com/appcelerator/titanium_mobile/commit/2998e9d0dc293...

    Maybe you could ask your developers to raise tickets when they find bugs - rather than waiting for your clients to find them?

  2. Jeff Haynie 2011-04-15

    (from [958778c249da2a20f4af1f7d663a0595ad263d49]) [#1282 state:resolved] Picker now delays row selection until view attached if necessary. http://github.com/appcelerator/titanium_mobile/commit/958778c249da2a20f4af1f7d663a0595ad263d49"> http://github.com/appcelerator/titanium_mobile/commit/958778c249da2...

  3. ranguard 2011-04-15

    I create a view, then a picker, add the picker to the view, then create a window and add the view to the window.

    THEN I call Ti.Ui.currentTab.open(win, { animated: true });

    Calling setSelectedRow BEFORE the open doesn't work, calling it AFTER does.

    So not sure this is 100% fixed - much better though - thanks

    p.s. you may want to update your contacts_groups.js example

  4. Stephen Tramer 2011-04-15

    We are currently working on some internal changes which will likely go in post-1.4.0 that may be able to solve this problem. For now, I recommend that you call setSelectedRow() in an event listener for win.open().

  5. ranguard 2011-04-15

    Great thanks - could you open a new ticket for '1.5' to that effect - just so others can find out it is a know problem.

  6. Stephen Tramer 2011-04-15

    Re-opening. This can probably be fixed by Blain's changes to the view loading system; we'll need to look into it. Right now it looks like a view can attach before a window is properly opened, a little more work is necessary.

  7. Fred Spencer 2011-04-15

    Hey guys - Worked on this for about an hour and can't really find a way to get this to work when opening a Picker in a Popover. The Popover and Picker are instantiated within an Event Handler.

    Picker populates just fine, but setSelectedRow won't work. Tried fireEvents and timing changes. Bringing this up as Picker in Popover are part of the HIG.

    "Present a picker or date and time picker only within a popover."

    Cheers! :-)

  8. Blain Hamon 2011-04-15

    I'm quite sure I fixed this one due to a different bug, but I'll have to look after 1.5.0

  9. Stephen Tramer 2011-04-15

    Appears to be an Apple bug involving when a picker row can be set (it must, apparently, be attacked to the topmost level view). Going to look into a workaround.

  10. Jeff Haynie 2011-04-15

    (from [2fab4fc209b2277dc41ea4fd841848523a6509c1]) [#1282 state:fixed-in-qa] Workaround for cute Apple bug involving animating a picker when it might maybe not be quite attached to a view yet! https://github.com/appcelerator/titanium_mobile/commit/2fab4fc209b2277dc41ea4fd841848523a6509c1"> https://github.com/appcelerator/titanium_mobile/commit/2fab4fc209b2...

  11. Stephen Tramer 2011-04-15


    The behavior for the Popover test on KS-iPad has changed. The behavior should now be:

    • Click on 'Show popover 2' (display picker in popover)
    • The selected row should be the second row
  12. Thomas Huelbert 2011-04-15

    closing using Rc1 and ipad wifi 3.2 and 3g 4.2 based on Stephens notes above

JSON Source