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 05-06-2009, 12:09 AM
Junior Member
 
Posts: 9
Default Is there a register of listeners?

Is there a register of listeners which have been added to elements in Zimbra? I've trawled the DOM in Firebug but can't see the wood for the trees to be honest.

What I'm trying to do is to transfer or duplicate functionality from an existing button which is buried in a dropdown menu on a different part of the page to a new button which I have created on the toolbar. I just want to add the same listener and function to my new button. I don't want to reparent the existing button, just duplicate its function.

I've seen similar questions asked before, but can't find the answer anywhere. As far as I can make out, there is no built in register in Javascript in any of the browsers, though it has been proposed. I presume that Zimbra keeps its own register, but where is it!?

Thanks.
Reply With Quote
  #2 (permalink)  
Old 05-06-2009, 03:40 AM
Junior Member
 
Posts: 9
Default

I've had some luck with this after more digging around. It must be a terribly unorthodox method though:

Code:
controller = AjxDispatcher.run("GetComposeController");
myNewButton.addSelectionListener(function(){controller._composeView._button.TO._emulateSingleClick();});
This makes my button on the toolbar open the contacts picker which the To button on the compose form normally does. That's just an example of the sort of thing I'm trying to do though, and the same trick doesn't work for other buttons. Just thought I'd post it here for a laugh.
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.