views:

1239

answers:

1

I am using a custom advanced auto-complete component. Selected items do not have a tooltip by default, but I would like to use the label as my tooltip.

The arraylist allQuestions is the dataprovider to my component.

<components:AdvancedAutoComplete id="addQuizQuestions_txt" width="800" height="300" dataProvider="{allQuestions}" labelField="questionText"
     showBrowseButton="true"    browserFields="questionText" allowMultipleSelection="true" allowDuplicates="true" />

allQuestions.questionText should is the path to my desired label.

I have looked into using events, such as event.currentTarget, but I dont think they exist for tooltips.

Does anyone know how to add a tooltip using the data provided to the component?

+2  A: 

where are you trying to add a tool tip? within the pop-up of the auto complete? If so on the component in the itemRenderer add the tooltip atribute and bind it to the label control. Here is an example:

you'll have to investigate the source code to see where this is happening exactly... also it might be done in the AS3 code but the same applys... on the label text set:

myImage.tooltip = _label.text;

Shua
I am trying the tooltip in the properties of a component that seems to extend both a combobox and a textarea. I want to do something like: <mx:somecomponent id="thisComp" tooltip="{thisComp.currentTarget.text}" />
Bryan
well if its extending the combobox you should be using tooltip="{thisComp.selectedItem.label}". another option is setting the tooltip value on the change event.
Shua