Home > Flex 4 Examples > DropdownList labelDisplay tooltip

DropdownList labelDisplay tooltip

If you would like to have the DropdownList display a tooltip for the selected item on the labelDisplay component, you have to override the spark DropDownList and set the tooltip on the DropDownList itself rather than the label display.

package
{
	import mx.core.mx_internal;
	
	import spark.components.DropDownList;
	
	use namespace mx_internal;
	
	public class DropDownList extends spark.components.DropDownList
	{
		public function DropDownList()
		{
			super();
		}
		
		override mx_internal function updateLabelDisplay(displayItem:*=null):void
		{
			super.updateLabelDisplay(displayItem);
			
			if ( labelDisplay != null )
			{
				toolTip = labelDisplay.text;
			}
		}
	}
}
Advertisements
  1. Gerardo Benítez
    August 26, 2012 at 9:36 AM

    Hello,
    Can you tell me if I can implement a drop-down list or a similar control, so that the user can select one or more values?
    Thank you.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: