Results 1 to 4 of 4

Thread: New Compose Window Menu Item

  1. #1
    Join Date
    Feb 2009
    Location
    Kamloops BC Canada.
    Posts
    9
    Rep Power
    6

    Default New Compose Window Menu Item

    Hello. I am working on a zimlet that requires me to add another menu item to the compose window. I have the following code which works famously well:

    blah.blah.blah..prototype.initializeToolbar =
    function(app,toolbar,composeController,viewID)
    {
    if (viewID.indexOf("COMPOSE") == 0) {
    var buttonIndex = 0;
    if (this.isInit != 0)
    return;
    this.isInit++;
    var buttonParams = {
    text: "My Blah",
    tooltip: "Blah Blah",
    index: buttonIndex,
    image: "zimbraicon"
    };

    // creates the button with an id and params containing the button details
    var button = toolbar.createOp("Blah Blah Blah", buttonParams);
    button.addSelectionListener(new AjxListener(this, this.popDialog, composeController));
    }

    As I said, this all works great UNLESS you compose your email in a new window. If you do that, it turns out initializeToolbar is actually never called. I looked in the code and the culprit seems to be here : (taken from ZmComposeController.js)

    if (params.inNewWindow) {
    var msgId = params.msg ? params.msg.nId : (this._msg ? this._msg.nId : Dwt.getNextId());
    var newWinObj = ac.getNewWindow(false, ZmComposeController.NEW_WINDOW_WIDTH, ZmComposeController.NEW_WINDOW_HEIGHT, ZmId.VIEW_COMPOSE + "_" + msgId);

    // this is how child window knows what to do once loading:
    newWinObj.command = "compose";
    newWinObj.params = params;
    if (newWinObj.win) {
    newWinObj.win.focus();
    }
    The new window object never really asks anybody if there are changes to the menu bar.
    So my questions is, has anyone been able to figure out a way to add a menu bar to a new compose window?

    I am using Zimbra version 7.2.0

  2. #2
    Join Date
    May 2013
    Location
    California
    Posts
    27
    Rep Power
    2

    Default

    You've probably solved this or given up by now, but I'm having the same issue. Also, onShowView() isn't called when the new compose window is opened (Zimbra 8). Anyone have an idea?

  3. #3
    Join Date
    Feb 2009
    Location
    Kamloops BC Canada.
    Posts
    9
    Rep Power
    6

    Default Given up

    Yah, I gave up. I did a serious look at the original source code and saw why there was no response. It would take some work in the core to add that call in and it's low priority I guess. Kind of annoying though that there is promotion of being able to add a menu button, but only 85% of the time. Luckily, it wasn't a show stopper for us with regards to the zimlet I wrote.

  4. #4
    Join Date
    May 2013
    Location
    California
    Posts
    27
    Rep Power
    2

    Default

    Thanks for the reply. Looks like I'll put this part on a far back burner unless someone else has an idea.

Similar Threads

  1. Replies: 0
    Last Post: 05-27-2010, 07:30 AM
  2. Zimbra server rules menu item vs Outlook Today
    By stfroy in forum Zimbra Connector for Outlook
    Replies: 4
    Last Post: 02-22-2010, 06:23 AM
  3. Compose in new window, window doesn't exit
    By Vladimir in forum Administrators
    Replies: 1
    Last Post: 01-19-2009, 12:04 PM
  4. Replies: 2
    Last Post: 10-16-2007, 04:47 AM
  5. Share Calendar Menu Item doesn't show up
    By kiwicmc in forum Administrators
    Replies: 3
    Last Post: 04-17-2006, 07:15 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
  •