rem: var Handler = function(model, view, deferred) { 
add: var Handler = function(model, view, deferred, xslParameters) { 
context: Freja.View.prototype.render = function(model, placeholder, xslParameters) {	if (typeof(placeholder) == "undefined") placeholder = this.placeholder;	var Handler = function(model, view, deferred) {		this.model = model;		this.view = view;		this.deferred = deferred;	};	Handler.prototype.trigger = function() {			try {			if (!this.view.ready) {				Freja._aux.connect(this.view, "onload", Freja._aux.bind(this.trigger, this));				return;			}			if (typeof(this.model) == "object" && this.model instanceof Freja.Model && !this.model.ready) {				Freja._aux.connect(this.model, "onload", Freja._aux.bind(this.trigger, this));				return;			}			var model;			if (typeof(this.model) == "undefined") {				// supply dummy				model = { document : Freja._aux.loadXML("<?xml version='1.0' ?><dummy/>")};			} else if (this.model instanceof Freja.Model) {				model = this.model;			} else {				// wrap pojo's in				model = { document : Freja._aux.loadXML("<?xml version='1.0' ?>\n" + Freja._aux.xmlize(this.model, "item")) };			}			var trans = this.view._renderer.transform(model, this.view, xslParameters);			trans.addCallback(Freja._aux.bind(function(html) {				this._destination.innerHTML = html;			}, this.view));			trans.addCallback(Freja._aux.bind(function() {				Freja._aux.signal(this, "onrendercomplete", this._destination)			}, this.view));			//trans.addCallback(this.deferred.callback);			trans.addErrback(this.deferred.errback);		} catch (ex) {			this.deferred.errback(ex);		}	};	var d = Freja._aux.createDeferred();	try {		this._destination = Freja._aux.getElement(placeholder);		// @todo    Is this a good idea ?		// Perhaps we should leave it to the programmer to do this.		this._destination.innerHTML = Freja.AssetManager.THROBBER_HTML;		var h = new Handler(model, this, d);		h.trigger();	} catch (ex) {		d.errback(ex);	}	return d;};
meta: 8607	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8607/fabbb424c0ae9e6cb6b64646189e14059534c886/Freja.js/clean/trunk/lib/Freja.js