code: public static void slideUpAndDown(final Component component, final AjaxRequestTarget target, 
  		int slideUpDuration, int slideDownDuration)
  	{
  		component.add(new DisplayNoneBehavior());
  		target.prependJavaScript("notify|jQuery('#" + component.getMarkupId() + "').slideUp("
  			+ slideUpDuration + ", notify);");
  		target.add(component);
  		target.appendJavaScript(
  			"jQuery('#" + component.getMarkupId() + "').slideDown(" + slideDownDuration + ");");
  	}
docs: Replace the given component with animation.
  
  @param target
  the target
  @param component
  the component
  @param slideUpDuration
  the slide up duration
  @param slideDownDuration
  the slide down duration