abstract class %ZEN.Component.component
extends object
This is the base class for all visual, HTML-based Zen components.
parameter DEFAULTENCLOSINGCLASS = "zendiv";
Subclasses can set this to change default enclosingClass used for this
component.
parameter DEFAULTHEIGHT;
Subclasses can set this to change default height for a component.
parameter DEFAULTHIDDEN = 0;
Subclasses can set this to change default hidden property for a component.
parameter DEFAULTHINTCLASS = "zenHint";
Subclasses can set this to change default css class used for hints.
parameter DEFAULTLABELCLASS = "zenLabel";
Subclasses can set this to change default css class used for labels.
parameter DEFAULTLABELDISABLEDCLASS = "zenLabelDisabled";
Subclasses can set this to change default css class used for disabled labels.
parameter DEFAULTVISIBLE = 1;
Subclasses can set this to change default visibilty for a component.
parameter DEFAULTWIDTH;
Subclasses can set this to change default width for a component.
property align
as %ZEN.Datatype.align;
Specifies how this component should be horizontally aligned within its layout cell.
property containerStyle
as %ZEN.Datatype.style;
CSS style applied to the td element used to contain this child component within
its parent group's layout table. This overrides the parent group's cellStyle property
for this child. Typically this is used to provide padding or alignment for
a specific component. This only applies to layout strategies that use tables.
property dragEnabled
as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
If this value is true and dragAndDrop is enabled for the page, then
this component can serve as a drag source (i.e., users can
start a drag and drop operation over this component).
The actual behavior is determined by the subclass implementation.
property dropEnabled
as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
If this value is true and dragAndDrop is enabled for the page, then
this component can serve as a drag target (i.e., users can
end a drag and drop operation over this component).
The actual behavior is determined by the subclass implementation.
property enclosingClass
as %ZEN.Datatype.cssClass [ InitialExpression = ..#DEFAULTENCLOSINGCLASS ];
Optional CSS class used for this component's enclosing div.
property enclosingStyle
as %ZEN.Datatype.style;
Optional CSS style applied to this component's enclosing div.
property error
as %ZEN.Datatype.string(XMLPROJECTION="none",ZENSETTING=0);
Run-time value; Set to indicate an error within this component.
This is primarily used by controls.
It is defined here for flexibility.
property height
as %ZEN.Datatype.length [ InitialExpression = ..#DEFAULTHEIGHT ];
Specifies the height of this component with respect to its container.
property hidden
as %ZEN.Datatype.boolean(ZENEXPRESSION=1) [ InitialExpression = ..#DEFAULTHIDDEN ];
If true, this component is hidden. That is, its enclosing
element's display style is set to "none".
property hint
as %ZEN.Datatype.caption;
User defined hint text used to display additional hint text for this component.
If specified, the hint text is drawn below the component.
property hintClass
as %ZEN.Datatype.cssClass [ InitialExpression = ..#DEFAULTHINTCLASS ];
Optional CSS class used for the component hint.
property hintStyle
as %ZEN.Datatype.style;
User defined style used for the component hint.
property label
as %ZEN.Datatype.caption;
User defined label used to label this component.
The actual display of this label is managed by the group
this component belongs to.
property labelClass
as %ZEN.Datatype.cssClass [ InitialExpression = ..#DEFAULTLABELCLASS ];
Optional CSS class used for the component label.
property labelDisabledClass
as %ZEN.Datatype.cssClass [ InitialExpression = ..#DEFAULTLABELDISABLEDCLASS ];
Optional CSS class used for the component label when disabled.
property labelStyle
as %ZEN.Datatype.style;
User defined style used for the component label.
property onafterdrag
as %ZEN.Datatype.eventHandler(HANDLER="");
onafterdrag event handler:
If this value is true and dragEnabled is
true and drag-and-drop is enabled for the current page,
then this event is raised when a drag operation that started
within this component completes.
property onbeforedrag
as %ZEN.Datatype.eventHandler(HANDLER="");
onbeforedrag event handler:
If this value is true and dragEnabled is
true and drag-and-drop is enabled for the current page,
then this event is raised when a drag operation has
been initiated within this component but before the component has
started to process the event. This is for cases where you want to
override the default drag behavior of a component.
property ondrag
as %ZEN.Datatype.eventHandler(HANDLER="");
ondrag event handler:
If this value is true and dragEnabled is
true and drag-and-drop is enabled for the current page,
then this event is raised when a drag operation has
been initiated within this component.
property ondrop
as %ZEN.Datatype.eventHandler(HANDLER="");
ondrop event handler:
If this value is true and dropEnabled is
true and drag-and-drop is enabled for the current page,
then this event is raised when a drop operation occurs
within this component.
property onhide
as %ZEN.Datatype.eventHandler;
onhide event handler:
This event is fired when this component is made hidden.
property onrefresh
as %ZEN.Datatype.eventHandler;
onrefresh event handler:
This event is fired when the contents of this component are
refreshed from the server.
property onshow
as %ZEN.Datatype.eventHandler;
onshow event handler:
This event is fired when this component is made visible.
property showLabel
as %ZEN.Datatype.boolean [ InitialExpression = 1 ];
Controls whether a label is displayed for this component.
If false do not display a label for this component.
If labels are displayed to the left, the Layout Manager
will attempt to give the space allocated for the label to the
component as well. This makes this option useful for
placing labels between sections in forms.
property slice
as %ZEN.Datatype.integer(MINVAL=0);
User-defined number of units of relative space this
component's layout cell takes up within its group along the group layout direction.
This may be used by a layout manager when calculating layout requirements.
property title
as %ZEN.Datatype.caption;
Help text (tool tip) displayed when mouse hovers over this component (or its label).
property valign
as %ZEN.Datatype.valign;
Specifies how this component should be vertically aligned within its layout cell.
property width
as %ZEN.Datatype.length [ InitialExpression = ..#DEFAULTWIDTH ];
Specifies the width of this component with respect to its container.
final method %DrawComponentHTML(pStyle As %String = "")
Draw enclosing div element and then draw contents within it.
final method %EnclosingDivId()
Compute the HTML id value used for an enclosing div.
Use component id for enclosing div; if not defined
use zen#, where # is the index number.
method %OnDrawEnclosingDiv()
as %String
This callback, if defined, makes it possible for a subclass to inject
additional attributes into the enclosing div element for a component.
If implemented, this method should return a string with a leading space to
avoid conflict with other attributes.
abstract method dragFinishHandler(dragData)
[ Language = javascript ]
This is called when a drag operation started within this component
is completed.
This method is implemented by subclasses.
final method dragHandler()
[ Language = javascript ]
This is called by the layout manager when a drag-and-drop operation
starts on this component.
final method dragNotifyHandler(dragData)
[ Language = javascript ]
This is called by the layout manager when a drag operation
that started on this component is completed (that is, after the
target component finished processing the drop).
abstract method dragStartHandler(dragData)
[ Language = javascript ]
This is called when a drag operation is started within this component.
This method is implemented by subclasses.
final method dropHandler()
[ Language = javascript ]
This is called by the layout manager when a drag-and-drop operation
ends on this component.
abstract method dropStartHandler(dragData)
[ Language = javascript ]
This is called when a data drop operation is started within this component.
This method is implemented by subclasses.
method exposeComponent()
[ Language = javascript ]
This manages the ondisplay event callback handling. The display event
fires when the page is first displayed, when the component or its containing
group is refreshed from the server, or when the component or its containing
group is displayed via a programmatic 'show()' call. Note that setting the
style.display value from JavaScript DOES NOT trigger this event. In general,
application code should not modify or overload this method; instead, use the
onDisplayHandler() to customize this processing.
final method getEnclosingDiv()
[ Language = javascript ]
Client-side method returns the div element that encloses
this component.
method getHidden()
as %String
[ Language = javascript ]
Return whether this component is hidden.
final method getHintElement()
[ Language = javascript ]
Client-side method returns the HTML element that displays
the hint for this component (if any).
final method getLabelElement()
[ Language = javascript ]
Client-side method returns the HTML element that displays
the label for this component (if any).
abstract method onDisplayHandler()
[ Language = javascript ]
This client callback is called from exposeComponent after
the element has been displayed on the screen. This ia a synthetic event
that fires when the page is first displayed, when the component or its containing
group is refreshed from the server, or when the component or its containing
group is displayed via a programmatic 'show()' call. Note that setting the
style.display value from JavaScript DOES NOT trigger this event
abstract method onEndModalHandler(zindex)
[ Language = javascript ]
Notification that this component is about to stop being modal.
abstract method onPopupAction(popupName, action, value)
[ Language = javascript ]
This client event, if present, is fired when a popup page has specified
this component as its parent and fires an action.
popupName is the name of the popup window sending the action.
action is the name of the action.
value is the value associated with the action.
abstract method onRefreshContents()
[ Language = javascript ]
This client callback is called just from refreshContents
just after the new HTML is delivered from the server.
abstract method onStartModalHandler(zindex)
[ Language = javascript ]
Notification that this component is about to become modal.
zindex is zindex value to use to make sure component is placed
above system-provided div element.
final method refreshContents(sync)
[ Language = javascript ]
This method, called from a client page, invokes this component's
%DrawHTML, converts its output to a JavaScript string
and replaces the component's enclosing div with this new HTML. This
is useful for components that need to refresh their contents from the server
after being rendered.
Internally, this refresh can occur immediately or be deferred
as specified by the zenRefreshMode flag.
If sync is defined and is true, the refresh will be executed
synchronously (unless we are in deferred mode).
method setHidden(flag)
[ Language = javascript ]
If flag is true, hide this component
otherwise make it visible.
If present, invoke onshow or onhide callbacks.
method setOverlayMode(mode)
[ Language = javascript ]
Expirimental: do not use.
Set the overlay mode for this component.
(An overlay is a transparent div placed atop a component
for the purpose of capturing events; it is used by the ZEN
Page editing utilities.)
mode is the overlay mode:
0: turn off overlay.
1: turn on overlay.
2: turn on overlay, show indication that this component
is selected.
method setProperty(property, value, value2)
[ Language = javascript ]
Set the value of a named property.
method startProgressBar(div)
[ Language = javascript ]
Start the display of a progress bar within display
area for this component.
Typically this is used by components that refresh their contents
from the server (such as tablePane).
div, if defined, is div element that will contain the
progress bar.
method stopProgressBar()
[ Language = javascript ]
Stop the timer used by the Progress bar.