title: Having trouble integrating Spring Roo with JQuery
body: <p>I've got a Roo generated webapp that I'm trying to put JQuery into (I know Roo uses Dojo but I figured I would try to get JQuery to work since I'm a bit more familiar with that). </p>
  
  <p><strong>Things I got working</strong></p>
  
  <p>I got a custom version of JQuery-UI from the theme builder, copied the scripts (base and ui js files) and CSS files into my app. I then copied the sample 'index.html' file that you also get which shows some of the widgets.</p>
  
  <p>That all worked fine.</p>
  
  <p><strong>Things that don't work (JQuery-UI)</strong></p>
  
  <p>My problems start when I try to integrate it into my own pages. I import all three files through various methods (using the ones I downloaded and also gave the online CDN (google-apis) a go). I also added the JQuery.noConflict() just to be sure it would co-exist with Dojo. </p>
  
  <p>This works (the basic stuff)</p>
  
  <pre><code>$(document).ready(function($) { 
      alert('JQuery is working'); 
  });
  </code></pre>
  
  <p>...but when I try anything with JQuery-UI, I am getting nowhere. For example, </p>
  
  <pre><code>$("#accordion").accordion({ header: "h3" });
  </code></pre>
  
  <p>I get this in Firefox (and a similar error in Chrome)</p>
  
  <pre><code>Error: $("#accordion").accordion is not a function
  </code></pre>
  
  <p>I've checked the view-source to see which URL it's using for each three scripts, and pasted each one back into my browser to check that they are correct and e.g. not being blocked by Spring-security or anything else. All fine. </p>
  
  <p>I've also tried making my own layout (with tiles) which completely bypasses any Dojo stuff that Roo might have added, still get the same error. </p>
  
  <p>Also tried copying the JS/CSS files under /src/main/resources/META-INF and just directly under the webapp folder (where the images are) and adjusted the URLs accordingly. </p>
  
  <p>I can only guess that it's something to do with my pages being composed of tiles, and that's preventing the JQuery-UI script from being loaded, and therefore it can't find the accordion function (or any others for that matter). </p>
  
  <p>I noticed in the source, that the accordion function has a 'depends' clause which lists the core and widget js files. Do I need to manually get these from somewhere too? (I noticed they are in the developer-bundle but the index.html file I mentioned works without explicitly 'importing' these...</p>
  
  <p>I've been really impressed with Roo so far, it has saved me so much time (especially for the backend Java stuff). And from the way it's designed I know that JQuery is possible (all the Dojo code is neatly put into the tagx files so easy to swap out), plus, I can see other people have got it working. So it's just something I'm doing wrong, but I can't quite figure out what it is.</p>
  
  <p>If anyone can help, would really appreciate it, thanks!</p>