Package org.apache.wicket.markup.head
Class OnLoadHeaderItem
- java.lang.Object
-
- org.apache.wicket.markup.head.HeaderItem
-
- org.apache.wicket.markup.head.AbstractCspHeaderItem
-
- org.apache.wicket.markup.head.OnLoadHeaderItem
-
- All Implemented Interfaces:
Serializable
,IClusterable
public class OnLoadHeaderItem extends AbstractCspHeaderItem
HeaderItem
for scripts that need to be executed after the entire page is loaded.- Author:
- papegaaij
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OnLoadHeaderItem()
Constructor.OnLoadHeaderItem(CharSequence javaScript)
Construct.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
static OnLoadHeaderItem
forScript(CharSequence javaScript)
Creates aOnLoadHeaderItem
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
-
OnLoadHeaderItem
public OnLoadHeaderItem()
Constructor. The JavaScript should be provided by overloaded #getJavaScript
-
OnLoadHeaderItem
public OnLoadHeaderItem(CharSequence javaScript)
Construct.- Parameters:
javaScript
-
-
-
Method Detail
-
forScript
public static OnLoadHeaderItem forScript(CharSequence javaScript)
Creates aOnLoadHeaderItem
for the script.- Parameters:
javaScript
- The script to execute on the load event.- Returns:
- A newly created
OnLoadHeaderItem
.
-
getJavaScript
public CharSequence getJavaScript()
- Returns:
- the script that gets executed after the entire is loaded.
-
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.
-
-