Reputation: 2712
I am new to Vaadin and GWT but i'm an advanced javascript Programmer. Now im working on a Vaadin existing Project and want to use the great possibilities of jQuery into my Project... how can i add GWTQuery into an existing Vaadin Project?
Upvotes: 0
Views: 670
Reputation: 16263
Same as you would for any other GWT project:
WEB-INF/lib
, as it is not required during runtime).Add a corresponding entry in the module xml:
<inherits name="com.google.gwt.query.Query" />
Be sure to run the GWT compiler before running in production mode.
Further Reading:
Organizing Projects on the Google Developers' GWT docs.
Upvotes: 1
Reputation: 9741
1.- If you are using maven add these lines to your pom.xml
:
<dependency>
<groupId>com.googlecode.gwtquery</groupId>
<artifactId>gwtquery</artifactId>
<version>1.2.0</version>
<scope>provided</scope>
</dependency>
Otherwise download gwtquery-1.2.0.jar from the project site and include it in your classpath
2.- Add this line to your_application.gwt.xml
file:
<inherits name='com.google.gwt.query.Query'/>
3.- Import statically methods from the GQuery
class
import static com.google.gwt.query.client.GQuery.*;
4.- Use it to enhance your dom or widgets
$("css_selector").css("width", "100%");
$("css_selector", my_widget).hide();
5.- Be aware that you cannot use jquery plugins, but you can use the core api of jquery (with some differences). There are many gquery plugins though.
Upvotes: 1