Class JsQuery
- java.lang.Object
-
- org.apache.wicket.behavior.Behavior
-
- org.wicketstuff.wiquery.core.javascript.JsQuery
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.wicket.IComponentAwareEventSink,org.apache.wicket.markup.html.IComponentAwareHeaderContributor,org.apache.wicket.util.io.IClusterable
public class JsQuery extends org.apache.wicket.behavior.Behavior implements java.io.Serializable$Id: JsQuery.java 1721M 2012-01-17 17:43:37Z (local) $JsQueryis 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
IHeaderContributorinterface, 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"));- Since:
- 0.7
- Author:
- Lionel Armanet
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsStatement$()JsStatement$(java.lang.String selector)Same as$()but with a specified CSS selector.voidbind(org.apache.wicket.Component hostComponent)JsStatementdocument()JsStatementgetStatement()protected voidonBind()Called when the component was bound to it's host component.voidrenderHead(org.apache.wicket.Component component, org.apache.wicket.markup.head.IHeaderResponse response)voidrenderHead(org.apache.wicket.markup.head.IHeaderResponse response, org.apache.wicket.request.IRequestHandler requestHandler)FOR FRAMEWORK'S INTERNAL USE ONLYvoidsetStatement(JsStatement jsStatement)FOR FRAMEWORK'S INTERNAL USE ONLY
-
-
-
Method Detail
-
$
public JsStatement $()
- Returns:
- a new
JsStatementinitialized with the$statement.
-
$
public JsStatement $(java.lang.String selector)
Same as$()but with a specified CSS selector. If thisJsQueryis linked to a component, the resulting JavaScript code will be$("#yourComponentId cssSelector")- Parameters:
selector-
-
document
public JsStatement document()
- Returns:
- a new
JsStatementinitialized with thedocumentstatement.
-
renderHead
public void renderHead(org.apache.wicket.Component component, org.apache.wicket.markup.head.IHeaderResponse response)- Specified by:
renderHeadin interfaceorg.apache.wicket.markup.html.IComponentAwareHeaderContributor- Overrides:
renderHeadin classorg.apache.wicket.behavior.Behavior
-
bind
public final void bind(org.apache.wicket.Component hostComponent)
- Overrides:
bindin classorg.apache.wicket.behavior.Behavior
-
onBind
protected void onBind()
Called when the component was bound to it's host component. You can get the bound host component by calling getComponent.
-
getStatement
public JsStatement getStatement()
- Returns:
- the statement
-
setStatement
public void setStatement(JsStatement jsStatement)
FOR FRAMEWORK'S INTERNAL USE ONLY
-
renderHead
public void renderHead(org.apache.wicket.markup.head.IHeaderResponse response, org.apache.wicket.request.IRequestHandler requestHandler)FOR FRAMEWORK'S INTERNAL USE ONLY
-
-