Methods for Form Class

The table lists the methods for the Form class.

Form Class

Method Return Value Description
getClassName()
String Returns custom CSS classnames set on the form. The value may be null, a single CSS classname, or a space-separated list of CSS classnames that are applied to the root level of the form.
getControl(String controlName)
Control Returns the control with the given name.
getLocale()
String Returns the string representation of the locale currently being used to render the form.
getPane(String paneName)
Pane Returns the pane with the given name.
getPanes()
Pane[] Returns an array of root panes of this form.
getParameterValue( String paramName)
Object

List

Array

Returns the value of the parameter or data field with the given name. This is either a list, an array, or a duration object, BOM JavaScript wrapper object or native JavaScript Boolean, Date, Number or String object, depending on the type of parameter.
invokeAction(
String actionName, 
Object control), Context context
  Invokes the shared or default action specified by the actionName parameter. The object passed as the control parameter is used as the this variable inside the script of the invoked action. The third argument is used as the context variable in the invoked script. If the third argument is null, then a default context is used in the invoked script. Example usage:
context.form.invokeAction(’submit’, this, context);

Either a shared action defined for the form or one of the pre-defined actions can be used with the invokeAction method. The pre-defined actions are: submit, apply, close, cancel, validate, and reset.

isNumber(Object value, Integer length)
Boolean Validates whether the value passed is a number or not. It returns true if the parameter value is a number, and false otherwise. The method also has an optional length : Integer parameter. (To be deprecated, use Util.checkNumeric() and Util.checkNumberConstraints() instead.)
maxLength(
Object value, Integer length)
Boolean Validates whether the value passed is less than the length specified. Used to validate the length of parameters like strings and numbers. It returns true if the value passed is less than length specified, false otherwise.
numberFormat(
Object value,  
Integer totalLength, 
Integer decimalLength)
Boolean Validates whether the number represented by the value parameter is less than totalLength parameter and number of decimal digits is less than decimalLength specified. It returns true if the value passed is less than length specified in terms of both total length and length of the decimal digits, false otherwise.
setClassName(
String className)
Void Sets the custom CSS classnames on the form. The value may be null, a single CSS classname, or a space-separated list of CSS classnames that are applied to the root level of the form. The value replaces any previously set classname whether that was set in the model or by a previous call to setClassName().
setLocale(String locale)
  Sets the value of locale used to render the form. It represents the locale, for example, "en" or "en_US".
setParameterValue( String paramName, Object paramValue)
Void Sets the value of the parameter with the given name. The value should be either a Duration object, BOM JavaScript wrapper object or native JavaScript Boolean, Date, Number or String object, depending on the type of parameter.
validate(Boolean updateMessagePane)
Boolean Forces validation to run on the form and all child panes and controls. Returns true if all validations return true. If updateMessagePane is true, then validation messages are displayed in the messages pane for any validation that failed. If updateMessagePane is not specified, it is treated as false.