Skip to main content

%CSP.Util.AutoForm

abstract class %CSP.Util.AutoForm

This class is used internally by Caché. You should not make direct use of it within your applications. There is no guarantee made about either the behavior or future operation of this class.

This class provides a mechanism to automatically generate HTML forms (using CSP). Subclasses of this class can automatically generate HTML forms and tables.

Method Inventory

Parameters

parameter COMMANDFORM = 0;
If true (1) then this is a specialized type of form that only displays submit buttons and no INPUT fields.
parameter DOMAIN = %Utility;
Default domain for the Portal's localization.
parameter FORMCOLUMNS = 1;
Number of columns used to layout forms for this class

Methods

classmethod CreateInstance(ByRef pID As %String) as AutoForm
Create an instance of the AutoForm object using the provided ID value(s). This is overridden by subclasses.
The default implementation will perform an OpenId if the AutoForm is a persistent object.
classmethod DispatchSubmit(pSubmit As %String) as %Status
This method invokes a submit on the appropriate form class. Do not call this method directly; use DoSubmit instead.
classmethod DoSubmit() as %String
Common expiration date used for cookies Test if an AutoForm is being submitted If so, process it and return the name of the submit button or "" if there is not a submit. For a AUTOFORM_CANCEL, return "$AUTOFORM_CANCEL" without processing...
classmethod DrawFormButtons(ByRef pButtons As FormButton)
Draw the buttons for a form...
classmethod DrawHTMLForm(pObj As %RegisteredObject, ByRef pID As %String, pActionURL As %String = "", ByRef pButtons As FormButton, pTarget As %String = "") as %Status
Draw an HTML form for this form object.
pObj is an instance of the form object that provides the initial values for the form.
pActionURL is the URL to submit this form to.
pButtons is an array of submit buttons to display for the form. If not provided, the default Save and Cancel buttons are shown. pButtons is an integer-subscripted array of FormButton objects.
classmethod DrawHTMLTable(pObj As %RegisteredObject, ByRef pID As %String) as %Status
Draw an HTML detail table for this form object.
pObj is an instance of the form object that provides the values for the table.
classmethod GetComboBoxHTML(pValue As %String, pName As %String, pClass As %String, pQuery As %String, pCaptionColumn As %String, pValueColumn As %String = "", pP1 As %String = "", pP2 As %String = "", pP3 As %String = "") as %String
Construct an HTML string defining a combo box for the given query.
pName is the name to use for the SELECT control.
pValue is the current value of the property.
Returns the HTML to display.
classmethod GetFormError() as %String
Get error message to be displayed within an AutoForm.
abstract classmethod OnDefineButtons(ByRef pButtons As FormButton)
Subclasses can override this to redefine the buttons for a form
method OnSubmit(ByRef pID As %String, pSubmit As %String) as %Status
This callback is called when this form is submitted. pID is the ID value associated with the form. The default implementation will perform a Save if the AutoForm is a persistent object.
pSubmit is the name of the submit button (i.e., $AUTOFORM_SAVE).
classmethod ProcessSubmit(pRequest As %CSP.Request, ByRef pID As %String = "", Output pErrorMsg As %String) as AutoForm
Takes submitted data for a form and returns an instance of AutoForm object
classmethod SetFormError(pMsg As %String)
Set a error message to be displayed within an AutoForm.
classmethod Submit(pRequest As %CSP.Request, pSubmit As %String) as %Status
Called by the page handler when a form is submitted.
pSubmit is the name of the submit button (i.e., $AUTOFORM_SAVE).

Subclasses

FeedbackOpens in a new tab