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: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of 
rviswanathan
Sent: Sunday, November 30, 2008 11:52 AM
To: [email protected]
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.

Reply via email to