Zimlet JavaScript API Reference - ZmController

Class ZmController


This class represents an application controller.

Defined in: ZmController.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmController(container, app, type, sessionId)
Creates a controller.
Method Summary
Method Attributes Method Name and Description
 
Gets the application.
 
Gets the current view ID.
 
Gets the current view type.
<static>  
ZmController.getDefaultViewType()
Returns the default view type
 
Gets the key map name.
 
Gets the new folder callback.
 
Gets the session ID.
 
Gets the tab group.
 
getViewElements(view, appContentView, toolbar)
return the view elements.
 
handleKeyAction(actionCode, ev)
Handles the key action.
 
isTransient(oldView, newView)
Checks if the view is transient.
 
Checks if shortcuts for the given map are supported for this view.
 
popupErrorDialog(msg, ex, noExecReset, hideReportButton, expanded, noEncoding)
Pops-up the error dialog.
 
popupUploadErrorDialog(type, respCode, extraMsg)
Pops-up an error dialog describing an upload error.
 
Sets the current view ID.
 
Sets the current view type.
 
setSessionId(sessionId, type, searchResultsController)
Sets the session id, view id, and tab id (using the type and session id).
<static>  
ZmController.showDialog(dialog, callback, params, account)
Shows a dialog.
Class Detail
ZmController(container, app, type, sessionId)
Creates a controller.
Parameters:
{DwtShell} container
the application container
{ZmApp} app
the application
{constant} type
type of controller (typically a view type)
{string} sessionId
the session id
Method Detail
{ZmApp} getApp()
Gets the application.
Returns:
{ZmApp} the application

{DwtComposite} getCurrentViewId()
Gets the current view ID.
Returns:
{DwtComposite} the view Id

{constant} getCurrentViewType(viewType)
Gets the current view type.
Parameters:
viewType
Returns:
{constant} the view type

<static> ZmController.getDefaultViewType()
Returns the default view type

{String} getKeyMapName()
Gets the key map name.
Returns:
{String} the key map name

{AjxCallback} getNewFolderCallback()
Gets the new folder callback.
Returns:
{AjxCallback} the callback

{string} getSessionId()
Gets the session ID.
Returns:
{string} the session ID

{Object} getTabGroup()
Gets the tab group.
Returns:
{Object} the tab group

getViewElements(view, appContentView, toolbar)
return the view elements. Currently a toolbar, app content, and "new" button.
Parameters:
view
(optional if provided toolbar)
appContentView
toolbar
(used only if view param is null)

{Boolean} handleKeyAction(actionCode, ev)
Handles the key action.
Parameters:
{constant} actionCode
the action code
ev
Returns:
{Boolean} true if the key action is handled
See:
ZmApp.ACTION_CODES_R
ZmKeyMap

{Boolean} isTransient(oldView, newView)
Checks if the view is transient.
Parameters:
{Object} oldView
the old view
{Object} newView
the new view
Returns:
{Boolean} true if the controller is transient.

{Boolean} mapSupported(map)
Checks if shortcuts for the given map are supported for this view. For example, given the map "tabView", a controller that creates a tab view would return true.
Parameters:
{String} map
the name of a map (see DwtKeyMap)
Returns:
{Boolean} true if shortcuts are supported

popupErrorDialog(msg, ex, noExecReset, hideReportButton, expanded, noEncoding)
Pops-up the error dialog.
Parameters:
{String} msg
the error msg
{ZmCsfeException} ex
the exception
{Boolean} noExecReset
(not used)
{Boolean} hideReportButton
if true, hide the "Send error report" button
{Boolean} expanded
if true, contents are expanded by default
noEncoding

popupUploadErrorDialog(type, respCode, extraMsg)
Pops-up an error dialog describing an upload error.
Parameters:
{constant} type
the type of the uploaded item, e.g. ZmItem.MSG.
{Number} respCode
the HTTP reponse status code
{String} extraMsg
optional message to append to the status

setCurrentViewId(viewId)
Sets the current view ID.
Parameters:
{string} viewId
the view ID

setCurrentViewType(viewType)
Sets the current view type.
Parameters:
{constant} viewType
the view type

setSessionId(sessionId, type, searchResultsController)
Sets the session id, view id, and tab id (using the type and session id). Controller for a view that shows up in a tab within the app chooser bar. Examples include compose, send confirmation, and msg view.
Parameters:
{string} sessionId
the session id
{string} type
the type
{ZmSearchResultsController} searchResultsController
owning controller

<static> ZmController.showDialog(dialog, callback, params, account)
Shows a dialog. Since the dialog is a shared resource, a dialog reset is performed.
Parameters:
{DwtDialog} dialog
the dialog
{AjxCallback} callback
the callback
{Hash} params
a hash of parameters
{ZmAccount} account
the account
See:
DwtDialog#reset
DwtDialog#popup

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:37 GMT-0400 (EDT)