class %ZEN.Dialog.standardDialog
extends %ZEN.Component.page
This base class provides a standard template for the dialog pages
provided by Zen. The various dialog pages are implemented as subclasses
of this class.
To create a new dialog based on this class:
- Create a subclass of this class.
- Define an XData block named dialogBody.
- Within this XData block define the contents of the dialog using a pane component as the container.
- Override the %OnGetTitle to provide the dialog title.
- Override the %OnGetSubtitle to provide the dialog subtitle.
- Override the getDialogValue to supply the return value for the dialog.
- Override the APPLYBUTTON if the dialog has an apply button.
This is a Zen Page class.
parameter APPLYBUTTON = 0;
If true, then this dialog displays an Apply button.
parameter DOMAIN = "%ZEN";
Localization domain
parameter FAVORITEICON = "portal/sysoperate.ico";
SMP favorite icon.
property dialogTitle
as %ZEN.Datatype.string [ ReadOnly ];
Provide a title for the dialog window. The value is supplied
by the %OnGetTitle method.
property disabledStyle
as %ZEN.Datatype.style [ InitialExpression = "background-image:none;background:#D0D0D0;" ];
Style applied to buttons when automatically disabled.
property hideApplyButton
as %ZEN.Datatype.boolean [ Final,InitialExpression = '+..#APPLYBUTTON ];
This is used to indicate whether this dialog has an apply button.
method %DrawTitle(pSeed As %String)
as %Status
Provide HTML for html title box.
Default implementation displays the standard Zen title bar.
method %OnGetSubtitle()
as %String
Get the (localized) subtitle string for the dialog.
This should be implemented in a subclass.
method %OnGetTitle()
as %String
Get the (localized) title string for the dialog.
This should be implemented in a subclass.
classmethod %OnUseSoftModals()
as %Boolean
For the time being, do not use soft modals for the portal.
method adjustSize()
[ Language = javascript ]
Adjust size and position of components on this page.
final method btnApply()
[ Language = javascript ]
This method is no longer supported by standardDialog so
make sure it does not get used.
final method btnOK()
[ Language = javascript ]
This method is no longer supported by standardDialog so
make sure it does not get used.
method ctrlKeyDown(evt, escOnly)
[ Language = javascript ]
Key handler used by many controls in dialogs. Defined here for convenience.
To use, add an onkeydown handler to controls in your dialog:
<text label="Name" onkeydown="return zenPage.ctrlKeyDown(zenEvent);"/>
If the user presses ESCAPE within this control, the dialog is cancelled. If the user
presses ENTER, then the dialog is completed (same as pressing OK).
If escOnly is true, then only the ESC key is processed. This is useful for
controls where the ENTER key is needed (such as a textarea).
method dialogApply()
[ Language = javascript ]
Apply the value for this dialog and keep it open.
Do not overide, instead implement the ondialogFinish method.
method dialogCancel()
[ Language = javascript ]
Close this dialog without applying its value.
Do not overide, instead implement the ondialogCancel method.
method dialogFinish()
[ Language = javascript ]
Apply the value for this dialog and close it.
Do not overide, instead implement the ondialogFinish method.
method dialogTitleGet()
as %ZEN.Datatype.string
Get value for dialogTitle property.
method disableButtons(flag)
[ Language = javascript ]
Disable or enable the apply,cancel, and ok buttons for this dialog.
method getDialogValue()
[ Language = javascript ]
Get the value that will be applied when the user presses the OK button.
This is implemented by subclasses.
abstract method ondialogCancel()
[ Language = javascript ]
This callback, if defined, is called when the user presses the Cancel button.
If this returns false, then the dialog is not cancelled.
abstract method ondialogFinish(action)
[ Language = javascript ]
This callback, if defined, is called when the user presses the OK or Apply action buttons.
If this returns false, then the action is cancelled.
abstract method ondialogStart()
[ Language = javascript ]
This callback, if defined, is called when the dialog page is loaded.
final method onlayoutHandler(load)
[ Language = javascript ]
This client event, if present, is fired when the page
is first loaded or whenever it is resized.
If this is called at load time, then load will
be true.