Toolbar Buttons not clickable when several msg selected

Interested in talking about Mash-up's? This is the place.
Post Reply
greztok
Posts: 4
Joined: Sat Sep 13, 2014 2:00 am

Toolbar Buttons not clickable when several msg selected

Post by greztok »

Hi there,
I've developed a zimlet to save emails and attachments for my company. It is working fine. The operation consists on drag & drop one or more emails on the zimlet item in the zimlet panel.

My users want a button instead of drag&drop because they say the item is too small and they frequently hit another zimlet item.
So I'v added a toolbar button, but the button turns gray and is not usable when more than one message is selected in the message list.
I checked the "com_zimbra_example_toolbarhook" zimlet, and it appears to react the same way.
Any idea on how to solve this?
Thx,
Sylvain
pkopacz
Posts: 6
Joined: Sat Sep 13, 2014 3:52 am

Toolbar Buttons not clickable when several msg selected

Post by pkopacz »

Did you ever solve this issue? I have the same question. Thanks, Paul
ozzi
Posts: 7
Joined: Mon Nov 13, 2017 12:23 pm

Re: Toolbar Buttons not clickable when several msg selected

Post by ozzi »

If somebody finds this problem, i found a solution:

var controller = appCtxt.getAppViewMgr()._view['TV-main']; // you might want to use another controller, maybe use appCtxt.getCurrentController or so
controller.operationsToEnableOnMultiSelection.push('YOUR_BUTTON_NAME); // YOUR_BUTTON_NAME being the string you passed when using createOp on the toolbar
ozzi
Posts: 7
Joined: Mon Nov 13, 2017 12:23 pm

Re: Toolbar Buttons not clickable when several msg selected

Post by ozzi »

Actually, i found a proper solution to this, the solution mentioned above does not work with certain UI constellations (example: switching from conversation view to mail view, or not having preview on).
This works always:

appCtxt.getAppViewMgr()._view['THE VIEW YOU HAVE OPEN '].controller.operationsToEnableOnMultiSelection.push('COM_EXAMPLE_YOUR_BUTTON_NAME');
Post Reply