ZCS 6.0:Zimlet Developers Guide:Examples:Simple Dialog

Revision as of 20:38, 22 December 2009 by Sposetti (talk | contribs) (New page: {| cellspacing="0" cellpadding="5" style="border: 1px solid rgb(153, 153, 170); margin: 0pt 0.5em 0.5em 0pt; float: none; background-color: rgb(249, 249, 255);" |[[Image:zdg-6-menu-icon-zi...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Zdg-6-menu-icon-zimbra.jpg Introduction Zdg-6-menu-icon-green-flag.png Getting Started Zdg-6-menu-icon-terminal.png Dev Environment Setup Zdg-6-menu-icon-gear.png Developing Zimlets Zdg-6-menu-icon-library.jpg API Specifications Zdg-6-menu-icon-checkbox.jpg 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


Useful Links

Jump to: navigation, search