Results 1 to 3 of 3

Thread: Failed to add a button to mail tool bar

  1. #1
    Join Date
    Aug 2009
    Posts
    26
    Rep Power
    6

    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);
    };

  2. #2
    Join Date
    Jul 2006
    Location
    Pisa
    Posts
    135
    Rep Power
    9

    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.

  3. #3
    Join Date
    Aug 2009
    Posts
    26
    Rep Power
    6

    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

Similar Threads

  1. Problems with port 25
    By yogiman in forum Installation
    Replies: 57
    Last Post: 06-13-2011, 01:55 PM
  2. Replies: 30
    Last Post: 01-13-2009, 07:00 AM
  3. [SOLVED] Zimbra don't work - zmmailboxd
    By dmalherbe in forum Administrators
    Replies: 10
    Last Post: 11-20-2008, 09:05 AM
  4. fatal: Queue report unavailable - mail system is down
    By zzzzsg in forum Administrators
    Replies: 16
    Last Post: 08-24-2006, 02:31 AM
  5. receiveing mail
    By maybethistime in forum Administrators
    Replies: 15
    Last Post: 12-09-2005, 03:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •