Class AjaxIndicatorAppender
- java.lang.Object
-
- org.apache.wicket.behavior.Behavior
-
- org.apache.wicket.extensions.ajax.markup.html.AjaxIndicatorAppender
-
- All Implemented Interfaces:
Serializable
,IComponentAwareEventSink
,IComponentAwareHeaderContributor
,IClusterable
public class AjaxIndicatorAppender extends Behavior
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 seeIndicatingAjaxLink
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
Constructors Constructor Description AjaxIndicatorAppender()
Construct.AjaxIndicatorAppender(ResourceReference indicator)
Build a new instance specifying a custom busy indicator asResourceReference
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterRender(Component component)
Called when a component that has this behavior coupled was rendered.void
bind(Component component)
Bind this handler to the given component.protected CharSequence
getIndicatorUrl()
String
getMarkupId()
Returns the markup id attribute of the outer most span of this indicator.protected String
getSpanClass()
void
renderHead(Component component, 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.Behavior
beforeRender, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onComponentTag, onConfigure, onEvent, onException, onRemove, onTag, unbind
-
-
-
-
Constructor Detail
-
AjaxIndicatorAppender
public AjaxIndicatorAppender()
Construct.
-
AjaxIndicatorAppender
public AjaxIndicatorAppender(ResourceReference indicator)
Build a new instance specifying a custom busy indicator asResourceReference
.- Parameters:
indicator
- TheResourceReference
to use as busy indicator.
-
-
Method Detail
-
renderHead
public void renderHead(Component component, IHeaderResponse response)
Description copied from class:Behavior
Render to the web response whatever the component wants to contribute to the head section.- Specified by:
renderHead
in interfaceIComponentAwareHeaderContributor
- Overrides:
renderHead
in classBehavior
- Parameters:
component
- component which is contributing to the response. This parameter is here to give the component as the context for component-awares implementing this interfaceresponse
- Response object
-
afterRender
public void afterRender(Component component)
Description copied from class:Behavior
Called when a component that has this behavior coupled was rendered.- Overrides:
afterRender
in classBehavior
- Parameters:
component
- the component that has this behavior coupled
-
getIndicatorUrl
protected CharSequence getIndicatorUrl()
- Returns:
- url of the animated indicator image
-
getSpanClass
protected String getSpanClass()
- Returns:
- css class name of the generated outer span
-
getMarkupId
public 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 class:Behavior
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.
-
-