Methods for Control Class

The table lists the methods for the Control class.

Control Class

Method Return Value Description
getBackgroundColor()
String Returns the background color for an element.

The color may be either a hexadecimal value of the form #RRGGBB, or one of the standard W3C colors as listed at:

http://www.w3.org/TR/CSS1/#color-units

This method will return the property value previously set via the corresponding set method. This will not return the original value set in the designer, which is only available in the form CSS.

getClassName()
String Returns custom CSS classnames set on the control. 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.
getControlType()
String Returns the control type of this control (for example, 
com.tibco.forms.controls.textbox).
getCustomComponentName()
String Returns the fully-qualified control type name as defined in the component library for the given control. If the control is not a custom control, the method returns null.
getEnabled()
Boolean Retrieves the enabled flag for this control.
getFontColor()
String Retrieves the font color for this control. The font color may be either a hexadecimal value of the form #RRGGBB, or one of the standard W3C colors as listed at:

http://www.w3.org/TR/CSS1/#color-units

This method will return the property value previously set via the corresponding set method. This will not return the original value set in the designer, which is only available in the form CSS.

getFontName()
String Returns the name of the font for an element.

This method will return the property value previously set via the corresponding set method. This will not return the original value set in the designer, which is only available in the form CSS.

getFontSize()
Number Returns the size of the font for the element.

This method will return the property value previously set via the corresponding set method. This will not return the original value set in the designer, which is only available in the form CSS.

getFontWeight()
String Returns the weight of the font for an element. The return value can be either "normal", or "bold".

This method will return the property value previously set via the corresponding set method. This will not return the original value set in the designer, which is only available in the form CSS.

getForm()
Form Returns the form to which this control belongs.
getHint()
String Retrieves the hint for this control.
getLabel()
String Retrieves the label for this control.
getLink()
String Returns the URL used by a hyperlink control.
getLinkText()
String Returns the visible text rendered by a hyperlink control.
getOptionLabels()
String[] Returns an array of choice labels displayed by a radiogroup or optionlist control.
getOptionValues()
String[] Returns an array of choice values offered by a radiogroup or optionlist control.
getShortLabel()
String Retrieves the short label associated with this control.

The short label property is supported only for mobile forms.

getName()
String Returns the name of this control.
getParent()
Pane Returns the parent pane object to which this control belongs.
getReadOnly()
Boolean Returns the read-only state of this control.
getRequired()
Boolean Retrieves or sets the required flag for this control.
getTabIndex()
Integer Returns the tab index setting configured on the control, or 0 if it is not set. This is useful for custom controls that support the setting of the tab index in their HTML markup.
getUrl()
String Returns the URL used by an image control.
getValue()
Object Retrieves the value of this control. Equivalent to f.controlname (deprecated).

This is either a Duration object or a native JavaScript Boolean, Date, String or Number value depending on the control type. Controls configured for list editing or multi-select drop-down lists return an array of the underlying control value type. Date, Time, and DateTime controls return a Date object. Checkbox controls return a Boolean. Duration controls return a Duration object. Numeric text input controls return a Number. All others return String.

getVisible()
Boolean Retrieves the visible flag for this control.
getVisualProperty()

(deprecated in 2.0)

String Retrieves visual properties on the control.

The only property supported in versions prior to 2.x was bgColor. The value for bgColor is hexadecimal, and is the same format as for font color.

isReallyEnabled()
Boolean The enabled setting of a control is controlled both by its own enabled property, and the enabled properties of any of its ancestors. If the parent pane of a control is disabled, then isReallyEnabled() returns false for that control. The method returns true only if it's own enabled property is true and all of its ancestor's enabled properties are set to true.
isReallyReadOnly()
Boolean Returns the read-only state of this control.
isReallyVisible()
Boolean The visibility of a control is controlled both by its own visibility property, and the visibility properties of any of its ancestors. If the parent pane of a control is not visible, then isReallyVisible() returns false for that control. The method returns true only if it's own visibility property is true and all of its ancestor's visibility properties are set to true.
setBackgroundColor
(String color)
Void Sets the background color for the element.

The color may be either a hexadecimal value of the form #RRGGBB, or one of the standard W3C colors as listed at:

http://www.w3.org/TR/CSS1/#color-units

setClassName(
String className)
Void Sets the custom CSS classnames on the control. The value may be null, a single CSS classname, or a space-separated list of CSS classnames that are applied to the component level of the control. The value replaces any previously set classname whether that was set in the model or by a previous call to setClassName().
setEnabled(Boolean enabledFlag)
Void Sets the enabled flag for this control.
setFocus()
Void Sets focus on this control.
setFocus(Integer)
Void Sets focus on this control. The API has following optional parameter:
  • index: Use this parameter for controls within a grid or record pane. Sets the focus on a control instance in the row specified by the given index. If the specified row is not visible, scrolls the grid control to the specified row and page. If the specified row does not exist, logs a warning message and does not shift the focus. This parameter is ignored if the control is in a singleton pane (for instance vertical pane, horizontal pane, and so on). The default value is 0.
setFocus(Integer index, Integer item)
Void Sets focus on the control. The API has following two optional parameters:
  • index: Use this parameter for controls within a grid or record pane. Sets the focus on a control instance in the row specified by the given index. If the specified row is not visible, scrolls the grid control to the specified row and page. If the specified row does not exist, logs a warning message and does not shift the focus. This parameter is ignored if the control is in a singleton pane (for instance vertical pane, horizontal pane, and so on). The default value is 0.
  • item: Is used for list controls and specifies the item within the list that is to receive the focus. If the specified item does not exist, logs a warning message and does not shift the focus. This parameter is ignored if the control is not a list control. The default value is 0.

    The optional parameters need not be specified for controls that are in a singleton pane (for instance vertical pane, horizontal pane, and so on).

    For a tabbed pane, you need to activate the particular tab (See setActiveTab() API on pane) before calling this API on a control within the corresponding child pane.

setFontColor(String color)
Void Sets the font color for this control. The font color may be either a hexadecimal value of the form #RRGGBB, or one of the standard W3C colors as listed at:

http://www.w3.org/TR/CSS1/#color-units

setFontName(String fontName)
Void Sets the name of the font for an element.

The fontName parameter is provided as a string to specify the name of the font.

setFontSize(Integer size)
Void Sets the size of the font for an element.

The size parameter is provided as an integer to specify the font size in points.

setFontWeight(String weight)
Void Sets the weight of the font for an element.

The weight parameter is provided as a string to specify the weight of the font. It can be either "normal", or "bold".

setHint(String hint)
Void Sets the hint for this control.
setLabel(String label)
Void Sets the label for this control.
setOptions(String[] values, String[] labels)
Void Sets the choice values and labels used by a radiogroup or optionlist control. The values and labels arrays must have the same length. The values array must not contain any null elements.
setShortLabel(String shortLabel)
Void Sets the short label to be used for this control.

The short label property is supported only for mobile forms.

setRequired
(Boolean requiredFlag)
Void Sets the required flag for this control.
setValue(Object value)
Void Sets the value rendered by this control.

Date, Time, and DateTime controls expects a Date object. Multi-select drop-down lists expect an array of Strings. Checkboxes expects a Boolean. Duration controls expects a Duration object. Numeric Text Input controls expects a Number. All other controls expect a String value. If the control is configured as a list control, then it expects an array of the underlying type.

setVisible(Boolean visibleFlag)
Void Sets the visible flag for this control. If used from an action script for a control in a grid pane, this controls the visibility of the entire column represented by this control. If you update the visibility property of a control in a grid pane using a computation action, the setting applies to each cell in the column, but does not affect the visibility of the column itself.
setVisualProperty( String propName, String propValue)

(deprecated in 2.0)

Void Sets visual properties on the control.

The only property supported in versions prior to 2.x was bgColor. The value for bgColor is hexadecimal, and is the same format as for font color.

setLink(String url)
Void Sets the URL used by a hyperlink control.
setLinkText(String text)
Void Sets the visible text rendered by a hyperlink control.
setReadOnly(Boolean readOnly)
Void Sets the read-only state of the control. This differs from setting the control to disabled as the user can still copy the value within the control.

This is only supported for text, textarea, date, datetime, time, and duration controls.

setUrl(String url)
Void Sets the URL used by an image control.
validate(Boolean updateMessagePane)
Boolean Forces validation to run on the control. Returns true if all validations for the control return true. If updateMessagePane is true, then validation messages are displayed in the messages pane for any validation that failed. If the control is not visible, the validation runs, but updateMessagePane is ignored. If updateMessagePane is not specified, it is treated as false.