jQuery 1.3.2 and Tapestry

This module allows you to use jQuery 1.3.2 in Tapestry 4 applications. It requires Tapestry version 4.1.6 and on, and completely replaces the dojo version (0.4.3) that's bundled by default.

Installing tacos-jquery

You first need to add this module to your classpath. Assuming you're using maven 2, this can be achieved by:

        <dependency>
            <groupId>net.sf.tacos</groupId>
            <artifactId>tacos-jquery</artifactId>
            <version>0.1.132-SNAPSHOT</version>           
        </dependency>

Notice that the last number in the version (132) represents the currently supported jquery version.

If maven has troubles downloading the module, then you'll probably have to define tacos snapshot repository, as described here.

Using tacos-jquery

What now remains is to configure your @Shell (or @ScriptIncludes) component to use service:tacos.jquery.JqueryOneShellDelegate. Here's what your page/component might include:

    <span jwcid="@Shell" title="..." ajaxDelegate="ognl:ajaxDelegate" ... />    

The .jwc or the java code should then use:

    <inject property="ajaxDelegate" object="service:tacos.jquery.JqueryOneShellDelegate"/>
or
    @InjectObject("service:tacos.jquery.JqueryOneShellDelegate")
    public abstract IRender getAjaxDelegate();

More details

The uncompressed version of jQuery 1.3.2 is included in this module. The exact files included are described in the following contribution:

    <contribution configuration-id="hivemind.FactoryDefaults">
        <default symbol="tacos.jquery.files" value="classpath:/tacos-jquery-js/jquery-1.3.2.js,classpath:/tacos-jquery-js/facebox/facebox.js,classpath:/tacos-jquery-js/autocomplete/jquery.autocomplete.js"/>
        <default symbol="tacos.jquery.tapestryFile" value="classpath:/tacos-jquery-js/tap-jquery1.2.1.js"/>
        <default symbol="tacos.jquery.tapestryFolder" value="classpath:/tacos-jquery-js/"/>
        <default symbol="tacos.jquery.cssFiles" value="classpath:/tacos-jquery-js/facebox/facebox.css,classpath:/tacos-jquery-js/autocomplete/jquery.autocomplete.css"/>
    </contribution>

So, if you want to use jquery from google's CDN (http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js) you can just do:

    <contribution configuration-id="hivemind.ApplicationDefaults">
        <default symbol="tacos.jquery.files" value="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js,classpath:/tacos-jquery-js/facebox/facebox.js,classpath:/tacos-jquery-js/autocomplete/jquery.autocomplete.js"/>
    </contribution>