Quantcast
Channel: Zimbra :: Forums - Zimlets
Viewing all articles
Browse latest Browse all 171

Adding a Mail Toolbar Button - problem keeping focus.

$
0
0
Hi guys,

I followed the default guide to add a button to mail toolbar, as follow:

Code:

uspSuporte.prototype.initializeToolbar =
function(app, toolbar, controller, viewId) {

    if (viewId == ZmId.VIEW_CONVLIST || viewId == ZmId.VIEW_TRAD) {
        // get the index of "View" menu so we can display the button after that
        var buttonIndex = 0;
        for (var i = 0; i < toolbar.opList.length; i++) {
                if (toolbar.opList[i] == ZmOperation.VIEW_MENU) {
                        buttonIndex = i + 1;
                        break;
                }
        }

        var buttonParams = {
                text: this.getMessage("buttonName"),
                tooltip: this.getMessage("tooltip"),
                index: buttonIndex,
                image: "suporteIcon"
        };

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

This work great, until I clicked on the Inbox folder. After that, the button just "turn-off", to work again I have to reload zimbra. How I can fix it?

Viewing all articles
Browse latest Browse all 171

Trending Articles