org.apache.wicket.extensions.ajax.markup.html
Class WicketAjaxIndicatorAppender

java.lang.Object
  extended by org.apache.wicket.behavior.AbstractBehavior
      extended by org.apache.wicket.extensions.ajax.markup.html.WicketAjaxIndicatorAppender
All Implemented Interfaces:
java.io.Serializable, IBehavior, IClusterable, IHeaderContributor

public class WicketAjaxIndicatorAppender
extends AbstractBehavior

A behavior that adds a span with wicket's default indicator gif to the end of the component's markup. This span can be used as an ajax busy indicator. For an example usage see IndicatingAjaxLink

Instances of this behavior must not be shared between components.

Since:
1.2
Author:
Igor Vaynberg (ivaynberg)
See Also:
IndicatingAjaxLink, IAjaxIndicatorAware, Serialized Form

Constructor Summary
WicketAjaxIndicatorAppender()
          Construct.
 
Method Summary
 void bind(Component component)
          Bind this handler to the given component.
protected  java.lang.CharSequence getIndicatorUrl()
           
 java.lang.String getMarkupId()
          Returns the markup id attribute of the outer most span of this indicator.
protected  java.lang.String getSpanClass()
           
 void onRendered(Component component)
          Called when a component that has this behavior coupled was rendered.
 void renderHead(IHeaderResponse response)
          Render to the web response whatever the component wants to contribute to the head section.
 
Methods inherited from class org.apache.wicket.behavior.AbstractBehavior
afterRender, beforeRender, cleanup, detach, detachModel, exception, getStatelessHint, isEnabled, isTemporary, onComponentTag, onException, rendered
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WicketAjaxIndicatorAppender

public WicketAjaxIndicatorAppender()
Construct.

Method Detail

renderHead

public void renderHead(IHeaderResponse response)
Description copied from interface: IHeaderContributor
Render to the web response whatever the component wants to contribute to the head section. TODO: Post 1.3, add component parameter, so that the behaviors dont' have to track component instances

Specified by:
renderHead in interface IHeaderContributor
Overrides:
renderHead in class AbstractBehavior
Parameters:
response - Response object
See Also:
AbstractBehavior.renderHead(IHeaderResponse)

onRendered

public void onRendered(Component component)
Description copied from class: AbstractBehavior
Called when a component that has this behavior coupled was rendered.

Overrides:
onRendered in class AbstractBehavior
Parameters:
component - the component that has this behavior coupled
See Also:
AbstractBehavior.onRendered(org.apache.wicket.Component)

getIndicatorUrl

protected java.lang.CharSequence getIndicatorUrl()
Returns:
url of the animated indicator image

getSpanClass

protected java.lang.String getSpanClass()
Returns:
css class name of the generated outer span

getMarkupId

public java.lang.String getMarkupId()
Returns the markup id attribute of the outer most span of this indicator. This is the id of the span that should be hidden or show to hide or show the indicator.

Returns:
markup id of outer most span

bind

public final void bind(Component component)
Description copied from interface: IBehavior
Bind this handler to the given component. This method is called by the host component immediately after this behavior is added to it. This method is useful if you need to do initialization based on the component it is attached and you can't wait to do it at render time. Keep in mind that if you decide to keep a reference to the host component, it is not thread safe anymore, and should thus only be used in situations where you do not reuse the behavior for multiple components.

Specified by:
bind in interface IBehavior
Overrides:
bind in class AbstractBehavior
Parameters:
component - the component to bind to
See Also:
AbstractBehavior.bind(org.apache.wicket.Component)


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.