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
Highlighted
New Contributor
Posts: 8
Registered: ‎01-13-2011
My Device: Not Specified

DropDown lists appear to be empty when using prompt

I have custom dropdowns and when I call this.prompt = "label"; my lists appear empty. if I remove the prompt the list shows correctly but I lose my label.

 

import qnx.ui.data.DataProvider;
 import qnx.ui.listClasses.DropDown;
 import qnx.ui.skins.buttons.DropDownButtonSkinBlack;
 import qnx.ui.skins.listClasses.DropDownBackgroundSkinBlack;

 public class DarkDropSlideShow extends DropDown
 {
 var _list:Array = new Array({label:'Off'},{label:'Slow'},{label:'Medium'},{label:'Fast'});
 var _dpSize:int = 4;
 public function DarkDropSlideShow(width:int, height:int) 
 {
 super();
 this.prompt = "Slideshow";
 this.rowHeight = height;
 this.dataProvider = new DataProvider(_list);
 this.rowCount = _dpSize;
 this.setButtonSkin(DropDownButtonSkinBlack);
 this.setBackgroundSkin(DropDownBackgroundSkinBlack);
 this.width = width;
 this.height = height;
 }
 }

 

New Developer
Posts: 2
Registered: ‎01-14-2011
My Device: Not Specified

Re: DropDown lists appear to be empty when using prompt

BUMP  ^^

 

I'm also having this same problem..  list works normal using regular indexing, but once I add the prompt line the whole list just becomes blank.  Anyone know if this is a bug or is there a special way we need to treat DropDowns after adding prompts?      Smiley Sad  

Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: DropDown lists appear to be empty when using prompt

i can confirm that it is a bug. there does not seem to be a way around it. just dont use prompt for now. the process to apply a prompt seems pretty straight forward and we should not have to do anything special. the code below is what i used to test for it:

 

ListTests.as:

 

 

package
{
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	
	import qnx.ui.buttons.LabelButton;
	import qnx.ui.data.DataProvider;
	import qnx.ui.listClasses.DropDown;

[SWF(width="1024",height="600",backgroundColor="#E8E8E8",frameRate="30")] public class ListTests extends Sprite { private var myList:DropDown; private var myDataProvider:DataProvider; private var myArray:Array; private var myBtn:LabelButton; public function ListTests() { super(); // support autoOrients stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; myList = new DropDown(); myArray = new Array(); myList.prompt = "Select a month"; myArray.push({label: "January"}); myArray.push({label: "February"}); myArray.push({label: "March"}); myArray.push({label: "April"}); myArray.push({label: "May"}); myArray.push({label: "June"}); myArray.push({label: "July"}); myArray.push({label: "August"}); myArray.push({label: "September"}); myArray.push({label: "October"}); myArray.push({label: "November"}); myArray.push({label: "December"}); myDataProvider = new DataProvider(myArray); myList.dataProvider = myDataProvider; myList.setPosition(10,10); /* * This is where you will apply your custom cell renderer */ addChild(myList); } } }

 

Even if you do the prompt after setting the dataprovider, same behaviours occur. hope this gets cleared up.

 

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman