ZCS 6.0:Zimlet Developers Guide:Examples:Dialogs: Difference between revisions
(Adding Article Infobox) |
No edit summary |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{| 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);" | {{BC|Community Sandbox}} | ||
__FORCETOC__ | |||
<div class="col-md-12 ibox-content"> | |||
=ZCS 6.0: Zimlet Developer Guide:Examples:Dialogs= | |||
{{KB|{{Unsupported}}|{{ZCS 7.0}}|{{ZCS 6.0}}|}} | |||
{{WIP}}{| 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-zimbra.jpg|20px]] | |[[Image:zdg-6-menu-icon-zimbra.jpg|20px]] | ||
|[[ZCS 6.0:Zimlet Developers Guide:Introduction|Introduction]] | |[[ZCS 6.0:Zimlet Developers Guide:Introduction|Introduction]] | ||
Line 15: | Line 20: | ||
|[[ZCS 6.0:Zimlet Developers Guide:Example Zimlets|Example Zimlets]] | |[[ZCS 6.0:Zimlet Developers Guide:Example Zimlets|Example Zimlets]] | ||
|} | |} | ||
== Description == | |||
This zimlet shows-up as a panel item and will display series of dialogs based on your selection from the zimlet menu items. | This zimlet shows-up as a panel item and will display series of dialogs based on your selection from the zimlet menu items. | ||
Line 141: | Line 144: | ||
<li>[[ZCS_6.0:Zimlet_Developers_Guide:Examples:Simple_Dialog|Simple Custom Dialog]]</li> | <li>[[ZCS_6.0:Zimlet_Developers_Guide:Examples:Simple_Dialog|Simple Custom Dialog]]</li> | ||
<li>[[ZCS_6.0:Zimlet_Developers_Guide:Examples:Simple_Dialog_with_Template|Simple Dialog using a Template]]</li> | <li>[[ZCS_6.0:Zimlet_Developers_Guide:Examples:Simple_Dialog_with_Template|Simple Dialog using a Template]]</li> | ||
<li>[ | <li>[[ZCS 6.0:Zimlet Developers Guide:Zimbra JavaScript API Reference|Zimlet JavaScript API Reference]]</li> | ||
</ul> | </ul> | ||
{{Article Footer|Zimbra Collaboration | {{Article Footer|Zimbra Collaboration Server 7.0|01/15/2010}} | ||
[[Category:Developers]] | [[Category:Developers]] | ||
[[Category:Zimlets]] | [[Category:Zimlets]] | ||
[[Category:ZCS 7.0]] | |||
[[Category:ZCS 6.0]] | [[Category:ZCS 6.0]] |
Revision as of 12:36, 13 July 2015
ZCS 6.0: Zimlet Developer Guide:Examples:Dialogs
Introduction | Getting Started | Dev Environment Setup | Developing Zimlets | Advanced Concepts | API Specifications | Example Zimlets |
Description
This zimlet shows-up as a panel item and will display series of dialogs based on your selection from the zimlet menu items.
Screenshots
Definition File
<zimlet name="com_zimbra_example_dialogs" version="1.0" description="Creates various dialogs"> <include>com_zimbra_example_dialogs.js</include> <handlerObject>com_zimbra_example_dialogs_HandlerObject</handlerObject> <zimletPanelItem label="Dialogs Zimlet"> <contextMenu> <menuItem label="Message Dialog (info)" icon="zimbraIcon" id="com_zimbra_dialogs_msgInfodlg"/> <menuItem label="Message Dialog (warn)" icon="zimbraIcon" id="com_zimbra_dialogs_msgWarndlg"/> <menuItem label="Message Dialog (critical)" icon="zimbraIcon" id="com_zimbra_dialogs_msgCriticaldlg"/> <menuItem label="Error" icon="zimbraIcon" id="com_zimbra_dialogs_errordlg"/> <menuItem label="Yes/No Dialog" icon="zimbraIcon" id="com_zimbra_dialogs_yesnodlg"/> <menuItem label="Yes/No/Cancel Dialog" icon="zimbraIcon" id="com_zimbra_dialogs_yesnocanceldlg"/> </contextMenu> </zimletPanelItem> </zimlet>
Creating the Dialogs
Here is snippet from the Zimlet Handler Object. The application context object is used to create the dialogs.
Message Dialogs
this._dialog = appCtxt.getMsgDialog(); // returns DwtMessageDialog
We attach a listener on the "OK" button of the message dialog. When the "OK" button is pressed, the okBtnListener
method is called.
this._dialog.setButtonListener(DwtDialog.OK_BUTTON, new AjxListener(this, this._okBtnListener)); // listens for OK button events
Error Dialog
this._dialog = appCtxt.getErrorDialog(); // returns ZmErrorDialog
We attach a listener on the "OK" button of the error dialog. When the "OK" button is pressed, the _okBtnListener
method is called.
this._dialog.setButtonListener(DwtDialog.OK_BUTTON, new AjxListener(this, this._okBtnListener)); // listens for OK button events
Yes-No Dialog
this._dialog = appCtxt.getYesNoMsgDialog(); // returns DwtMessageDialog
We attach a listener on the "YES" and "NO" buttons of the dialog. When the "YES" or "NO" buttons are pressed, the _yesBtnListener
and _noBtnListener
methods are called respectively.
this._dialog.setButtonListener(DwtDialog.YES_BUTTON, new AjxListener(this, this._yesBtnListener)); // listens for YES button events this._dialog.setButtonListener(DwtDialog.NO_BUTTON, new AjxListener(this, this._noBtnListener)); // listens for NO button events
Yes-No-Cancel Dialog
this._dialog = appCtxt.getYesNoCancelMsgDialog(); // returns DwtMessageDialog
We attach a listener on the "YES", "NO", and "CANCEL" buttons of the dialog. When the "YES", "NO" or "CANCEL" buttons are pressed, the _yesBtnListener
, _noBtnListener
and _cancelBtnListener
methods are called respectively.
this._dialog.setButtonListener(DwtDialog.YES_BUTTON, new AjxListener(this, this._yesBtnListener)); // listens for YES button events this._dialog.setButtonListener(DwtDialog.NO_BUTTON, new AjxListener(this, this._noBtnListener)); // listens for NO button events this._dialog.setButtonListener(DwtDialog.CANCEL_BUTTON, new AjxListener(this, this._cancelBtnListener)); // listens for CANCEL button events
Download
Zimlet Package | com_zimbra_example_dialogs.zip |
Useful Links