Package org.apache.wicket.ajax
Class AjaxOnDomReadyClientInfoBehavior
- java.lang.Object
-
- org.apache.wicket.behavior.Behavior
-
- org.apache.wicket.behavior.AbstractAjaxBehavior
-
- org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
-
- org.apache.wicket.ajax.AjaxOnDomReadyClientInfoBehavior
-
- All Implemented Interfaces:
Serializable
,IComponentAwareEventSink
,IRequestListener
,IComponentAwareHeaderContributor
,IClusterable
public class AjaxOnDomReadyClientInfoBehavior extends AbstractDefaultAjaxBehavior
A behavior that collects the information to populate WebClientInfo's ClientProperties by using Ajax. Compared toAjaxClientInfoBehavior
this class does not use a timer but the DOM ready "event" to collect browser info.
-
-
Field Summary
-
Fields inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
INDICATOR
-
-
Constructor Summary
Constructors Constructor Description AjaxOnDomReadyClientInfoBehavior()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected WebClientInfo
newWebClientInfo(RequestCycle requestCycle)
protected void
onClientInfo(AjaxRequestTarget target, WebClientInfo clientInfo)
A callback method invoked when the client info is collected.static AjaxOnDomReadyClientInfoBehavior
onClientInfo(org.danekja.java.util.function.serializable.SerializableBiConsumer<AjaxRequestTarget,WebClientInfo> onClientInfo)
Creates anAjaxOnDomReadyClientInfoBehavior
based on lambda expressionsvoid
renderHead(Component component, IHeaderResponse response)
Render to the web response whatever the component wants to contribute to the head section.protected void
respond(AjaxRequestTarget target)
protected void
updateAjaxAttributes(AjaxRequestAttributes attributes)
Gives a chance to the specializations to modify the attributes.-
Methods inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
findIndicatorId, getAttributes, getCallbackFunction, getCallbackFunctionBody, getCallbackScript, getCallbackScript, onBind, onMethodMismatch, onRequest, postprocessConfiguration, renderAjaxAttributes, renderAjaxAttributes
-
Methods inherited from class org.apache.wicket.behavior.AbstractAjaxBehavior
afterRender, bind, getCallbackUrl, getComponent, onComponentRendered, onComponentTag, onComponentTag, onUnbind, unbind
-
Methods inherited from class org.apache.wicket.behavior.Behavior
beforeRender, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onConfigure, onEvent, onException, onRemove, onTag
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.wicket.IRequestListener
rendersPage
-
-
-
-
Constructor Detail
-
AjaxOnDomReadyClientInfoBehavior
public AjaxOnDomReadyClientInfoBehavior()
-
-
Method Detail
-
respond
protected void respond(AjaxRequestTarget target)
- Specified by:
respond
in classAbstractDefaultAjaxBehavior
- Parameters:
target
- The AJAX target
-
newWebClientInfo
protected WebClientInfo newWebClientInfo(RequestCycle requestCycle)
-
onClientInfo
protected void onClientInfo(AjaxRequestTarget target, WebClientInfo clientInfo)
A callback method invoked when the client info is collected.- Parameters:
target
- The Ajax request handlerclientInfo
- The collected info for the client
-
updateAjaxAttributes
protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
Description copied from class:AbstractDefaultAjaxBehavior
Gives a chance to the specializations to modify the attributes.- Overrides:
updateAjaxAttributes
in classAbstractDefaultAjaxBehavior
-
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 classAbstractDefaultAjaxBehavior
- 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- See Also:
Behavior.renderHead(Component, org.apache.wicket.markup.head.IHeaderResponse)
-
onClientInfo
public static AjaxOnDomReadyClientInfoBehavior onClientInfo(org.danekja.java.util.function.serializable.SerializableBiConsumer<AjaxRequestTarget,WebClientInfo> onClientInfo)
Creates anAjaxOnDomReadyClientInfoBehavior
based on lambda expressions- Parameters:
onClientInfo
- theSerializableBiConsumer
which accepts theAjaxRequestTarget
and theWebClientInfo
- Returns:
- the
AjaxOnDomReadyClientInfoBehavior
-
-