If you are using the default animation, you could set a timer at the default time, 250ms, to know that animation had finished. However, the animation methods on FxElement are each overridden to accept an Fx instance, which provides the ability to listen to the animation being canceled or ending, as well as to cancel the animation outright.
Instead of the one line:
Code:
getElement().<FxElement>cast().slideOut( Style.Direction.UP );
Create an Fx instance first, configure it, and pass it in:
Code:
Fx fx = new Fx();
fx.addAfterAnimateHandler(new AfterAnimateHandler(){
public void onAfterAnimate(AfterAnimateEvent event) {
//handle after animation...
}
});
getElement().<FxElement>cast().slideOut(Style.Direction.UP, fx);