Package org.apache.wicket.markup.head
Class OnDomReadyHeaderItem
- java.lang.Object
-
- org.apache.wicket.markup.head.HeaderItem
-
- org.apache.wicket.markup.head.AbstractCspHeaderItem
-
- org.apache.wicket.markup.head.OnDomReadyHeaderItem
-
- All Implemented Interfaces:
Serializable
,IClusterable
public class OnDomReadyHeaderItem extends AbstractCspHeaderItem
HeaderItem
for scripts that need to be executed directly after the DOM has been built, but before external resources, such as images, are loaded.- Author:
- papegaaij
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OnDomReadyHeaderItem()
Constructor.OnDomReadyHeaderItem(CharSequence javaScript)
Construct.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
static OnDomReadyHeaderItem
forScript(CharSequence javaScript)
Creates aOnDomReadyHeaderItem
for the script.List<HeaderItem>
getDependencies()
CharSequence
getJavaScript()
Iterable<?>
getRenderTokens()
int
hashCode()
void
render(Response response)
Renders theHeaderItem
to the response.String
toString()
-
Methods inherited from class org.apache.wicket.markup.head.AbstractCspHeaderItem
getNonce, setNonce
-
Methods inherited from class org.apache.wicket.markup.head.HeaderItem
getProvidedResources
-
-
-
-
Constructor Detail
-
OnDomReadyHeaderItem
public OnDomReadyHeaderItem()
Constructor. The JavaScript should be provided by overloaded #getJavaScript
-
OnDomReadyHeaderItem
public OnDomReadyHeaderItem(CharSequence javaScript)
Construct.- Parameters:
javaScript
-
-
-
Method Detail
-
forScript
public static OnDomReadyHeaderItem forScript(CharSequence javaScript)
Creates aOnDomReadyHeaderItem
for the script.- Parameters:
javaScript
- The script to execute on the DOM ready event.- Returns:
- A newly created
OnDomReadyHeaderItem
.
-
getJavaScript
public CharSequence getJavaScript()
- Returns:
- the script that gets executed on the DOM ready event.
-
render
public void render(Response response)
Description copied from class:HeaderItem
Renders theHeaderItem
to the response.- Specified by:
render
in classHeaderItem
-
getRenderTokens
public Iterable<?> getRenderTokens()
- Specified by:
getRenderTokens
in classHeaderItem
- Returns:
- The tokens this
HeaderItem
can be identified by. If any of the tokens has already been rendered, thisHeaderItem
will not be rendered.
-
getDependencies
public List<HeaderItem> getDependencies()
- Overrides:
getDependencies
in classHeaderItem
- Returns:
- The dependencies this
HeaderItem
has. Dependencies will always be rendered before the item itself.
-
-