Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
New Developer
Posts: 11
Registered: ‎01-18-2011
My Device: Not Specified
Accepted Solution

Picker bug or am I lost?

[ Edited ]

Hello everyone,

 

I just came across strange Picker behavior on my PlayBook application.

 

Any picker list (column) that is exactly 10 items long, and you select exactly index number 4 displays instead index number 5. The array itself keeps the correct index, but the picker displays the next index instead.

 

If the list is shorter or longer than 10, the behavior disappears. So 9 or 11 items work fine.

 

This behavior occurs on SDK version 1.0.1, but not on 0.9.4.

 

Is there something I'm doing wrong? Could someone please verify this behavior? (Code is attached)

 

Thank you so much for your help. I'm going nuts with this one.

 

Daniel

 

 

package
{
	import qnx.ui.data.DataProvider;
	import qnx.ui.picker.Picker;

	import flash.display.MovieClip;
	import flash.events.Event;
	
	[SWF(backgroundColor = "#FFFFFF", frameRate = "30", width = "1024", height = "600")]
	public class PickerIndexTest extends MovieClip
	{
		public function PickerIndexTest()
		{
			addEventListener(Event.ADDED_TO_STAGE, ready);
		}
		
		private function ready(e:Event):void
		{
			removeEventListener(e.type, arguments.callee);
					
			var items:Array = [
			{label: "Item 0"},
			{label: "Item 1"},
			{label: "Item 2"},
			{label: "Item 3"},
			{label: "Item 4"},
			{label: "Item 5"},
			{label: "Item 6"},
			{label: "Item 7"},
			{label: "Item 8"},
			{label: "Item 9"}
			 ];

			var picker:Picker = new Picker();
				
			picker.dataProvider = new DataProvider([new DataProvider(items)]);
			picker.selectedIndices = [4];
			
			addChild(picker);
		}
		
	}
}
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Picker bug or am I lost?

I can confirm the same behaviour here. With either one fewer or one more item in the array, the picker initially displays "Item 4", but with 10 items it displays "Item 5". Sounds like something to report in the issue tracker.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
New Developer
Posts: 11
Registered: ‎01-18-2011
My Device: Not Specified

Re: Picker bug or am I lost?

Thanks a lot for checking Peter, I'll send it in. I'll just leave it open for a bit to see if anyone has further insight.

 

Daniel

Highlighted
New Developer
Posts: 11
Registered: ‎01-18-2011
My Device: Not Specified

Re: Picker bug or am I lost?

[ Edited ]

Issue has been submitted as bug.

 

https://www.blackberry.com/jira/browse/TABLET-221