Display ToolTips for Combobox List items in Flex.

One of the readers asked this question, Is it possible to show ToolTips for the Combobox List items [on mouse over on each item i would like to show a ToolTip]?, and my answer was “YES”.And this post tells about that.

The First thing we got to remember here is the ToolTipManager Class and its methods.Basic information on how to create tooltips using this Class.

The ToolTipManager has two methods that let you programmatically use ToolTips. These methods are createToolTip() and destroyToolTip(), which you use to create and destroy new ToolTip objects. When you create a ToolTip object, you can customize it as you would any object, with access to its properties, styles, events, and effects.

[So explore more about this ToolTipManager Class to learn more], now we know how to create ToolTips using this Class, but how to show on the Combobox List items ?.Its simple using the ListEvent Class and on ListEvent.ITEM_ROLL_OVER raise an Event and write your code on the eventhandler to create tooltip.Check on the below code sample for this.And destroy the created tooltip on ListEvent.ITEM_ROLL_OUT.Isn’t that simple.

Run demo.

1.Download source code. –>This is with the itemRollOver,itemRollOut properties.

2.Download source code. –>This is with the addEventListener().

Enjoy the post.

7 Responses to “Display ToolTips for Combobox List items in Flex.”

  1. norberto Says:

    Hi, i use your code with item rollover, and i find a little bug, when you display the combobox, and use the mouse wheel, the tooltip is not destroyed.

    thanks

    Saludos desde México

  2. norberto Says:

    One detail, only happen if the combo have scroll bar

  3. Alpana Says:

    Hi

    Your code has been very helpful to me.
    Just a suggestion. In code with itemRollOver, calling fnDesToolTip on close ensures that tooltip is destroyed on closing the combobox.

    Thanks

  4. kishorekuamru Says:

    Hi kumar, Nice post :) it really helps and I got the need exactly.
    I will appreciate if you upload the fixed version, b’ze I found that tool tip is not destroying when we click an particular item.

Leave a Reply