From Zimbra :: Wiki

Jump to: navigation, search

Rather allot needs to be writtenby those that understand the intents of the JS API


appears to be a way for anyone to register a global function that can then be run 'by name'


../ZmCalendarApp.js:   AjxDispatcher.registerMethod("GetCalController", "CalendarCore", new AjxCallback(this, this.getCalController));
Tasks_all.js:           var cc = AjxDispatcher.run("GetCalController");


AjxRpc or howto access a JSP

MainHelloView.prototype._updateHTML_JSP = 
function(to, body) {
	var url = this.helloWorldZimlet.getResource('hello_world.jsp');

	to = AjxStringUtil.urlEncode(to);
	body = AjxStringUtil.urlEncode(body);
	var reqParam = 'to=' + to + '&body=' + body;
	var reqHeader = {"Content-Type":"application/x-www-form-urlencoded"};

	AjxRpc.invoke(reqParam, url, reqHeader, new AjxCallback(this, this._updateHTMLCallback));
function(result) {
	var r = result.text;
	DBG.println(AjxDebug.DBG2, "result:" + r);
	this.getHtmlElement().innerHTML = r;

Verified Against: Date Created: 2008
Article ID: http://wiki.zimbra.com/index.php?title=ZimletJS Date Modified: 09/30/2008
Personal tools