[TIMOB-1282] Picker setSelectedRow OS 4 SDK 1.3.3 (HEAD)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:55:44.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.6.0 M09 |
Components | iOS |
Labels | 1.3.3, 4, defect, ios, os, picker, release-1.6.0, sdk |
Reporter | ctredway |
Assignee | Blain Hamon |
Created | 2011-04-15T02:48:28.000+0000 |
Updated | 2011-04-17T01:55:44.000+0000 |
Description
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.
Attachments
File | Date | Size |
---|---|---|
picker_basic.js | 2011-04-15T02:48:29.000+0000 | 1185 |
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?
(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...
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
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().
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.
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.
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! :-)
I'm quite sure I fixed this one due to a different bug, but I'll have to look after 1.5.0
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.
(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...
TESTING THIS BUG:
The behavior for the Popover test on KS-iPad has changed. The behavior should now be:
closing using Rc1 and ipad wifi 3.2 and 3g 4.2 based on Stephens notes above