Zimlet Developers Guide:Application Context: Difference between revisions
No edit summary |
|||
Line 46: | Line 46: | ||
== Accessing Dialogs == | == Accessing Dialogs == | ||
The following describes some of the <code>appCtxt</code> methods for accessing dialogs: | |||
{| cellpadding="5" cellspacing="0" border="1" width="70%" | |||
|style="background-color:#ffffcc;" width="20%"|'''Class Method''' | |||
|style="background-color:#ffffcc;"|'''Description''' | |||
|- | |||
|<code>appCtxt.getMsgDialog()</code> | |||
|Gets the message dialog (with "OK" button). | |||
|- | |||
|<code>appCtxt.getYesNoMsgDialog()</code> | |||
|Gets the message dialog (with "Yes"/"No" buttons). | |||
|- | |||
|<code>appCtxt.getYesNoCancelMsgDialog()</code> | |||
|Gets the message dialog (with "Yes"/"No"/"Cancel" buttons). | |||
|- | |||
|<code>appCtxt.getErrorDialog()</code> | |||
|Gets the error dialog (with "Error Report"/"Details"/"OK" buttons). | |||
|} | |||
== Application Information == | == Application Information == |
Revision as of 06:06, 2 January 2010
Introduction | Getting Started | Dev Environment Setup | Developing Zimlets |
|
API Specifications | Example Zimlets |
Overview
The Application Context is a global object available via JavaScript from your Zimlet Handler Object. Using the Application Context object, you can access various application information, dialog boxes, and user preferences. The Application Context is accessed via the appCtxt
object. For example, the following shows how to access the simple message dialog from the application context:
com_zimbra_test.prototype.myMethod = function() { var dialog = appCtxt.getMsgDialog(); //get a simple message dialog dialog.reset(); // reset the dialog dialog.setMessage("Hello World!", DwtMessageDialog.INFO_STYLE); // set the message "info" style dialog.popup(); // display the dialog };
Accessing Dialogs
The following describes some of the appCtxt
methods for accessing dialogs:
Class Method | Description |
appCtxt.getMsgDialog()
|
Gets the message dialog (with "OK" button). |
appCtxt.getYesNoMsgDialog()
|
Gets the message dialog (with "Yes"/"No" buttons). |
appCtxt.getYesNoCancelMsgDialog()
|
Gets the message dialog (with "Yes"/"No"/"Cancel" buttons). |
appCtxt.getErrorDialog()
|
Gets the error dialog (with "Error Report"/"Details"/"OK" buttons). |
Application Information
The following describes some of the appCtxt
methods for accessing application information:
Class Method | Description |
appCtxt.getCurrentApp()
|
Gets the current application object. |
appCtxt.getCurrentAppName()
|
Gets current application name. |
appCtxt.getCurrentController()
|
Gets the current application controller. |
Account Information
API Documentation
The complete JavaScript documentation for the Application Context class is available at:
http://files.zimbra.com/docs/zimlet/zcs/6.0/jsdocs/symbols/ZmAppCtxt.html