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
Regular Contributor
mahesh_DT
Posts: 65
Registered: ‎11-21-2011
My Device: Playbook developer
My Carrier: developer
Accepted Solution

Re:Problem with Dropdown lists...

Hello every One,

I am facing a problem with the dropdown lists, In my application I have 4 drop down lists one below the other. The main problem follows here, the second list is being overlapped by the the first list when the first list is dropped down. How to get rid of this, any suggestions please,

Thank you and Happy new year. 

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Re:Problem with Dropdown lists...

You have to listen for the focus and then change the objects z-order.  Seems strange that RIM does not do this themselves since it has been a known problem for a long time.  Few other controls have similar issues.

 

From community library:

 

 

import flash.events.Event;
	import flash.events.FocusEvent;
	
	import qnx.ui.listClasses.DropDown;
	
	public class DropDown extends qnx.ui.listClasses.DropDown
	{
		public var dataField : String = 'data';
		public var defaultSelection : * = '';
		
		/////////////////////////////////////////////////////////////////////////
		public function DropDown()
		{
			super();
			this.addEventListener(FocusEvent.FOCUS_IN, HasFocus );
		}
		
		///////////////////////////////////////////////////////////////////////////
		private function HasFocus( event : Event ) : void
		{
			this.parent.setChildIndex( this, this.parent.numChildren-1 );
		}
		
		////////////////////////////////////////////////////////////////////
		public function set selection( value : * ) : void
		{
			var entry   : Object;
			var counter : int = 0;
			for each( entry in this.dataProvider.data )
			{
				if( entry[ this.dataField ] == value )
				{
					this.selectedIndex = counter;
					break;
				}
				counter++;
			}
		}
		
		//////////////////////////////////////////////////////////////////////
		public function get selection() : *
		{
			return this.selectedItem ? this.selectedItem[ this.dataField ] : this.defaultSelection;
		}
	}

 

Please use plain text.
BlackBerry Development Advisor
jdolce
Posts: 172
Registered: ‎10-25-2010
My Device: Not Specified

Re: Re:Problem with Dropdown lists...

There has been the following property on the DropDown for quite some time. It allows you to specify which display list the list gets added too.

 

http://www.blackberry.com/developers/docs/airapi/2.0.0/qnx/fuse/ui/listClasses/DropDown.html#dropDow...

 

http://www.blackberry.com/developers/docs/airapi/2.0.0/qnx/ui/listClasses/DropDown.html#dropDownPare...

Please use plain text.
Regular Contributor
mahesh_DT
Posts: 65
Registered: ‎11-21-2011
My Device: Playbook developer
My Carrier: developer

Re: Re:Problem with Dropdown lists...

Really Thank you very much, this helped me a lot.Its working great.
Please use plain text.
Developer
Developer
mdd
Posts: 222
Registered: ‎01-17-2012
My Device: PB
My Carrier: ATT

Re: Re:Problem with Dropdown lists...

How is this handled in BB10: DropDown no longer has a dropDownParent property (at least in FB4.7)

 

Regards,

Please use plain text.
Developer
apman
Posts: 193
Registered: ‎11-12-2010
My Device: Not Specified

Re: Re:Problem with Dropdown lists...

If the dropdowns are placed in a container layout, any content below the dropdown (including other dropdowns) is pushed down when the dropdown expands, so z-order is no concern anymore.

 

 


My app : Get set - Get up!   Get ready for the snooze revolution.

Please use plain text.