public class JsQuery extends Object implements Serializable, org.apache.wicket.markup.html.IHeaderContributor
JsQuery is the main entry point of WickeXt's JavaScript integration.
This class is used to link JavaScript to a component and to render it.
This class implements the IHeaderContributor interface, so if you
want to append the generated JavaScript, just do this:
JsQuery jsq = new JsQuery(myComponent);
jsq.$().chain("css", "border", "1px solid red");
myComponent.add(new HeaderContributor(jsq));
If you want to generate a statement concerning a component, do it as below:
new JsQuery(yourComponent).$().chain("css", "border", "1px solid red"));
| Constructor and Description |
|---|
JsQuery()
Creates a new
JsQuery. |
JsQuery(org.apache.wicket.Component component)
Creates a new
JsQuery linked to a Component. |
| Modifier and Type | Method and Description |
|---|---|
JsStatement |
$() |
JsStatement |
$(String selector)
Same as
$() but with a specified CSS selector. |
void |
contribute(org.apache.wicket.Component component)
Adds this statement as a
HeaderContributor for the given
component. |
JsStatement |
document() |
JsStatement |
getStatement() |
void |
renderHead(org.apache.wicket.markup.html.IHeaderResponse response) |
void |
renderHead(org.apache.wicket.markup.html.IHeaderResponse response,
org.apache.wicket.IRequestTarget requestTarget)
FOR FRAMEWORK'S INTERNAL USE ONLY
|
void |
setStatement(JsStatement jsStatement)
FOR FRAMEWORK'S INTERNAL USE ONLY
|
public JsQuery(org.apache.wicket.Component component)
JsQuery linked to a Component.public JsQuery()
JsQuery.public JsStatement $()
JsStatement initialized with the $
statement.public JsStatement $(String selector)
$() but with a specified CSS selector. If this
JsQuery is linked to a component, the resulting JavaScript code
will be
$("#yourComponentId cssSelector")
selector - public JsStatement document()
JsStatement initialized with the
document statement.public void renderHead(org.apache.wicket.markup.html.IHeaderResponse response)
renderHead in interface org.apache.wicket.markup.html.IHeaderContributorIHeaderContributor.renderHead(org.apache.wicket.markup.html.IHeaderResponse)public void contribute(org.apache.wicket.Component component)
HeaderContributor for the given
component.public JsStatement getStatement()
public void setStatement(JsStatement jsStatement)
public void renderHead(org.apache.wicket.markup.html.IHeaderResponse response,
org.apache.wicket.IRequestTarget requestTarget)
Copyright © 2009-2012. All Rights Reserved.