Skip to main content
Inspiring
July 28, 2014
Question

Dynamic toolTip while drag&drop object

  • July 28, 2014
  • 1 reply
  • 469 views

Hello,

I got this problem:

1. objectA in containerA and objectB in containerB

2. objectB has mouseOver listener, which shows toolTip with calculated number of objects in containerB

3. I move objectA to containerB with drag&drop. Now I have two situations depending on when I release objectA from drag:

3a. While having objectA under mouse cursor (it's still during drag operation) I move mouse over objectB and after a while I see toolTip showing "1 object".

I drop objectA and I programatically change the "ToolTipManager.currentToolTip.text" property to show "2 objects". And it works fine.

3b. While having objectA under mouse cursor (it's still during drag operation) I move mouse over objectB and drop objectA at once. The toolTip doesn't have time to show anything. But after a while (I still have mouse over objectB) I see toolTip showing "1 object". I have to move the mouse out and over again to see "2 objects".

Situation in 3b occurs because when I move objectA over objectB it catches mouseOver event and prepares text with "1 object". But this time during drop operation I cannot change the "ToolTipManager.currentToolTip.text" property because when I drop the item there is no toolTip to edit, "ToolTipManager.currentToolTip = null".

And since the mouse is still over the objectB it's still going to show "1 object" which was prepared earlier.

I've tried to use bindable variable as toolTip text in step 2. but it doesn't work. 

So I have no more ideas how to force the text change in situation 3b. Any help would be appreaciated

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
July 28, 2014

update your text immediately when an object is dropped

IbarimAuthor
Inspiring
July 29, 2014

Thanks kglad,

I can't update text because there is no toolTip to update at the time of dropping the object.

kglad
Community Expert
Community Expert
July 29, 2014

then use a variable to store the what you want to display.