ZCS 6.0:Zimlet Developers Guide:Examples:Simple Dialog
Introduction | Getting Started | Dev Environment Setup | Developing Zimlets | API Specifications | Example Zimlets |
Description
This zimlet shows-up as a panel item and will display a simple custom dialog on a single or double-click. This example also uses internationalization properties.
Definition File
<zimlet name="com_zimbra_simpledialog" version="1.0" description="Create a simple custom dialog."> <include>simpledialog.js</include> <handlerObject>com_zimbra_simpledialogHandlerObject</handlerObject> <zimletPanelItem label="${msg.simpledialog_label}" icon="zimbraIcon"> <toolTipText>${msg.simpledialog_tooltip}</toolTipText> </zimletPanelItem> </zimlet>
Handler Object
Here is doDrop(obj)
method of the Zimlet Handler Object:
** * This method gets called by the Zimlet framework when an item or items are dropped on the panel. * * @param obj the dropped object */ com_zimbra_paneldragsourceHandlerObject.prototype.doDrop = function(obj) { var type = obj.TYPE; switch(type) { case "ZmAppt": { // do something with ZmAppt break; } case "ZmContact": { // do something with ZmContact break; } case "ZmConv": { // do something with ZmConv break; } case "ZmMailMsg": { // do something with ZmMailMsg break; } } };
Download
Zimlet Package | com_zimbra_simpledialog.zip |