This documentation is for an old version of fiftyfive-wicket (2.0.9).

Class DomReadyTemplate

  extended by org.apache.wicket.behavior.AbstractBehavior
      extended by fiftyfive.wicket.js.AbstractJavaScriptContribution
          extended by fiftyfive.wicket.js.DomReadyTemplate
All Implemented Interfaces:
Serializable, IBehavior, IComponentConfigurationBehavior, IClusterable, IHeaderContributor
Direct Known Subclasses:

public class DomReadyTemplate
extends AbstractJavaScriptContribution

Injects DOM-ready Javascript into the <head> using the interpolated contents of a separate JavaScript template. The code in the associated JavaScript file will run when the page loads, and also every time the component to which it is attached is repainted via Wicket ajax.

This behavior will cause jQuery to be added to the <head> if it is not there already. Your script can rely on the jQuery object being available.

Internally Wicket's PropertyVariableInterpolator is used to perform substitutions in the template using the ${propertyExpression} syntax. Two keys are available for you to use in your templates:

DomReadyTemplate is ideal for rich Wicket components that are tightly integrated with associated JavaScript or have complex JavaScript initialization code.

Other benefits: