Home > Class Reference > ENSLIB namespace > %ZEN.Component.form


class %ZEN.Component.form extends %ZEN.Component.group, %ZEN.Component.dataView

Form component.
This is a specialized type of group that wraps its constituent components within an HTML form element.
Typically a form contain a set of controls. These are used to collect input from a user. This input is sent to the server for processing via an HTML submit operation.
The contents of a form can be submitted in two ways: When the user clicks a submit button placed within the form, or by calling the submit() of this form object.
Note that ZEN automatically handles the details of the submit operation including invoking server callbacks and error processing. All forms are submitted using the HTTP POST submission method.

Property Inventory (Including Private)

Method Inventory (Including Private)


parameter DEFAULTGROUPCLASS = form;
Inherited description: Subclasses can set this to change default css class for a group.
parameter DEFAULTGROUPSTYLE = padding: 5px;;
Default style for cells within forms
parameter SYSMODULE = form;
Inherited description: If set, this indicates that this system component should be placed in the given "module". A module is a grouping of components within the same class package that share common include (js or css) files. Note that certain root classes are implicitly placed within the "core" module.
Classes outside of the Zen library should not set this, they should use the MODULE instead.

Properties (Including Private)

property OnLoadForm as %ZEN.Datatype.delegator (FORMALSPEC = "pID:%String,*pValues:%String", RETURNTYPE = "%Status");
(Optional) Name of Server-side callback method to call to get values for this form.
This must be the name of a server-only method in the page class that contains this form component.
Property methods: OnLoadFormDisplayToLogical(), OnLoadFormGet(), OnLoadFormIsValid(), OnLoadFormLogicalToDisplay(), OnLoadFormLogicalToOdbc(), OnLoadFormNormalize(), OnLoadFormSet()
property OnSubmitForm as %ZEN.Datatype.delegator (FORMALSPEC = "pSubmit:%ZEN.Submit", RETURNTYPE = "%Status");
(Optional) Name of Server-side callback method to call when this form is submitted. If this is not specified, then the page's %OnSubmit() method is called instead.
This must be the name of a server-only method in the page class that contains this form component.
Property methods: OnSubmitFormDisplayToLogical(), OnSubmitFormGet(), OnSubmitFormIsValid(), OnSubmitFormLogicalToDisplay(), OnSubmitFormLogicalToOdbc(), OnSubmitFormNormalize(), OnSubmitFormSet()
property action as %ZEN.Datatype.uri;
Specifies the action attribute for the form.
Setting this will override the default behavior of Zen forms (i.e. the normal submit logic will not be executed). This should only be used for special cases where direct control of the action attribute is required.
Property methods: actionDisplayToLogical(), actionGet(), actionIsValid(), actionLogicalToDisplay(), actionLogicalToOdbc(), actionNormalize(), actionSet()
property autoValidate as %ZEN.Datatype.boolean [ InitialExpression = 1 ];
If true (the default), automatically invoke this form's validate() whenever this form is submitted.
Property methods: autoValidateDisplayToLogical(), autoValidateGet(), autoValidateIsValid(), autoValidateLogicalToDisplay(), autoValidateLogicalToOdbc(), autoValidateLogicalToXSD(), autoValidateNormalize(), autoValidateSet(), autoValidateXSDToLogical()
property autocomplete as %ZEN.Datatype.boolean [ InitialExpression = 1 ];
(Optional) Indicates whether controls in this form can by default have their values automatically completed by the browser.
This setting can be overridden by an autocomplete attribute on an element belonging to the form.
Property methods: autocompleteDisplayToLogical(), autocompleteGet(), autocompleteIsValid(), autocompleteLogicalToDisplay(), autocompleteLogicalToOdbc(), autocompleteLogicalToXSD(), autocompleteNormalize(), autocompleteSet(), autocompleteXSDToLogical()
property enctype as %ZEN.Datatype.string;
Specifies the enctype for the form. (Refer to the HTML form element for details).
Property methods: enctypeDisplayToLogical(), enctypeGet(), enctypeIsValid(), enctypeLogicalToDisplay(), enctypeLogicalToOdbc(), enctypeNormalize(), enctypeSet()
property invalidMessage as %ZEN.Datatype.caption [ InitialExpression = "This form contains invalid values. Please correct the following field(s) and try again." ];
Value displayed in alert box by the validate() method when the contents of this form are invalid.
This is a localized value.
Property methods: invalidMessageDisplayToLogical(), invalidMessageGet(), invalidMessageIsValid(), invalidMessageLogicalToDisplay(), invalidMessageLogicalToOdbc(), invalidMessageNormalize(), invalidMessageSet()
property key as %ZEN.Datatype.string (ZENEXPRESSION = 1);
(Optional) ID value used by the OnLoadForm() method to load data for this form.
If this form is connected to a dataController then this value will be ignored.
Property methods: keyDisplayToLogical(), keyGet(), keyIsValid(), keyLogicalToDisplay(), keyLogicalToOdbc(), keyNormalize(), keySet()
property messageTargetId as %ZEN.Datatype.id;
If defined, this is the id of a control (which could be anywhere on the page) that will display messages, such as the noModelMessage. The message is displayed by setting the value property of the identified control.
Property methods: messageTargetIdDisplayToLogical(), messageTargetIdGet(), messageTargetIdIsValid(), messageTargetIdLogicalToDisplay(), messageTargetIdLogicalToOdbc(), messageTargetIdNormalize(), messageTargetIdSet()
property method as %ZEN.Datatype.string (VALUELIST = ",post,get");
Specifies the method attribute for the form.
Setting this will override the default behavior of Zen forms. This should only be used for special cases where direct control of the method attribute is required.
Property methods: methodDisplayToLogical(), methodGet(), methodIsValid(), methodLogicalToDisplay(), methodLogicalToOdbc(), methodNormalize(), methodSet()
property nextPage as %ZEN.Datatype.uri;
URL to go to after this form is submitted successfully. This value may be overwritten by a specific submit button.
Property methods: nextPageDisplayToLogical(), nextPageGet(), nextPageIsValid(), nextPageLogicalToDisplay(), nextPageLogicalToOdbc(), nextPageNormalize(), nextPageSet()
property noModelMessage as %ZEN.Datatype.caption;
Value displayed in the component with id messageTargetId when this form is not connected to a data model; the form is connected to a controller but the controller does not have a data model. This is a localized value.
Property methods: noModelMessageDispl