A {@link JsStatement} defines a whole executable JavaScript statement. The generatoreases "jQuery oriented" code, but you can still use another JavaScript coding style with the {@link #append(CharSequence)} method.
To get a valid instance and to ease JavaScript and Wicket integration, you should use the {@link JsQuery} class (example below). This class will initialize a{@link JsStatement} and contribute to a {@link WebPage}.
The JavaScript generating by a JsStatement is jQuery oriented. Example of generated string:
$(".aClassName").each(function() {alert('foo');});
To generate the script above, you can write this:
new JsQuery().$().each(JsScope.quickScope("alert('foo')"));
Any {@link JsStatement} should be returned by a {@link JsQuery} within the$
methods.
|
|
|
|