Reputation: 267059
Is it possible to use jquery plugins within google web toolkit?
There are a lot of excellent plugins available for various UI widgets, such as date/time pickers, searchable dropdowns, etc. In many cases these plugins also come with their own css styles. I'd like to be able to use these plugins and get their values in my gwt application.
Upvotes: 3
Views: 3364
Reputation: 8548
Yes .. you can use Javascript libs in GWT project. Simply import it's lib in your html file or GWT.xml. In your module.xml file as below..
<module rename-to='TestingProject'>
<inherits name='com.google.gwt.user.User'/>
<entry-point class='test.Gwt.testingSample.client.TestingProjectEntry'/>
<inherits name="com.google.gwt.user.theme.standard.Standard" />
<source path='client'/>
<source path='shared'/>
<script src="/js/jquery-1.10.min.js"></script>
</module>
And test in your HTML file..
<body>
<center>
<div id= "start"></div>
</center>
<script type="text/javascript">
$(document).ready(function(){
$("div#start").html("<font color = 'green' font-weight = 'bold' size = '12'>
Hello World !</font>");
});
</script>
<body>
Have a useful for you... !
Upvotes: 2
Reputation: 7255
From experience you have two options.
http://code.google.com/p/gwtquery/
http://code.google.com/p/gwtquery-plugins/
JSNI Documentation
http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html
IMHO it is best to stick with GwtQuery as the jquery functions are almost verbatim usable in GwtQuery and you get the added performance boost of having the code compiled and optimized by the gwt compiler.
Upvotes: 2