Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-04-2008, 06:30 PM
Active Member
 
Posts: 29
Default AjxRpc callback changes?

Did anything change between 4.5.5 and 5.0.2 in how AjxRpc callbacks are done? I'm using the code below, but the callback never fires. I verified with Firebug that the server is returning data (just plain text). Ideas?

Code:
Com_Zimbra_Phone._doCallTo = function(phone) {
	var stURL = 'http://asterisk.domain.com/user/c2c.php?dst=' + encodeURIComponent(phone) + '&ai=' + AjxCookie.getCookie(document,'authinfo');
	var url = ZmZimletBase.PROXY + escape(stURL);
	if (confirm('Are you sure you want to call ' + phone + '?')) {
		AjxRpc.invoke(null, url, null, new AjxCallback(this, this._doCallToCallback), true);
	}
}

Com_Zimbra_Phone._doCallToCallback = function(response) {
	alert(response.text);
}
Reply With Quote
  #2 (permalink)  
Old 02-06-2008, 02:51 PM
Zimbra Employee
 
Posts: 52
Default

Quote:
Originally Posted by code0 View Post
Did anything change between 4.5.5 and 5.0.2 in how AjxRpc callbacks are done? I'm using the code below, but the callback never fires. I verified with Firebug that the server is returning data (just plain text). Ideas?

Code:
Com_Zimbra_Phone._doCallTo = function(phone) {
	var stURL = 'http://asterisk.domain.com/user/c2c.php?dst=' + encodeURIComponent(phone) + '&ai=' + AjxCookie.getCookie(document,'authinfo');
	var url = ZmZimletBase.PROXY + escape(stURL);
	if (confirm('Are you sure you want to call ' + phone + '?')) {
		AjxRpc.invoke(null, url, null, new AjxCallback(this, this._doCallToCallback), true);
	}
}

Com_Zimbra_Phone._doCallToCallback = function(response) {
	alert(response.text);
}
AjxRpc.invoke hasn't changed. The problem is that you're creating a callback with an object context, but your function is static. You should either make your class concrete, using a prototype so that there's a "this", or change your callback to:

new AjxCallback(null, Com_Zimbra_Phone._doCallToCallback)
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.