FormTextField¶
Definition¶
Extends¶
Extended By¶
None
Description¶
A single-line text input field within a FormPanel.
Method Summary¶
| Owner | Name | Return Type | Description |
|---|---|---|---|
| FormTextField | addOptions(options) | Boolean | Adds to the field's options the values in the list |
| FormField | clearError() | Boolean | Clears the error message on this field. |
| FormTextField | clearOptions() | Boolean | Removes all options |
| DashboardResource | commit() | Object | Commits transient changes, promoting overrides to persisted values. If transient, makes permanent. |
| FormField | exportConfig() | Map | Exports this field's configuration to a map. |
| FormField | focus() | Boolean | Requests user input be focused on this field, will make panel visible if necessary. Returns false if this field can not be focused. Note that the focus is not immediate, meaning a call to isFocused() directly after calling focus may still return false |
| FormField | getAnchors() | Map | The field's current position keys, in the same vocabulary setAnchors() accepts. Only the keys actually in force are present, so the set of keys returned tells you which anchoring mode the field is in. |
| FormTextField | getAutocompleteDelimiter() | String | Returns the autocomplete delimiter. |
| DashboardResource | getCallback(callbackName) | Callback | Returns a callback by name |
| DashboardResource | getCallbackNames() | List | Returns the callback names defined for this dashboard resource. Use session.getDevTools().getCallbackEditor(resource, callbackName) to edit one, and call editor.open() when you want to show the UI. |
| DashboardResource | getCallbacks() | Map | Returns a map of all callback definitions. |
| DashboardResource | getChildren() | List | Returns a list of the child dashboard resources. |
| Object | getClassName() | String | Returns the string name of this object's class type. |
| FormField | getCssClass() | String | Returns the CSS class. |
| FormTextField | getCursor() | Integer | Returns this cursors position |
| DashboardResource | getDRI() | String | Returns the Dashboard Resource Indicator (DRI) as a string. DRI is the unique identifier of an object within the entire dashboard. |
| DashboardResource | getDashboardResourceType() | String | Returns the Dashboard Resource Type as a string |
| FormField | getDisabled() | Boolean | Returns true if field is disabled, false otherwise. |
| FormField | getDisplayMode() | String | DEPRECATED, use isVisible instead. Returns display type of field. Will return "ABSOLUTE" if field is displayed using absolute positioning. Will return "HTML" if field is displayed using form HTML. |
| FormTextField | getDisplayValueSortOption() | String | Returns the sort option set for the display values. |
| FormField | getError() | String | Returns the error message currently shown against this field, or null if it has none. |
| FormField | getFieldValue(varName) | Object | Returns the value of the field with the associated varName for the form that owns this field. |
| DashboardResource | getFormula(formulaName) | Formula | Returns a Formula given the formula name. |
| DashboardResource | getFormulaNames() | Set | Returns a set of the names of all formulas for this object. |
| DashboardResource | getFormulas() | Map | Returns a map of all available formulas for this object. The key is the formula name. |
| DashboardResource | getLRI() | String | Returns the Localized Resource Indicator (LRI) as a string. LRI is the unique identifier of this resource with the parent element. |
| FormField | getLabel() | String | Returns the label associated with this field. |
| FormField | getLabelTooltip() | String | Returns the tooltip associated with this field's label. |
| FormTextField | getOptions() | Collection | Returns a set of all options |
| FormField | getOwner() | FormPanel | Returns the FormPanel that owns this object. |
| FormField | getPanel() | FormPanel | Returns the panel that contains this field. |
| FormField | getPosition() | Rectangle | Returns a Rectangle object representing the field's position as (x,y,w,h). |
| FormField | getStyleSet() | StyleSet | Returns the StyleSet for this form field. |
| FormTextField | getValue() | String | Returns this field's value. |
| FormField | getVariableName() | String | Returns the variable name associated with this field. |
| FormField | hasError() | Boolean | Returns true if this field currently has an error message, false otherwise. |
| DashboardResource | invokeCallback(callbackName, args) | Object | Executes the specified callback definition and returns the result from the callback. |
| FormField | isAtDefaultPosition() | Boolean | Returns whether field is at the default position specified in field editor. |
| FormField | isFocused() | Boolean | Returns true if this field has focus, false otherwise. |
| FormTextField | isShowOptionsImmediately() | Boolean | Returns true if dropdown options are being shown immediately after the field is focused, false otherwise. |
| FormTextField | isSubstringMatching() | Boolean | Returns true if substring matching is used for searching in the field, false otherwise. |
| FormField | isTransient() | Boolean | Returns whether a field is transient. |
| FormField | isVisible() | Boolean | Returns true if this field is visible, false otherwise. |
| FormTextField | putOption(option) | Boolean | Adds the option to the textfield |
| FormTextField | removeOption(option) | Boolean | Removes the option from the textfield |
| FormField | resetCssClass() | Boolean | Resets CSS class to default (as configured in AMI editor). |
| FormField | resetDisabled() | Boolean | Resets the disabled flag to default (as configured in AMI editor). |
| FormTextField | resetOptions() | Object | If options have been manually set using amiscript, this resets to the default values |
| FormField | resetPosition() | Boolean | Resets field position to default position specified in field editor. |
| FormField | setAnchors(anchors) | Boolean | Set this field's position by anchor, rather than as a fixed box. Which keys you supply decides how the field behaves when the panel resizes: left+width is fixed forever, left+right keeps a fixed gutter each side and stretches, leftPct+rightPct tracks the panel proportionally. Vertical works the same with top/bottom/height. minWidth/maxWidth (and the height pair) clamp whatever those keys work out to, so a proportional field neither collapses on a narrow panel nor sprawls on a wide one. On a field positioned by anchors they clamp that field alone and take no space from its neighbours, so a floor big enough to matter will overlap them and a cap leaves a hole beside them; if the field is a member of a layout group, the group divides its box so the floor is met without overlapping and hands back what the cap refused. This replaces the whole position spec and any key you omit is cleared. |
| FormTextField | setAutocompleteDelimiter(delimiter) | Boolean | Sets the delimiter for autocomplete values. (i.e. setting delimiter to " |
| FormField | setCssClass(cssStyle) | Boolean | Sets CSS class. Returns empty string for no css. |
| FormTextField | setCursor(position) | Integer | Sets this cursors position |
| FormField | setDisabled(disabled) | Boolean | Set the disabled status of the field (true for disabling, false for enabling). |
| FormField | setDisplayMode(mode) | Boolean | DEPRECATED, use setVisible instead. Sets display mode of field. Setting to "ABSOLUTE" will display field using absolute positioning. Setting to "HTML" will allow field to be displayed using the form HTML. Any other input will throw an exception. |
| FormTextField | setDisplayValueSortOption(displaySortOption) | Boolean | Sets the sorting option for the display values in the autocomplete menu. |
| FormField | setError(error) | Boolean | Shows an error message against this field. Passing null or an empty message clears it. The message is never saved with the layout. Depending on the field's Error Indication style, the field itself may also be recoloured. |
| FormField | setFieldValue(key, value) | Boolean | Sets the key value pair to this portlet's attributes and returns true if successful. For key, put in the field's variable name, then set the value. |
| FormField | setLabelTooltip(tooltip) | Boolean | Sets the label tooltip. |
| FormTextField | setOptions(options) | FormTextField | sets the options for textfield |
| FormField | setPosition(x, y, w, h) | Boolean | Sets the field position. Specify (x,y) position, width, and height in pixels. Passing null to an argument is equivalent to not setting a value for that specific argument. |
| FormField | setPosition(rect) | Boolean | Sets the position, if the position is null then resets the overrides |
| FormTextField | setSelected(start, end) | Object | selects a range of text |
| FormTextField | setShowOptionsImmediately(showOptionsImmediately) | Boolean | Setting it to true will cause the field to shows dropdown with options immediately after the field is focused. Setting to false will show the dropdown as characters are being typed. Returns true on successful set, false otherwise. |
| FormTextField | setSubstringMatching(performSubstringMatching) | Boolean | Setting it to true will cause the field to use substring matching when searching for values in the field. Setting to false will perform searching based on starting characters. Returns true on successful set, false otherwise. |
| FormField | setValue(value) | Boolean | Set this field's value. This is a generic set method that is available for every field in AMI. For FormRangeSlider and FormImage field, it is advisable to use their own setValue() method. |
| FormField | setVisible(visible) | Boolean | Sets the visibility of this field. Returns false iff the argument is null, true otherwise. |
| Object | toJson() | String | Returns a string of a json representation of this object. |
| FormField | validate() | Boolean | Calls onValidate() on this field, showing the returned message as the field's error or clearing it when nothing is returned. A field with no onValidate() is left alone, so an error set by setError() is not cleared, and it passes. A validator that queries a datasource suspends this script until it answers, and a validator that throws fails the field with 'Unexpected Error'. Returns true if the field passed. |
Method Definitions¶
addOptions(options)¶
Boolean FormTextField::addOptions(Collection options)
Description¶
Adds to the field's options the values in the list
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| options | Collection | Options to be added |
clearError()¶
Boolean FormField::clearError()
Description¶
Clears the error message on this field.
clearOptions()¶
Boolean FormTextField::clearOptions()
Description¶
Removes all options
commit()¶
Object DashboardResource::commit()
Description¶
Commits transient changes, promoting overrides to persisted values. If transient, makes permanent.
exportConfig()¶
Description¶
Exports this field's configuration to a map.
focus()¶
Description¶
Requests user input be focused on this field, will make panel visible if necessary. Returns false if this field can not be focused. Note that the focus is not immediate, meaning a call to isFocused() directly after calling focus may still return false
getAnchors()¶
Description¶
The field's current position keys, in the same vocabulary setAnchors() accepts. Only the keys actually in force are present, so the set of keys returned tells you which anchoring mode the field is in.
getAutocompleteDelimiter()¶
String FormTextField::getAutocompleteDelimiter()
Description¶
Returns the autocomplete delimiter.
getCallback(callbackName)¶
Callback DashboardResource::getCallback(String callbackName)
Description¶
Returns a callback by name
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| callbackName | String | method name of callback |
getCallbackNames()¶
List DashboardResource::getCallbackNames()
Description¶
Returns the callback names defined for this dashboard resource. Use session.getDevTools().getCallbackEditor(resource, callbackName) to edit one, and call editor.open() when you want to show the UI.
getCallbacks()¶
Map DashboardResource::getCallbacks()
Description¶
Returns a map of all callback definitions.
getChildren()¶
List DashboardResource::getChildren()
Description¶
Returns a list of the child dashboard resources.
getClassName()¶
Description¶
Returns the string name of this object's class type.
getCssClass()¶
String FormField::getCssClass()
Description¶
Returns the CSS class.
getCursor()¶
Integer FormTextField::getCursor()
Description¶
Returns this cursors position
getDRI()¶
String DashboardResource::getDRI()
Description¶
Returns the Dashboard Resource Indicator (DRI) as a string. DRI is the unique identifier of an object within the entire dashboard.
getDashboardResourceType()¶
String DashboardResource::getDashboardResourceType()
Description¶
Returns the Dashboard Resource Type as a string
getDisabled()¶
Boolean FormField::getDisabled()
Description¶
Returns true if field is disabled, false otherwise.
getDisplayMode()¶
String FormField::getDisplayMode()
Description¶
DEPRECATED, use isVisible instead. Returns display type of field. Will return "ABSOLUTE" if field is displayed using absolute positioning. Will return "HTML" if field is displayed using form HTML.
getDisplayValueSortOption()¶
String FormTextField::getDisplayValueSortOption()
Description¶
Returns the sort option set for the display values.
getError()¶
Description¶
Returns the error message currently shown against this field, or null if it has none.
getFieldValue(varName)¶
Object FormField::getFieldValue(String varName)
Description¶
Returns the value of the field with the associated varName for the form that owns this field.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| varName | String | fieldVarName |
getFormula(formulaName)¶
Formula DashboardResource::getFormula(String formulaName)
Description¶
Returns a Formula given the formula name.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| formulaName | String | name of the formula to return |
getFormulaNames()¶
Set DashboardResource::getFormulaNames()
Description¶
Returns a set of the names of all formulas for this object.
getFormulas()¶
Map DashboardResource::getFormulas()
Description¶
Returns a map of all available formulas for this object. The key is the formula name.
getLRI()¶
String DashboardResource::getLRI()
Description¶
Returns the Localized Resource Indicator (LRI) as a string. LRI is the unique identifier of this resource with the parent element.
getLabel()¶
Description¶
Returns the label associated with this field.
getLabelTooltip()¶
String FormField::getLabelTooltip()
Description¶
Returns the tooltip associated with this field's label.
getOptions()¶
Collection FormTextField::getOptions()
Description¶
Returns a set of all options
getOwner()¶
FormPanel FormField::getOwner()
Description¶
Returns the FormPanel that owns this object.
getPanel()¶
FormPanel FormField::getPanel()
Description¶
Returns the panel that contains this field.
getPosition()¶
Rectangle FormField::getPosition()
Description¶
Returns a Rectangle object representing the field's position as (x,y,w,h).
getStyleSet()¶
StyleSet FormField::getStyleSet()
Description¶
Returns the StyleSet for this form field.
getValue()¶
String FormTextField::getValue()
Description¶
Returns this field's value.
getVariableName()¶
String FormField::getVariableName()
Description¶
Returns the variable name associated with this field.
hasError()¶
Description¶
Returns true if this field currently has an error message, false otherwise.
invokeCallback(callbackName,args)¶
Object DashboardResource::invokeCallback(String callbackName, Object ... args)
Description¶
Executes the specified callback definition and returns the result from the callback.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| callbackName | String | method name of callback |
| args | Object ... | arguments |
isAtDefaultPosition()¶
Boolean FormField::isAtDefaultPosition()
Description¶
Returns whether field is at the default position specified in field editor.
isFocused()¶
Boolean FormField::isFocused()
Description¶
Returns true if this field has focus, false otherwise.
isShowOptionsImmediately()¶
Boolean FormTextField::isShowOptionsImmediately()
Description¶
Returns true if dropdown options are being shown immediately after the field is focused, false otherwise.
isSubstringMatching()¶
Boolean FormTextField::isSubstringMatching()
Description¶
Returns true if substring matching is used for searching in the field, false otherwise.
isTransient()¶
Boolean FormField::isTransient()
Description¶
Returns whether a field is transient.
isVisible()¶
Boolean FormField::isVisible()
Description¶
Returns true if this field is visible, false otherwise.
putOption(option)¶
Boolean FormTextField::putOption(String option)
Description¶
Adds the option to the textfield
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| option | String | Option to be added |
removeOption(option)¶
Boolean FormTextField::removeOption(Object option)
Description¶
Removes the option from the textfield
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| option | Object | Option to be removed |
resetCssClass()¶
Boolean FormField::resetCssClass()
Description¶
Resets CSS class to default (as configured in AMI editor).
resetDisabled()¶
Boolean FormField::resetDisabled()
Description¶
Resets the disabled flag to default (as configured in AMI editor).
resetOptions()¶
Object FormTextField::resetOptions()
Description¶
If options have been manually set using amiscript, this resets to the default values
resetPosition()¶
Boolean FormField::resetPosition()
Description¶
Resets field position to default position specified in field editor.
setAnchors(anchors)¶
Boolean FormField::setAnchors(Map anchors)
Description¶
Set this field's position by anchor, rather than as a fixed box. Which keys you supply decides how the field behaves when the panel resizes: left+width is fixed forever, left+right keeps a fixed gutter each side and stretches, leftPct+rightPct tracks the panel proportionally. Vertical works the same with top/bottom/height. minWidth/maxWidth (and the height pair) clamp whatever those keys work out to, so a proportional field neither collapses on a narrow panel nor sprawls on a wide one. On a field positioned by anchors they clamp that field alone and take no space from its neighbours, so a floor big enough to matter will overlap them and a cap leaves a hole beside them; if the field is a member of a layout group, the group divides its box so the floor is met without overlapping and hands back what the cap refused. This replaces the whole position spec and any key you omit is cleared.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| anchors | Map | position keys, same vocabulary as the panel JSON: left, right, width, leftPct, rightPct, widthPct, horizontalOffsetPct, top, bottom, height, topPct, bottomPct, heightPct, verticalOffsetPct, maxWidth, maxHeight, minWidth, minHeight |
setAutocompleteDelimiter(delimiter)¶
Boolean FormTextField::setAutocompleteDelimiter(String delimiter)
Description¶
Sets the delimiter for autocomplete values. (i.e. setting delimiter to "|" will reset the autocomplete after each occurence of "|").
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| delimiter | String | Delimiter for autocomplete values. Length cannot be greater than 5 characters. |
setCssClass(cssStyle)¶
Boolean FormField::setCssClass(String cssStyle)
Description¶
Sets CSS class. Returns empty string for no css.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| cssStyle | String |
setCursor(position)¶
Integer FormTextField::setCursor(Integer position)
Description¶
Sets this cursors position
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| position | Integer | position, with zero being on the left) |
setDisabled(disabled)¶
Boolean FormField::setDisabled(Boolean disabled)
Description¶
Set the disabled status of the field (true for disabling, false for enabling).
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| disabled | Boolean | true to disable, false to enable |
setDisplayMode(mode)¶
Boolean FormField::setDisplayMode(String mode)
Description¶
DEPRECATED, use setVisible instead. Sets display mode of field. Setting to "ABSOLUTE" will display field using absolute positioning. Setting to "HTML" will allow field to be displayed using the form HTML. Any other input will throw an exception.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| mode | String | Display mode |
setDisplayValueSortOption(displaySortOption)¶
Boolean FormTextField::setDisplayValueSortOption(String displaySortOption)
Description¶
Sets the sorting option for the display values in the autocomplete menu.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| displaySortOption | String | Expected Values: NONE (original ordering), ASC, DESC |
setError(error)¶
Boolean FormField::setError(String error)
Description¶
Shows an error message against this field. Passing null or an empty message clears it. The message is never saved with the layout. Depending on the field's Error Indication style, the field itself may also be recoloured.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| error | String | The message to show, or null to clear it. |
setFieldValue(key,value)¶
Boolean FormField::setFieldValue(String key, Object value)
Description¶
Sets the key value pair to this portlet's attributes and returns true if successful. For key, put in the field's variable name, then set the value.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| key | String | |
| value | Object |
setLabelTooltip(tooltip)¶
Boolean FormField::setLabelTooltip(String tooltip)
Description¶
Sets the label tooltip.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| tooltip | String |
setOptions(options)¶
FormTextField FormTextField::setOptions(Collection options)
Description¶
sets the options for textfield
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| options | Collection | list of options |
setPosition(x,y,w,h)¶
Boolean FormField::setPosition(Integer x, Integer y, Integer w, Integer h)
Description¶
Sets the field position. Specify (x,y) position, width, and height in pixels. Passing null to an argument is equivalent to not setting a value for that specific argument.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| x | Integer | x-coordinate |
| y | Integer | y-coordinate |
| w | Integer | Width |
| h | Integer | Height |
setPosition(rect)¶
Boolean FormField::setPosition(Rectangle rect)
Description¶
Sets the position, if the position is null then resets the overrides
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| rect | Rectangle | rectangle |
setSelected(start,end)¶
Object FormTextField::setSelected(Integer start, Integer end)
Description¶
selects a range of text
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| start | Integer | start position which is inclusive |
| end | Integer | end position, which is exclusive |
setShowOptionsImmediately(showOptionsImmediately)¶
Boolean FormTextField::setShowOptionsImmediately(Boolean showOptionsImmediately)
Description¶
Setting it to true will cause the field to shows dropdown with options immediately after the field is focused. Setting to false will show the dropdown as characters are being typed. Returns true on successful set, false otherwise.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| showOptionsImmediately | Boolean | true or false |
setSubstringMatching(performSubstringMatching)¶
Boolean FormTextField::setSubstringMatching(Boolean performSubstringMatching)
Description¶
Setting it to true will cause the field to use substring matching when searching for values in the field. Setting to false will perform searching based on starting characters. Returns true on successful set, false otherwise.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| performSubstringMatching | Boolean | true or false |
setValue(value)¶
Boolean FormField::setValue(Object value)
Description¶
Set this field's value. This is a generic set method that is available for every field in AMI. For FormRangeSlider and FormImage field, it is advisable to use their own setValue() method.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| value | Object | value |
setVisible(visible)¶
Boolean FormField::setVisible(Boolean visible)
Description¶
Sets the visibility of this field. Returns false iff the argument is null, true otherwise.
Parameter Definition¶
| Name | Type | Description |
|---|---|---|
| visible | Boolean | true for visible, false for hidden. |
toJson()¶
Description¶
Returns a string of a json representation of this object.
validate()¶
Description¶
Calls onValidate() on this field, showing the returned message as the field's error or clearing it when nothing is returned. A field with no onValidate() is left alone, so an error set by setError() is not cleared, and it passes. A validator that queries a datasource suspends this script until it answers, and a validator that throws fails the field with 'Unexpected Error'. Returns true if the field passed.