Zimlet JavaScript API Reference - ZmPrefView

Class ZmPrefView


Extends DwtTabView.

This class represents a tabbed view of the preference pages.

Defined in: ZmPrefView.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmPrefView(params, parent, posStyle, controller)
Creates an empty view of the preference pages.
Method Summary
Method Attributes Method Name and Description
 
getChangedPrefs(dirtyCheck, noValidation, batchCommand)
Gets the changed preferences.
 
This method iterates over the preference pages to see if any of them have actions to perform after saving.
 
This method iterates over the preference pages to see if any of them have actions to perform before saving.
 
Checks if any preference has changed.
 
selectSection(sectionId)
Selects the section (tab) with the given id.
Methods borrowed from class DwtTabView:
addStateChangeListener, addTab, getCurrentTab, getNumTabs, getTab, getTabBar, getTabButton, getTabTitle, getTabView, removeStateChangeListener, setTabView, switchToTab
Methods borrowed from class DwtComposite:
addChild, cleanupSeparators, clear, dispose, getChild, getChildren, getNumChildren, getTabGroupMember, removeChild, removeChildren
Methods borrowed from class DwtControl:
addClassName, addControlListener, addDisposeListener, addListener, appendElement, blur, clearContent, clearHandler, condClassName, delClassName, focus, getBounds, getClassName, getContent, getCursor, getData, getDragBox, getDragSource, getDropTarget, getEnabled, getFocusElement, getH, getHtmlElement, getHTMLElId, getInsetBounds, getInsets, getLocation, getMargins, getOpacity, getOuterSize, getPosition, getScrollContainer, getScrollStyle, getSize, getTooltipBase, getToolTipContent, getVisibility, getVisible, getW, getX, getXW, getY, getYH, getZIndex, hasFocus, isAlertShown, isDisposed, isInitialized, isListenerRegistered, notifyListeners, preventContextMenu, preventSelection, removeAllListeners, removeControlListener, removeDisposeListener, removeListener, reparent, reparentHtmlElement, replaceElement, setBounds, setClassName, setContent, setCursor, setData, setDisplay, setDisplayState, setDragBox, setDragSource, setDropTarget, setEnabled, setEventPropagation, setFocusElement, setHandler, setHtmlElementId, setLocation, setOpacity, setPosition, setScrollStyle, setSize, setToolTipContent, setVisibility, setVisible, setZIndex, showAlert, zShow
Class Detail
ZmPrefView(params, parent, posStyle, controller)
Creates an empty view of the preference pages.
Author: Conrad Damon.
Parameters:
{Hash} params
a hash of parameters
{DwtComposite} parent
the parent widget
{constant} posStyle
the positioning style
{ZmController} controller
the owning controller
Method Detail
{Array|Boolean} getChangedPrefs(dirtyCheck, noValidation, batchCommand)
Gets the changed preferences. Each prefs page is checked in turn. This method can also be used to check simply whether _any_ prefs have changed, in which case it short-circuits as soon as it finds one that has changed.
Parameters:
{Boolean} dirtyCheck
if true, only check if any prefs have changed
{Boolean} noValidation
if true, don't perform any validation
{ZmBatchCommand} batchCommand
if not null, add soap docs to this batch command
Returns:
{Array|Boolean} an array of {ZmPref} objects or false if no changed prefs

{Array} getPostSaveCallbacks()
This method iterates over the preference pages to see if any of them have actions to perform after saving. If the page has a getPostSaveCallback method and it returns a callback, the pref controller will call it after performing any save. This is done for each page that returns a callback.
Returns:
{Array} an array of {AjxCallback} objects

{Array} getPreSaveCallbacks()
This method iterates over the preference pages to see if any of them have actions to perform before saving. If the page has a getPreSaveCallback method and it returns a callback, the pref controller will call it before performing any save. This is done for each page that returns a callback.

The pre-save callback is passed a callback that MUST be called upon completion of the pre-save code. This is so the page can perform its pre-save behavior asynchronously without the need to immediately return to the pref controller.

Note: When calling the continue callback, the pre-save code MUST pass a single boolean signifying the success of the the pre-save operation.

An example pre-save callback implementation:

MyPrefView.prototype.getPreSaveCallback = function() {
   return new AjxCallback(this, this._preSaveAction, []);
};

MyPrefView.prototype._preSaveAction =
function(continueCallback, batchCommand) {
   var success = true;
   // perform some operation
   continueCallback.run(success);
};
Returns:
{Array} an array of {AjxCallback} objects

{Boolean} isDirty()
Checks if any preference has changed.
Returns:
{Boolean} true if any preference has changed

selectSection(sectionId)
Selects the section (tab) with the given id.
Parameters:
{String} sectionId
the section id

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