[Animator] cancelAll() doesn't work

Hi,

I set a AnimatorProxy as below:


animeProxy.animate(myWindow, AnimType.FADE_OUT_REMOVE).setDelay(5000).setDuration(1000);

And I added a button and want to stop/cancel animeProxy exection by:


animeProxy.cancelAll();

When myWindow shows up, I click button immediately (within 5000 ms), but it doesn’t work, myWindow is still faded out.
How can I stop/cancel it?

Appreciated for any advices!

Hi!

The animation request is already sent to the client in the same request when the window is drawn, and it can’t be canceled then anymore from the server (clicking the button will trigger a server request).

What you need, is a way to cancel the animation request in the client (animatorProxy.cancelAll() works on the server side). One solution would be that I add some additional functionality to my
Snappy add-on
, which would allow you to trigger actions on the client side.

Today is CommunityFriday, and I’m thinking of porting Animator to Vaadin 7, so I might as well tinker a bit with Snappy as well. Tell me if this would work for your needs!

I just realized that in order for me to make Snappy and Animator work together, I would have to introduce dependencies between the two, and that seems like a bad choice. I’ll have to think this a bit more if there are any better solutions…

Jouni,

Thank you~
I look forward to this feature!

Hi,

I actually made a patch for this, and the new versions in the Directory actually try to cancel all pending animations when you call cancelAll (not just on the server side). So please, give it a try and see if it works for your case.

Hi Jouni,
I am porting Notifique to Vaadin 7 which depends on Animator add-on. I assume I will need to use Vaadin 7 version of Animator add-on but this one does not seem to have Animator class itself. Is that removed? Any idea what should I be doing in my case to port Notifique to Vaadin 7?

thanks

Hi,

I think I might have left it out on purpose, but if it’s needed to port Notifique, I guess I could bring it back.

Another option is to modify Notifique to use the AnimatorProxy component, which should be able to the same things as the older Animator component.

Hi Jouni,
I need to convert Notifique to Vaadin 7 beta 10. The current Animator does not work with beta 10 so I converted it using LegacyConnector/Component APIs. But Notifique is using Animator class which is removed from new converted Animator. So I tried to use AnimatorProxy with Notifique but many assumptions/APIs in Notifique are used from Animator class. Can you help me convert Notifique using AnimatorProxy?