public class AbstractJQueryBehavior<ConfigType> extends CompositeBehavior
isPageAllowed()
. By default, the behavior may be attached to
pages. Behaviors that should not be allowed to be attached to pages should
override this method.
The second parameter is obtained through a call to
getConfigurationJavascript()
.
Constructor and Description |
---|
AbstractJQueryBehavior(String aFunction,
org.apache.wicket.behavior.IBehavior... aBehaviors)
Constructs the behavior.
|
Modifier and Type | Method and Description |
---|---|
void |
bind(org.apache.wicket.Component aComponent) |
protected String |
getConfigurationJavascript()
Returns a javascript object that is passed as second argument to the
ready function.
|
protected ConfigType |
getConfigurationObject()
Gets the configuration object to use.
|
protected flexjson.JSONSerializer |
getCustomSerializer()
Returns the serializer to use.
|
protected boolean |
isPageAllowed()
Determines whether the behavior is allowed to be attached toa page.
|
void |
renderHead(org.apache.wicket.markup.html.IHeaderResponse aResponse) |
add, afterRender, beforeRender, detach, exception, getStatelessHint, isEnabled, isTemporary, onComponentTag
public AbstractJQueryBehavior(String aFunction, org.apache.wicket.behavior.IBehavior... aBehaviors)
aFunction
- Function to be invoked from the ready handler. This function
is invoked with a CSS selector that identifies the component.aBehaviors
- Behaviors to add in addition to the basic JQuery stuff.protected boolean isPageAllowed()
public void bind(org.apache.wicket.Component aComponent)
bind
in interface org.apache.wicket.behavior.IBehavior
bind
in class CompositeBehavior
public void renderHead(org.apache.wicket.markup.html.IHeaderResponse aResponse)
renderHead
in interface org.apache.wicket.markup.html.IHeaderContributor
renderHead
in class CompositeBehavior
protected String getConfigurationJavascript()
getConfigurationObject()
to
obtain the configuration object to use which is then serialized to
javascript using JSONSerializer
. Subclasses can override the
default JSONSerializer by implementing getCustomSerializer()
.
Subclasses should override this method to perform custom serialization.
protected flexjson.JSONSerializer getCustomSerializer()
protected ConfigType getConfigurationObject()
Copyright © 2022. All rights reserved.