Tapestry

Tapestry5 jQuery provides jQuery Components and can fully replace Prototype and Scriptaculous by jQuery

Mecanisms provided by Tapestry5/jQuery

Which JavaSript files are loaded in my Application ?

After including Tapestry5-jQuery into your project, some JavaScript files will automatically be loaded :

  • jquery.js
  • jquery.ui.core.js
  • jquery.ui.position.js
  • jquery.ui.widget.js
  • jquery.effects.core.js
  • jquery.json-2.2.js

By default, the default JavaScript stack, using Prototype and Script.aculo.us, will be replaced by this jQuery Stack. Howerver you can still integrate it by setting the JQuerySymbolConstants.SUPPRESS_PROTOTYPE to false in your AppModule. Tapestry5-jQuery will manage everything, in order to avoid some conflicts between both JavaScript Libraries (by using jQuery.noConflict())

According to the PRODUCTION_MODE value, Tapestry5-jQuery will include the minified or the unminified version of tapestry.js. If you redefine the jQuery main file (JQuerySymbolConstants.JQUERY_CORE_PATH symbol) , you have to keep the file structure of the jQuery project : The minified version has to be in the package as the unminified one, but has to be suffixed by .min.js.

  • Example : jquery.min.js for jquery.js

The @ImportJQueryUI annotation

If you need more jQuery-UI Javascript files (jquery.ui.mouse.js, jquery.ui.sortable.js ...), you can use the @ImportJQueryUI annotation. All jQuery files are available in Tapestry5-jQuery by default. You just need to specify the name of the file, without the extension (.js). Tapestry5-jQuery will import the unminified version if your are in development mode, otherwise the minified version.

According to the PRODUCTION_MODE value, Tapestry5-jQuery will include the minified or the unminified version of your jQuery UI JavaScript files, even for the files coming from the main JavaScript Stack (see previous part : jquery.ui.core, jquery.ui.position). If you redefine the jQuery-UI package (JQuerySymbolConstants.JQUERY_UI_PATH symbol), you have to keep the file structure of the jQuery UI project : All the minified versions will be in a minified directory, and will be suffixed by .min.js.

  • Example : minified/jquery.ui.slider.min.js for jquery.ui.slider.js