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

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 08-25-2009, 01:45 PM
Active Member
 
Posts: 26
Default Failed to add a button to mail tool bar

The following function is called in the zimlet init function, but when create a new mail or open a mail, the new button doesn't show up. No exception reported from the browser, any help is greatly appreciated.

com_zimbra_scs.prototype._addButtons =
function()
{
// Add the Salesforce Button to the Compose Page
this._composerCtrl = AjxDispatcher.run("GetComposeController");
this._composerCtrl._scs = this;
if(!this._composerCtrl._toolbar)
{
this._composerCtrl._initializeToolBar();
}


this._toolbar = this._composerCtrl._toolbar;

// Add button to toolbar
ZmMsg.scsAdd = "Call";
ZmMsg.scsTooltip = "Call the sender.";
var op = {text: "scsAdd", tooltip: "scsTooltip", image: ""};
var opDesc = ZmOperation.defineOperation(null, op);
ZmOperation.addOperation(this._toolbar, opDesc.id, this._toolbar._buttons, 1);
this._toolbar.addSelectionListener(opDesc.id, new AjxListener(this._composerCtrl, this._CallSender));
}

com_zimbra_scs.prototype._CallSender= function(ev) {
var msg = this._composeView.getMsg();
this.msgDropped(msg);
};
Reply With Quote
  #2 (permalink)  
Old 08-26-2009, 12:52 AM
Trained Alumni
 
Posts: 127
Default

This is the code that is working for me

.prototype.init = function() {
var ID = "It_Seacom_MyZimletMail_COMPOSE_TOOLBAR_BUTTON ";
var composerCtrl = AjxDispatcher.run("GetComposeController");
if(!composerCtrl._toolbar)
{
// initialize the compose controller's toolbar
composerCtrl._initializeToolBar();
}
var toolbar = composerCtrl._toolbar;
// Add button to toolbar
if(!toolbar.getButton(ID))
{
ZmMsg.__It_Seacom_MyZimletMail = "MyZimlet";
ZmMsg.__It_Seacom_MyZimletMail_TT = "MyZimlet";
var op = {
id: ID,
textKey: "__It_Seacom_MyZimletMail",
text: ZmMsg.__It_Seacom_MyZimletMail,
tooltipKey: "__It_Seacom_MyZimletMail_TT",
tooltip: ZmMsg.__It_Seacom_MyZimletMail_TT,
image: "MyZimletmail-barIcon"
};
var opDesc = ZmOperation.defineOperation(null, op);
toolbar.addOp(ID, 5);
toolbar.addSelectionListener(ID, new AjxListener(this, this.uploadDialog));
}
};

pay attention that if you want to have the button in both composing windows (embedded and new browser window) you have to use two zimlet with different target.
__________________
http://www.seacom.it
Reply With Quote
  #3 (permalink)  
Old 08-26-2009, 06:38 AM
Active Member
 
Posts: 26
Default what 's new browser window scenario?

Which uses the new browser window? when open a mail or create a new mail?
Could you elaborate more on this? an example to deal with new window would be
great
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.