I would call dispatchMouseEvent(new MouseEvent(....)) on the tooltip

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of rviswanathan
Sent: Monday, January 19, 2009 4:21 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] NPE on ToolTipManagerImpl/reset()


Hi

I am reopening this thread. I am unable to get around this NPE issue. I
tried to do the following

Set the visibility of ToolTipManager.currentTooltip to false (instead of
destroying it)
Disable the tooltip when I make a service call and enable it on response.

However, I still get the exception stated in my earlier mail below. The
exception occurs either on mouseOut or mouseOver tool tip handlers and the
trace leads all the way to ToolTipManagerImpl.reset() method.

Thanks & Regards
Ram

__________________________________________________________

rviswanathan wrote:
>
> Thanks Alex. Since the destroyToolTip is public and the doc says not to
> call it on the currentToolTip, I'd probably think that it is used when we
> explicitly create and destroy tooltips.
>
> About faking the mouse event that you have mentioned, are you meaning that
> I need to add my own tooltipmouseouthandler and put in my logic in this
> handler?
>
> Thanks
> Ram
>
>
>
> Alex Harui wrote:
>>
>> The doc says don't call destroyToolTIp on the current tooltip. I'd
>> search around to see if anyone else has a way of causing a tooltip to go
>> away, but I'd probably do it by faking a mouse event instead of calling
>> an mx_internal method.
>>
>> From: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com> 
>> [mailto:flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>] On
>> Behalf Of rviswanathan
>> Sent: Sunday, November 30, 2008 11:52 AM
>> To: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>
>> Subject: [flexcoders] NPE on ToolTipManagerImpl/reset()
>>
>>
>> Hi All
>>
>> I am facing an NPE with tooltips, the problem is outlined below.
>>
>> Set up: (I use Flex 2.0)
>> I have a UI where I have a datagrid that gets populated by data coming
>> from
>> a remote server call. My module contains a timer that sends out a refresh
>> request (server call) to paint the datagrid with the latest data. This
>> timer
>> fires every 20 seconds. Also, when I point to a datagrid cell, I see the
>> tooltip that shows the content of this cell.
>>
>> This is what I have done to disable and enable tooltips during the server
>> call.
>> a) Prior to makign the server call, I destroy the current tooltip using
>> ToolTipManager.destroyToolTip(). I also set the
>> ToolTipManager.currentToolTip to null. I also make ToolTipManager.enabled
>> as
>> false.
>> b) On getting a response from the server, I set ToolTipManager.enabled as
>> true.
>>
>> Now, here's the problem.
>> I keep my mouse on a cell and a tooltip is displayed. At some time T, the
>> 20
>> second timer fires that makes a server call. At this very same moment, I
>> move my mouse out of the cell, so the tooltip's mouseouthandler gets
>> called.
>>
>> I get an exception in ToolTipManagerImpl/reset() method. From the trace,
>> it
>> shows an NPE. This happens only when I move the mouse out of a tooltip
>> and a
>> refresh call to the server goes.
>>
>> The lines around getSystemManager(previousTarget) is where I think I hit
>> an
>> exception, probably because the system manager for the previousTarget is
>> null and the next line throws an NPE, although I am not a 100% sure.
>>
>> From ToolTipManagerImpl.reset() method
>>
>> private function reset():void
>> {
>> ....
>> ....
>> if (currentToolTip)
>> {
>> ....
>> ....
>>
>> // Remove it.
>> var sm:ISystemManager = getSystemManager(previousTarget);
>> sm.toolTipChildren.removeChild(DisplayObject(currentToolTip));
>> currentToolTip = null;
>>
>> ....
>> ....
>> }
>>
>> }
>>
>> Any pointers to overcome this would really help.
>>
>> Thanks
>> Ram
>>
>> --
>> View this message in context:
>> http://www.nabble.com/NPE-on-ToolTipManagerImpl-reset%28%29-tp20761439p20761439.html
>> Sent from the FlexCoders mailing list archive at Nabble.com.
>>
>>
>>
>
>

--
View this message in context: 
http://www.nabble.com/NPE-on-ToolTipManagerImpl-reset%28%29-tp20761439p21541940.html
Sent from the FlexCoders mailing list archive at Nabble.com.

Reply via email to