I'm having problems getting jquery operational without suppressing prototype.

If I do not supress prototype then jquery components are unresponsive, I 
thought I could use both libraries at the same time?

If I suppress prototype then components with action links and submits become 
unresponsive, see below issues:

Uncaught ReferenceError: Class is not defined ZoneUpdater.js:5
(anonymous function) ZoneUpdater.js:5
Uncaught ReferenceError: ZoneUpdater is not defined
(anonymous function)
T5.extendInitializers.evalScript tapestry-jquery.js:210
(anonymous function) tapestry-jquery.js:37
jQuery.extend.each jquery-1.7.2.js:660
(anonymous function) tapestry-jquery.js:31
jQuery.extend.each jquery-1.7.2.js:654
$.extend.init tapestry-jquery.js:21
(anonymous function) tapestry-jquery.js:1073
jQuery.extend.each jquery-1.7.2.js:660
jQuery.fn.jQuery.each jquery-1.7.2.js:271
$.tapestry.utils.executeInits tapestry-jquery.js:1071
(anonymous function) tapestry-jquery.js:1050
script.onload.script.onreadystatechange tapestry-jquery.js:972

--------------------------------------------------------------------------------------------

// A class that updates a zone on any client-side event.
// Based on http://tinybits.blogspot.com/2010/03/new-and-better-zoneupdater.html
// and some help from Inge Solvoll.

ZoneUpdater = Class.create( {

    initialize : function(spec) {
        this.element = $(spec.elementId);
        this.listenerURI = spec.listenerURI;
        $(this.element).getStorage().zoneId = spec.zoneId;
  
        if (spec.clientEvent) {
            this.clientEvent = spec.clientEvent;
            this.element.observe(this.clientEvent, 
this.updateZone.bindAsEventListener(this));
        }
    },
 
    updateZone : function() {
        var zoneManager = Tapestry.findZoneManager(this.element);
  
        if (!zoneManager) {
            return;
        }

        var listenerURIWithValue = this.listenerURI;
  
        if (this.element.value) {
            var param = this.element.value;
            if (param) {
                listenerURIWithValue = 
addQueryStringParameter(listenerURIWithValue, 'param', param);
            }
        }
  
        zoneManager.updateFromURL(listenerURIWithValue);
    }
 
} )

function addQueryStringParameter(url, name, value) {
    if (url.indexOf('?') < 0) {
        url += '?'
    } else {
        url += '&';
    }
    value = escape(value);
    url += name + '=' + value;
    return url;
}

Reply via email to