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