|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.core.RefDataClass
com.smartgwt.client.widgets.form.fields.FormItem
public class FormItem
An Item that can participate in a DynamicForm, managing some value.
FormItems are never directly created, instead,
FormItem descriptors are passed to a DynamicForm. See the DynamicForm
documentation for details.
| Field Summary |
|---|
| Fields inherited from class com.smartgwt.client.core.JsObject |
|---|
jsObj |
| Constructor Summary | |
|---|---|
FormItem()
|
|
FormItem(JavaScriptObject jsObj)
|
|
FormItem(java.lang.String name)
|
|
| Method Summary | |
|---|---|
HandlerRegistration |
addBlurHandler(BlurHandler handler)
Add a blur handler. |
HandlerRegistration |
addChangedHandler(ChangedHandler handler)
Add a changed handler. |
HandlerRegistration |
addChangeHandler(ChangeHandler handler)
Add a change handler. |
HandlerRegistration |
addClickHandler(ClickHandler handler)
Add a click handler. |
HandlerRegistration |
addDoubleClickHandler(DoubleClickHandler handler)
Add a doubleClick handler. |
HandlerRegistration |
addFocusHandler(FocusHandler handler)
Add a focus handler. |
HandlerRegistration |
addIconClickHandler(IconClickHandler handler)
Add a iconClick handler. |
HandlerRegistration |
addIconKeyPressHandler(IconKeyPressHandler handler)
Add a iconKeyPress handler. |
HandlerRegistration |
addItemHoverHandler(ItemHoverHandler handler)
Add a itemHover handler. |
HandlerRegistration |
addKeyDownHandler(KeyDownHandler handler)
Add a keyDown handler. |
HandlerRegistration |
addKeyPressHandler(KeyPressHandler handler)
Add a keyPress handler. |
HandlerRegistration |
addKeyUpHandler(KeyUpHandler handler)
Add a keyUp handler. |
HandlerRegistration |
addTitleClickHandler(TitleClickHandler handler)
Add a titleClick handler. |
HandlerRegistration |
addTitleDoubleClickHandler(TitleDoubleClickHandler handler)
Add a titleDoubleClick handler. |
HandlerRegistration |
addTitleHoverHandler(TitleHoverHandler handler)
Add a titleHover handler. |
void |
blurItem()
Takes focus from this form item's focusable element. |
java.lang.Boolean |
canEditCriterion(Criterion criterion)
When a dynamic form is editing an advanced criteria object via DynamicForm.setValuesAsCriteria, this method is used
to determine which sub-criteria apply to which form item(s). |
void |
clearValue()
Clear the value for this form item. |
void |
disable()
Set this item to be disabled (shortcut for #setDisabled(Boolean),setDisabled(true)). |
void |
enable()
Set this item to be enabled (shortcut for #setDisabled(Boolean),setDisabled(false)). |
void |
focusInItem()
Move the keyboard focus into this item's focusable element |
java.lang.String |
getAccessKey()
AccessKey - a keyboard shortcut to trigger a form item's default behavior. Note: Alt+ (or in Moz Firefox 2.0 and above, Shift+Alt+) the specified key will trigger the form item's default behavior. |
Alignment |
getAlign()
Alignment of this item in its cell. |
java.lang.Boolean |
getAllowExpressions()
For a form that produces filter criteria (see form.getValuesAsCriteria()), allows the user to type in simple expressions to cause filtering with that operator. |
java.lang.Boolean |
getAlwaysFetchMissingValues()
If this form item has a specified optionDataSource and fetchMissingValues
is true, when the item value changes, a fetch will be performed against the optionDataSource to retrieve the related
record if displayField is specified and the
new item value is not present in any valueMap explicitly specified on the item. |
java.lang.String |
getAttribute(java.lang.String attribute)
|
java.lang.Boolean |
getAttributeAsBoolean(java.lang.String attribute)
|
java.util.Date |
getAttributeAsDate(java.lang.String attribute)
|
java.lang.Double |
getAttributeAsDouble(java.lang.String attribute)
|
java.lang.Float |
getAttributeAsFloat(java.lang.String attribute)
|
java.lang.Integer |
getAttributeAsInt(java.lang.String attribute)
|
JavaScriptObject |
getAttributeAsJavaScriptObject(java.lang.String attribute)
|
java.lang.String |
getAttributeAsString(java.lang.String attribute)
|
java.lang.Boolean |
getBrowserSpellCheck()
If this browser supports spell-checking of text editing elements, do we want this enabled for this item? If unset the property will be inherited from the containing form. |
java.lang.Boolean |
getCanFocus()
Is this form item focusable? Setting this property to true on an otherwise non-focusable element such as a StaticTextItem will cause the item to be included in the page's tab order and
respond to keyboard events. |
java.lang.Integer |
getCellHeight()
If specified, this property will govern the height of the cell in which this form item is rendered. |
java.lang.String |
getCellStyle()
CSS style applied to the form item as a whole, including the text element, any icons, and any hint text for the item. |
JavaScriptObject |
getConfig()
Returns the FormItem's config object suitable for use in API's that set the editorType |
Canvas |
getContainerWidget()
A Read-Only pointer to the Smart GWT canvas that holds this form item. |
java.lang.String |
getCriteriaField()
When using operator, the name of the DataSource
field for the Criterion this FormItem generates. |
Criterion |
getCriterion()
Override this method if you need to provide a specialized criterion from this formItem when creating an AdvancedCriteria via DynamicForm.getValuesAsCriteria. |
Criterion |
getCriterion(TextMatchStyle textMatchStyle)
Override this method if you need to provide a specialized criterion from this formItem when creating an AdvancedCriteria via DynamicForm.getValuesAsCriteria. |
java.lang.String |
getDataPath()
dataPath for this item. |
DateDisplayFormat |
getDateFormatter()
Display format to use for date type values within this formItem. |
java.lang.String |
getDefaultIconSrc()
Default icon image source. |
java.lang.Boolean |
getDisabled()
Whether this item is disabled. |
java.lang.String |
getDisplayField()
Specifies an alternative field from which display values should be retrieved for this item. |
java.lang.String |
getDisplayFieldName()
Returns the displayField for this form item. |
java.lang.String |
getDisplayValue()
Returns this item's value with any valueMap applied to it - the value as currently displayed to the user. |
java.lang.String |
getDisplayValue(java.lang.String value)
Returns this item's value with any valueMap applied to it - the value as currently displayed to the user. |
JavaScriptObject |
getEditorTypeConfig()
|
java.lang.String |
getEmptyDisplayValue()
Text to display when this form item has a null or undefined value. |
java.lang.String |
getEmptyValueIcon()
This property allows the developer to specify an icon to display when this item has no value. |
java.lang.Boolean |
getEndRow()
Whether this item should end the row it's in in the form layout |
int |
getErrorIconHeight()
Height of the error icon, if we're showing icons when validation errors occur. |
java.lang.String |
getErrorIconSrc()
URL of the image to show as an error icon, if we're showing icons when validation errors occur. |
int |
getErrorIconWidth()
Height of the error icon, if we're showing icons when validation errors occur. |
int |
getErrorMessageWidth()
When showInlineErrors and showErrorText are both true and errorOrientation is "left" or "right",
errorMessageWidth is the amount to reduce the width of the editor to accommodate the error message and icon. |
java.lang.Boolean |
getFetchMissingValues()
If this form item has a specified optionDataSource, should the item ever perform a fetch against this dataSource to retrieve the related record. |
java.lang.String |
getFieldName()
Return the name for the this formItem. |
java.lang.Boolean |
getFilterLocally()
If this form item is mapping data values to a display value by fetching records from a dataSource (see optionDataSource, displayField and fetchMissingValues), setting this property to
true ensures that when the form item value is set, entire data-set from the dataSource is loaded at once and used as a
valueMap, rather than just loading the display value for the current value. |
DynamicForm |
getForm()
A reference to the FormItem's DynamicForm. |
java.lang.String |
getFullDataPath()
Return the fully-qualified dataPath for the this formItem (ie, the dataPath expressed in absolute terms from the root of the hierarchy, rather than relative to the item's parent form). |
java.lang.Integer |
getGlobalTabIndex()
TabIndex for the form item within the page. |
int |
getHeight()
Height of the FormItem. |
java.lang.String |
getHint()
Specifies "hint" string to show next to the form item to indicate something to the user. |
java.lang.String |
getHintStyle()
CSS class for the "hint" string. |
Alignment |
getHoverAlign()
Text alignment for text displayed in this item's hover canvas, if shown. |
java.lang.Integer |
getHoverDelay()
If specified, this is the number of milliseconds to wait between the user rolling over this form item, and triggering any hover action for it. If not specified this.form.itemHoverDelay will be used instead. |
java.lang.Integer |
getHoverHeight()
Option to specify a height for any hover shown for this item. |
java.lang.Integer |
getHoverOpacity()
Opacity for any hover shown for this item |
java.lang.String |
getHoverStyle()
Explicit CSS Style for any hover shown for this item. |
VerticalAlignment |
getHoverVAlign()
Vertical text alignment for text displayed in this item's hover canvas, if shown. |
java.lang.Integer |
getHoverWidth()
Option to specify a width for any hover shown for this item. |
FormItemIcon |
getIcon(java.lang.String name)
Given an name return a pointer to the icon
definition |
int |
getIconHeight()
Default height for form item icons |
Rectangle |
getIconPageRect(FormItemIcon icon)
|
java.lang.String |
getIconPrompt()
Default prompt (and tooltip-text) for icons. |
Rectangle |
getIconRect(FormItemIcon icon)
|
VerticalAlignment |
getIconVAlign()
How should icons be aligned vertically for this form item. |
int |
getIconWidth()
Default width for form item icons |
java.lang.String |
getImageURLPrefix()
Prefix to apply to the beginning of any valueIcons when determining the URL for the image. |
java.lang.String |
getImageURLSuffix()
Suffix to apply to the end of any valueIcons when
determining the URL for the image. |
java.lang.Boolean |
getImplicitSave()
When true, indicates that changes to this item will cause an automatic save on a delay, as well as when the entire form is submitted. |
java.lang.Boolean |
getImplicitSaveOnBlur()
If not set to false, form item values will be saved when this item's "editorExit" handler is fired as well as on a delay and when the entire form is submitted. |
java.lang.String |
getInputFormat()
For fields of type "date", if this is an editable field such as a TextItem, this property allows you to specify the inputFormat applied to the item. |
int |
getLeft()
Left coordinate of this item in pixels. |
java.lang.String |
getLocateItemBy()
When AutoTest.getElement is used to parse locator strings generated by link{isc.AutoTest.getLocator()} for this form item, should the item be identified? By default if the item has a name this will always be used, however for items with no name, the following options are available: "title" use the title as an identifier within this
form "value" use the value of the item to identify it (often used for items with a static
defaultValue such as HeaderItems "index" use the index within the form's items array. |
java.lang.String |
getMultipleValueSeparator()
If this item is displaying multiple values, this property will be the string that separates those values for display purposes. |
java.lang.String |
getName()
Name for this form field. |
OperatorId |
getOperator()
OperatorId to be used when DynamicForm.getValuesAsCriteria is called. |
Criteria |
getOptionCriteria()
If this item has a specified optionDataSource, and this property may be used
to specify criteria to pass to the datasource when
performing the fetch operation on the dataSource to obtain a data-value to display-value
mapping |
RPCRequest |
getOptionFilterContext()
If this item has a specified optionDataSource, and this property is
not null, this will be passed to the datasource as RPCRequest properties when
performing the fetch operation on the dataSource to obtain a data-value to display-value
mapping |
java.lang.String |
getOptionOperationId()
If this item has a specified optionDataSource, this attribute may be set to specify an explicit operationId when performing a fetch against the option dataSource to
pick up display value mapping. |
static FormItem |
getOrCreateRef(JavaScriptObject jsObj)
|
int |
getPageLeft()
Returns the drawn page-left coordinate of this form item in pixels. |
Rectangle |
getPageRect()
Return the page-level coordinates of this object. |
int |
getPageTop()
Returns the drawn page-top coordinate of this form item in pixels. |
java.lang.Integer |
getPickerIconHeight()
If showPickerIcon is true for this item, this
property governs the size of the picker icon. |
java.lang.String |
getPickerIconName()
If showPickerIcon is true, this attribute
specifies the name applied to the picker icon |
java.lang.String |
getPickerIconSrc()
If showPickerIcon is true for this item, this
property governs the src of the picker icon image to be displayed. |
java.lang.Integer |
getPickerIconWidth()
If showPickerIcon is true for this item, this
property governs the size of the picker icon. |
java.lang.String |
getPrintTextBoxStyle()
Base CSS class name for a form item's text box element when getting printable HTML for the form. |
java.lang.String |
getPrintTitleStyle()
Base CSS stylename for a form item's title when generating print HTML for the item. |
java.lang.String |
getPrompt()
This text is shown as a tooltip prompt when the cursor hovers over this item. |
Rectangle |
getRect()
Return the coordinates of this object. |
java.lang.Boolean |
getRejectInvalidValueOnChange()
If validateOnChange is true, and validation fails for this item on change, with no suggested value, should we revert to the previous value, or continue to display the bad value entered by the user. |
java.lang.Boolean |
getRequired()
Whether a non-empty value is required for this field to pass validation. |
java.lang.String |
getRequiredMessage()
The required message for required field errors. |
int |
getRowSpan()
Number of rows that this item spans |
ListGridRecord |
getSelectedRecord()
Get the record returned from the optionDataSource when fetchMissingValues
is true, and the missing value is fetched. |
java.lang.Boolean |
getSelectOnFocus()
Allows the selectOnFocus behavior to be configured
on a per-FormItem basis. |
java.lang.Boolean |
getShouldSaveValue()
Should this item's value be saved in the form's values and hence returned from form.getValues()? |
java.lang.Boolean |
getShowDisabled()
When this item is disabled, should it be re-styled to indicate its disabled state? |
java.lang.Boolean |
getShowErrorIcon()
showErrorIcons, showErrorText, and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
java.lang.Boolean |
getShowErrorStyle()
showErrorIcons, showErrorText, and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
java.lang.Boolean |
getShowErrorText()
showErrorIcons, showErrorText, and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
java.lang.Boolean |
getShowFocused()
When this item receives focus, should it be re-styled to indicate it has focus? |
java.lang.Boolean |
getShowFocusedIcons()
If we're showing icons, should we change their image source to the appropriate focused source when this item has focus? Can be overridden on a per icon basis by the formItemIcon showFocused property. |
java.lang.Boolean |
getShowFocusedPickerIcon()
If showPickerIcon is true for this item,
should the picker icon show a focused image when the form item has focus? |
java.lang.Boolean |
getShowHint()
If a hint is defined for this form item, should it be shown? |
java.lang.Boolean |
getShowIcons()
Set to false to suppress writing out any icons for
this item. |
java.lang.Boolean |
getShowOverIcons()
If we're showing icons, should we change their image source to the appropriate over source when the user rolls over (or puts focus onto) them? Can be overridden on a per icon basis by the formItemIcon showOver
property. |
java.lang.Boolean |
getShowPickerIcon()
Should we show a special 'picker' icon for this form item. |
java.lang.Boolean |
getShowTitle()
Should we show a title cell for this formItem? |
java.lang.Boolean |
getShowValueIconOnly()
If valueIcons is set, this property may be set to
show the valueIcon only and prevent the standard form item element or text from displaying |
java.lang.Boolean |
getStartRow()
Whether this item should always start a new row in the form layout. |
java.lang.Boolean |
getStopOnError()
Indicates that if validation fails, the user should not be allowed to exit the field - focus will be forced back into the field until the error is corrected. |
java.lang.Boolean |
getSuppressValueIcon()
If valueIcons is set, this property may be set to
prevent the value icons from showing up next to the form items value |
java.lang.Boolean |
getSynchronousValidation()
If enabled, whenever validation is triggered and a request to the server is required, user interactivity will be blocked until the request returns. |
java.lang.Integer |
getTabIndex()
TabIndex for the form item within the form, which controls the order in which controls are visited when the user hits the tab or shift-tab keys to navigate between items. |
Alignment |
getTextAlign()
Alignment of the text / content within this form item. |
java.lang.String |
getTextBoxStyle()
Base CSS class name for a form item's text box element. |
TimeDisplayFormat |
getTimeFormatter()
Time-format to apply to date type values within this formItem. |
java.lang.String |
getTitle()
User visible title for this form item. |
Alignment |
getTitleAlign()
Alignment of this item's title in its cell. |
int |
getTitleColSpan()
Number of columns that this item's title spans. |
TitleOrientation |
getTitleOrientation()
On which side of this item should the title be placed. |
java.lang.String |
getTitleStyle()
Base CSS class name for a form item's title. |
VerticalAlignment |
getTitleVAlign()
Vertical alignment of this item's title in its cell. |
java.lang.String |
getTooltip()
This text is shown as a tooltip prompt when the cursor hovers over this item. |
int |
getTop()
Top coordinate of this item in pixels. |
java.lang.String |
getType()
The DynamicForm picks a field renderer based on the type of the field (and sometimes other attributes of the field). |
java.lang.Boolean |
getValidateOnChange()
If true, form items will be validated when each item's "change" handler is fired as well as when the entire form is submitted or validated. |
java.lang.Boolean |
getValidateOnExit()
If true, form items will be validated when each item's "editorExit" handler is fired as well as when the entire form is submitted or validated. |
OperatorId[] |
getValidOperators()
Array of valid filtering operators (eg "greaterThan") that are legal for this FormItem. |
java.lang.Object |
getValue()
Return the value tracked by this form item. |
java.lang.String |
getValueField()
If this form item maps data values to display values by retrieving the displayField values from an optionDataSource, this property denotes the the
field to use as the underlying data value in records from the optionDataSource.If unset, assumed to be the name of this form item. |
java.lang.String |
getValueFieldName()
Getter method to retrieve the valueField for this
item. |
java.lang.Integer |
getValueIconHeight()
If valueIcons is specified, use this property to
specify a height for the value icon written out. |
int |
getValueIconLeftPadding()
If we're showing a value icon, this attribute governs the amount of space between the icon and the left edge of the form item cell |
int |
getValueIconRightPadding()
If we're showing a value icon, this attribute governs the amount of space between the icon and the label of the form item |
int |
getValueIconSize()
If valueIcons is specified, this property may be
used to specify both the width and height of the icon written out. |
java.lang.Integer |
getValueIconWidth()
If valueIcons is specified, use this property to
specify a width for the value icon written out. |
java.lang.Boolean |
getVisible()
Whether this item is currently visible. |
int |
getVisibleHeight()
Output the drawn height for this item in pixels. |
int |
getVisibleWidth()
Output the drawn width for this item in pixels. |
int |
getWidth()
Width of the FormItem. |
java.lang.Boolean |
getWrapTitle()
If specified determines whether this items title should wrap. |
java.lang.Boolean |
hasAdvancedCriteria()
Does this form item produce an AdvancedCriteria sub criterion object? If this method
returns true, DynamicForm.getValuesAsCriteria
on the form containing this item will always return an AdvancedCriteria object, calling
FormItem.getCriterion on each item to retrieve the
individual criteria. |
void |
hide()
Hide this form item. |
void |
invalidateDisplayValueCache()
If this item has a specified displayField, the
value displayed to the user for this item may be derived from another field. |
protected boolean |
isCreated()
|
java.lang.Boolean |
isDisabled()
Is this item disabled? |
java.lang.Boolean |
isDrawn()
Returns true if this item has been written out into the DOM. |
void |
redraw()
Causes the FormItem to be redrawn immediately with the new properties. |
void |
setAccessKey(java.lang.String accessKey)
AccessKey - a keyboard shortcut to trigger a form item's default behavior. Note: Alt+ (or in Moz Firefox 2.0 and above, Shift+Alt+) the specified key will trigger the form item's default behavior. |
void |
setAlign(Alignment align)
Alignment of this item in its cell. |
void |
setAllowExpressions(java.lang.Boolean allowExpressions)
For a form that produces filter criteria (see form.getValuesAsCriteria()), allows the user to type in simple expressions to cause filtering with that operator. |
void |
setAlwaysFetchMissingValues(java.lang.Boolean alwaysFetchMissingValues)
If this form item has a specified optionDataSource and fetchMissingValues
is true, when the item value changes, a fetch will be performed against the optionDataSource to retrieve the related
record if displayField is specified and the
new item value is not present in any valueMap explicitly specified on the item. |
void |
setAttribute(java.lang.String attribute,
BaseClass[] value)
|
void |
setAttribute(java.lang.String attribute,
boolean value)
|
void |
setAttribute(java.lang.String attribute,
java.lang.Boolean value)
|
void |
setAttribute(java.lang.String attribute,
DataClass value)
|
void |
setAttribute(java.lang.String attribute,
DataClass[] value)
|
void |
setAttribute(java.lang.String attribute,
java.util.Date value)
|
void |
setAttribute(java.lang.String attribute,
double value)
|
void |
setAttribute(java.lang.String attribute,
int value)
|
void |
setAttribute(java.lang.String attribute,
int[] value)
|
void |
setAttribute(java.lang.String attribute,
JavaScriptObject value)
|
void |
setAttribute(java.lang.String attribute,
java.util.Map value)
|
void |
setAttribute(java.lang.String attribute,
java.lang.String value)
|
void |
setAttribute(java.lang.String attribute,
java.lang.String[] value)
|
void |
setAttribute(java.lang.String attribute,
ValueEnum[] value)
|
void |
setBrowserSpellCheck(java.lang.Boolean browserSpellCheck)
If this browser supports spell-checking of text editing elements, do we want this enabled for this item? If unset the property will be inherited from the containing form. |
void |
setCanFocus(java.lang.Boolean canFocus)
Is this form item focusable? Setting this property to true on an otherwise non-focusable element such as a StaticTextItem will cause the item to be included in the page's tab order and
respond to keyboard events. |
void |
setCellHeight(java.lang.Integer cellHeight)
If specified, this property will govern the height of the cell in which this form item is rendered. |
void |
setCellStyle(java.lang.String cellStyle)
CSS style applied to the form item as a whole, including the text element, any icons, and any hint text for the item. |
void |
setColSpan(int colSpan)
Number of columns that this item spans. |
void |
setColSpan(java.lang.String colSpan)
Number of columns that this item spans. |
void |
setCriteriaField(java.lang.String criteriaField)
When using operator, the name of the DataSource
field for the Criterion this FormItem generates. |
void |
setCriterion(Criterion criterion)
Update this form item to reflect a criterion object from within an AdvancedCriteria. |
void |
setDataPath(java.lang.String dataPath)
dataPath for this item. |
void |
setDateFormatter(DateDisplayFormat dateFormatter)
Display format to use for date type values within this formItem. |
void |
setDefaultIconSrc(java.lang.String defaultIconSrc)
Default icon image source. |
void |
setDefaultValue(java.lang.Boolean defaultValue)
Value used when no value is provided for this item. |
void |
setDefaultValue(java.util.Date defaultValue)
Value used when no value is provided for this item. |
void |
setDefaultValue(java.lang.Float defaultValue)
Value used when no value is provided for this item. |
void |
setDefaultValue(java.lang.Integer defaultValue)
Value used when no value is provided for this item. |
void |
setDefaultValue(java.lang.String defaultValue)
Value used when no value is provided for this item. |
void |
setDisabled(java.lang.Boolean disabled)
Whether this item is disabled. |
void |
setDisplayField(java.lang.String displayField)
Specifies an alternative field from which display values should be retrieved for this item. |
void |
setDisplayFormat(DateDisplayFormat displayFormat)
Fields of type "date" or "time" will be edited using a DateItem or TimeItem by
default. |
void |
setDisplayFormat(TimeFormatter displayFormat)
Fields of type "date" or "time" will be edited using a DateItem or TimeItem by
default. |
void |
setEditorType(FormItem editorType)
Name of the FormItem properties to use for editing. |
void |
setEditorValueFormatter(FormItemValueFormatter formatter)
An optional FormItemValueFormatter to map this item's current data value to a
display value. |
void |
setEditorValueParser(FormItemValueParser valueParser)
An optional FormItemValueParser to map a user-entered display value to a data
value for storage. |
void |
setEmptyDisplayValue(java.lang.String emptyDisplayValue)
Text to display when this form item has a null or undefined value. |
void |
setEmptyValueIcon(java.lang.String emptyValueIcon)
This property allows the developer to specify an icon to display when this item has no value. |
void |
setEndRow(java.lang.Boolean endRow)
Whether this item should end the row it's in in the form layout |
void |
setErrorFormatter(FormItemErrorFormatter errorFormatter)
Register a custom error formatter for this FormItem. |
void |
setErrorIconHeight(int errorIconHeight)
Height of the error icon, if we're showing icons when validation errors occur. |
void |
setErrorIconSrc(java.lang.String errorIconSrc)
URL of the image to show as an error icon, if we're showing icons when validation errors occur. |
void |
setErrorIconWidth(int errorIconWidth)
Height of the error icon, if we're showing icons when validation errors occur. |
void |
setErrorMessageWidth(int errorMessageWidth)
When showInlineErrors and showErrorText are both true and errorOrientation is "left" or "right",
errorMessageWidth is the amount to reduce the width of the editor to accommodate the error message and icon. |
void |
setErrorOrientation(FormErrorOrientation errorOrientation)
If showInlineErrors is true, where
should the error icon and text appear relative to the form item itself. |
void |
setFetchMissingValues(java.lang.Boolean fetchMissingValues)
If this form item has a specified optionDataSource, should the item ever perform a fetch against this dataSource to retrieve the related record. |
void |
setFilterLocally(java.lang.Boolean filterLocally)
If this form item is mapping data values to a display value by fetching records from a dataSource (see optionDataSource, displayField and fetchMissingValues), setting this property to
true ensures that when the form item value is set, entire data-set from the dataSource is loaded at once and used as a
valueMap, rather than just loading the display value for the current value. |
void |
setGlobalTabIndex(java.lang.Integer globalTabIndex)
TabIndex for the form item within the page. |
void |
setHeight(int height)
Height of the FormItem. |
void |
setHeight(java.lang.String height)
|
void |
setHint(java.lang.String hint)
Specifies "hint" string to show next to the form item to indicate something to the user. |
void |
setHintStyle(java.lang.String hintStyle)
CSS class for the "hint" string. |
void |
setHoverAlign(Alignment hoverAlign)
Text alignment for text displayed in this item's hover canvas, if shown. |
void |
setHoverDelay(java.lang.Integer hoverDelay)
If specified, this is the number of milliseconds to wait between the user rolling over this form item, and triggering any hover action for it. If not specified this.form.itemHoverDelay will be used instead. |
void |
setHoverHeight(java.lang.Integer hoverHeight)
Option to specify a height for any hover shown for this item. |
void |
setHoverOpacity(java.lang.Integer hoverOpacity)
Opacity for any hover shown for this item |
void |
setHoverStyle(java.lang.String hoverStyle)
Explicit CSS Style for any hover shown for this item. |
void |
setHoverVAlign(VerticalAlignment hoverVAlign)
Vertical text alignment for text displayed in this item's hover canvas, if shown. |
void |
setHoverWidth(java.lang.Integer hoverWidth)
Option to specify a width for any hover shown for this item. |
void |
setIconHeight(int iconHeight)
Default height for form item icons |
void |
setIconPrompt(java.lang.String iconPrompt)
Default prompt (and tooltip-text) for icons. |
void |
setIcons(FormItemIcon... icons)
An array of descriptor objects for icons to display in a line after this form item. |
void |
setIconVAlign(VerticalAlignment iconVAlign)
How should icons be aligned vertically for this form item. |
void |
setIconWidth(int iconWidth)
Default width for form item icons |
void |
setImageURLPrefix(java.lang.String imageURLPrefix)
Prefix to apply to the beginning of any valueIcons when determining the URL for the image. |
void |
setImageURLSuffix(java.lang.String imageURLSuffix)
Suffix to apply to the end of any valueIcons when
determining the URL for the image. |
void |
setImplicitSave(java.lang.Boolean implicitSave)
When true, indicates that changes to this item will cause an automatic save on a delay, as well as when the entire form is submitted. |
void |
setImplicitSaveOnBlur(java.lang.Boolean implicitSaveOnBlur)
If not set to false, form item values will be saved when this item's "editorExit" handler is fired as well as on a delay and when the entire form is submitted. |
void |
setInitHandler(FormItemInitHandler initHandler)
Specify a notification method to fire when this formItem is initialized in JavaScript. |
void |
setInputFormat(java.lang.String inputFormat)
For fields of type "date", if this is an editable field such as a TextItem, this property allows you to specify the inputFormat applied to the item. |
void |
setInputTransformer(FormItemInputTransformer inputTransformer)
The transformer is called when a FormItem's value is about to change as the result of user interaction. |
void |
setItemHoverFormatter(FormItemHoverFormatter hoverFormatter)
The FormItemHoverFormatter should return the HTML to display in a hover canvas when the user holds the mousepointer over this item. |
void |
setItemTitleHoverFormatter(FormItemHoverFormatter hoverFormatter)
The FormItemHoverFormatter should return the HTML to display in a hover canvas when the user holds the mousepointer over the item's title. |
void |
setLeft(int left)
Left coordinate of this item in pixels. |
void |
setLocateItemBy(java.lang.String locateItemBy)
When AutoTest.getElement is used to parse locator strings generated by link{isc.AutoTest.getLocator()} for this form item, should the item be identified? By default if the item has a name this will always be used, however for items with no name, the following options are available: "title" use the title as an identifier within this
form "value" use the value of the item to identify it (often used for items with a static
defaultValue such as HeaderItems "index" use the index within the form's items array. |
void |
setMultipleValueSeparator(java.lang.String multipleValueSeparator)
If this item is displaying multiple values, this property will be the string that separates those values for display purposes. |
void |
setName(java.lang.String name)
Name for this form field. |
void |
setOperator(OperatorId operator)
OperatorId to be used when DynamicForm.getValuesAsCriteria is called. |
void |
setOptionCriteria(Criteria optionCriteria)
If this item has a specified optionDataSource, and this property may be used
to specify criteria to pass to the datasource when
performing the fetch operation on the dataSource to obtain a data-value to display-value
mapping |
void |
setOptionDataSource(DataSource dataSource)
|
void |
setOptionFilterContext(RPCRequest rpcRequestProperties)
If this item has a specified optionDataSource, and this property is
not null, this will be passed to the datasource as RPCRequest properties when
performing the fetch operation on the dataSource to obtain a data-value to display-value
mapping |
void |
setOptionOperationId(java.lang.String optionOperationId)
If this item has a specified optionDataSource, this attribute may be set to specify an explicit operationId when performing a fetch against the option dataSource to
pick up display value mapping. |
void |
setPickerIconHeight(java.lang.Integer pickerIconHeight)
If showPickerIcon is true for this item, this
property governs the size of the picker icon. |
void |
setPickerIconName(java.lang.String pickerIconName)
If showPickerIcon is true, this attribute
specifies the name applied to the picker icon |
void |
setPickerIconSrc(java.lang.String pickerIconSrc)
If showPickerIcon is true for this item, this
property governs the src of the picker icon image to be displayed. |
void |
setPickerIconWidth(java.lang.Integer pickerIconWidth)
If showPickerIcon is true for this item, this
property governs the size of the picker icon. |
void |
setPrintTextBoxStyle(java.lang.String printTextBoxStyle)
Base CSS class name for a form item's text box element when getting printable HTML for the form. |
void |
setPrintTitleStyle(java.lang.String printTitleStyle)
Base CSS stylename for a form item's title when generating print HTML for the item. |
void |
setPrompt(java.lang.String prompt)
This text is shown as a tooltip prompt when the cursor hovers over this item. |
void |
setProperty(java.lang.String property,
boolean value)
|
void |
setProperty(java.lang.String property,
double value)
|
void |
setProperty(java.lang.String property,
int value)
|
void |
setProperty(java.lang.String property,
JavaScriptObject value)
|
void |
setProperty(java.lang.String property,
java.lang.String value)
|
void |
setRedrawOnChange(boolean redrawOnChange)
Setting to true causes the FormItem to be immediately redrawn with the new properties when its value changes |
void |
setRejectInvalidValueOnChange(java.lang.Boolean rejectInvalidValueOnChange)
If validateOnChange is true, and validation fails for this item on change, with no suggested value, should we revert to the previous value, or continue to display the bad value entered by the user. |
void |
setRequired(java.lang.Boolean required)
Whether a non-empty value is required for this field to pass validation. |
void |
setRequiredMessage(java.lang.String requiredMessage)
The required message for required field errors. |
void |
setRowSpan(int rowSpan)
Number of rows that this item spans |
void |
setSelectOnFocus(java.lang.Boolean selectOnFocus)
Allows the selectOnFocus behavior to be configured
on a per-FormItem basis. |
void |
setShouldSaveValue(java.lang.Boolean shouldSaveValue)
Should this item's value be saved in the form's values and hence returned from form.getValues()? |
void |
setShowDisabled(java.lang.Boolean showDisabled)
When this item is disabled, should it be re-styled to indicate its disabled state? If this method is called after the component has been drawn/initialized: Setter method for showDisabled |
void |
setShowErrorIcon(java.lang.Boolean showErrorIcon)
showErrorIcons, showErrorText, and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
void |
setShowErrorStyle(java.lang.Boolean showErrorStyle)
showErrorIcons, showErrorText, and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
void |
setShowErrorText(java.lang.Boolean showErrorText)
showErrorIcons, showErrorText, and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
void |
setShowFocused(java.lang.Boolean showFocused)
When this item receives focus, should it be re-styled to indicate it has focus? |
void |
setShowFocusedIcons(java.lang.Boolean showFocusedIcons)
If we're showing icons, should we change their image source to the appropriate focused source when this item has focus? Can be overridden on a per icon basis by the formItemIcon showFocused property. |
void |
setShowFocusedPickerIcon(java.lang.Boolean showFocusedPickerIcon)
If showPickerIcon is true for this item,
should the picker icon show a focused image when the form item has focus? |
void |
setShowHint(java.lang.Boolean showHint)
If a hint is defined for this form item, should it be shown? |
void |
setShowIcons(java.lang.Boolean showIcons)
Set to false to suppress writing out any icons for
this item. |
void |
setShowIfCondition(FormItemIfFunction showIf)
Expression that's evaluated to see if an item should be dynamically hidden. |
void |
setShowOverIcons(java.lang.Boolean showOverIcons)
If we're showing icons, should we change their image source to the appropriate over source when the user rolls over (or puts focus onto) them? Can be overridden on a per icon basis by the formItemIcon showOver
property. |
void |
setShowPickerIcon(java.lang.Boolean showPickerIcon)
Should we show a special 'picker' icon for this form item. |
void |
setShowTitle(java.lang.Boolean showTitle)
Should we show a title cell for this formItem? |
void |
setShowValueIconOnly(java.lang.Boolean showValueIconOnly)
If valueIcons is set, this property may be set to
show the valueIcon only and prevent the standard form item element or text from displaying |
void |
setStartRow(java.lang.Boolean startRow)
Whether this item should always start a new row in the form layout. |
void |
setStopOnError(java.lang.Boolean stopOnError)
Indicates that if validation fails, the user should not be allowed to exit the field - focus will be forced back into the field until the error is corrected. |
void |
setSuppressValueIcon(java.lang.Boolean suppressValueIcon)
If valueIcons is set, this property may be set to
prevent the value icons from showing up next to the form items value |
void |
setSynchronousValidation(java.lang.Boolean synchronousValidation)
If enabled, whenever validation is triggered and a request to the server is required, user interactivity will be blocked until the request returns. |
void |
setTabIndex(java.lang.Integer tabIndex)
TabIndex for the form item within the form, which controls the order in which controls are visited when the user hits the tab or shift-tab keys to navigate between items. |
void |
setTextAlign(Alignment textAlign)
Alignment of the text / content within this form item. |
void |
setTextBoxStyle(java.lang.String textBoxStyle)
Base CSS class name for a form item's text box element. |
void |
setTimeFormatter(TimeDisplayFormat timeFormatter)
Time-format to apply to date type values within this formItem. |
void |
setTitle(java.lang.String title)
User visible title for this form item. |
void |
setTitleAlign(Alignment titleAlign)
Alignment of this item's title in its cell. |
void |
setTitleColSpan(int titleColSpan)
Number of columns that this item's title spans. |
void |
setTitleOrientation(TitleOrientation titleOrientation)
On which side of this item should the title be placed. |
void |
setTitleStyle(java.lang.String titleStyle)
Base CSS class name for a form item's title. |
void |
setTitleVAlign(VerticalAlignment titleVAlign)
Vertical alignment of this item's title in its cell. |
void |
setTooltip(java.lang.String tooltip)
This text is shown as a tooltip prompt when the cursor hovers over this item. |
void |
setTop(int top)
Top coordinate of this item in pixels. |
void |
setType(java.lang.String type)
The DynamicForm picks a field renderer based on the type of the field (and sometimes other attributes of the field). |
void |
setValidateOnChange(java.lang.Boolean validateOnChange)
If true, form items will be validated when each item's "change" handler is fired as well as when the entire form is submitted or validated. |
void |
setValidateOnExit(java.lang.Boolean validateOnExit)
If true, form items will be validated when each item's "editorExit" handler is fired as well as when the entire form is submitted or validated. |
void |
setValidators(Validator... validators)
Validators for this form item. |
void |
setValidOperators(OperatorId... validOperators)
Array of valid filtering operators (eg "greaterThan") that are legal for this FormItem. |
void |
setValue(boolean value)
Set the value of the form item. |
void |
setValue(java.util.Date value)
Set the value of the form item. |
void |
setValue(double value)
Set the value of the form item. |
void |
setValue(float value)
|
void |
setValue(int value)
|
void |
setValue(java.lang.Object value)
Set the value of the form item as an object. |
void |
setValue(java.lang.String value)
Set the value of the form item. |
void |
setValueField(java.lang.String valueField)
If this form item maps data values to display values by retrieving the displayField values from an optionDataSource, this property denotes the the
field to use as the underlying data value in records from the optionDataSource.If unset, assumed to be the name of this form item. |
void |
setValueFormatter(FormItemValueFormatter formatter)
Optional FormItemValueFormatter, if provided, is evaluated to get the
display value to show for this form items underlying data value. |
void |
setValueIconHeight(java.lang.Integer valueIconHeight)
If valueIcons is specified, use this property to
specify a height for the value icon written out. |
void |
setValueIconLeftPadding(int valueIconLeftPadding)
If we're showing a value icon, this attribute governs the amount of space between the icon and the left edge of the form item cell |
void |
setValueIconMapper(ValueIconMapper valueIconMapper)
Set the FormItem Value Icon mapper that allows the developer to specify the image source for an icon to be displayed for the current form item value. |
void |
setValueIconRightPadding(int valueIconRightPadding)
If we're showing a value icon, this attribute governs the amount of space between the icon and the label of the form item |
void |
setValueIcons(java.util.Map valueIcons)
Set the valueIcons for this item. |
void |
setValueIconSize(int valueIconSize)
If valueIcons is specified, this property may be
used to specify both the width and height of the icon written out. |
void |
setValueIconWidth(java.lang.Integer valueIconWidth)
If valueIcons is specified, use this property to
specify a width for the value icon written out. |
void |
setValueMap(java.util.LinkedHashMap valueMap)
Set the valueMap for this item. |
void |
setValueMap(java.lang.String... valueMap)
Set the valueMap for this item. |
void |
setVisible(java.lang.Boolean visible)
Whether this item is currently visible. |
void |
setWidth(int width)
Width of the FormItem. |
void |
setWidth(java.lang.String width)
|
void |
setWrapTitle(java.lang.Boolean wrapTitle)
If specified determines whether this items title should wrap. |
java.lang.Boolean |
shouldFetchMissingValue(java.lang.Object newValue)
If this field has a specified optionDataSource, should we perform a fetch against that dataSource to find the record that matches this field's value? |
void |
show()
Show this form item. |
void |
showPicker()
Method to show a picker for this item. |
void |
stopHover()
This method is fired when the user rolls off this item (or the title for this item) and will clear any hover canvas shown by the item. |
void |
updateState()
Update the visual state of a FormItem to reflect any changes in state or any changes in style settings (eg textBoxStyle). |
java.lang.Boolean |
validate()
Validate this item. |
| Methods inherited from class com.smartgwt.client.core.RefDataClass |
|---|
getRef, getRef |
| Methods inherited from class com.smartgwt.client.core.DataClass |
|---|
doAddHandler, fireEvent, getAttributeAsDoubleArray, getAttributeAsIntArray, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute |
| Methods inherited from class com.smartgwt.client.core.JsObject |
|---|
setJsObj |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Constructor Detail |
|---|
public FormItem()
public FormItem(JavaScriptObject jsObj)
public FormItem(java.lang.String name)
| Method Detail |
|---|
public static FormItem getOrCreateRef(JavaScriptObject jsObj)
public void setAccessKey(java.lang.String accessKey)
accessKey - accessKey Default value is nullFocus overview and related methodspublic java.lang.String getAccessKey()
Focus overview and related methodspublic void setAlign(Alignment align)
textAlign (typically only applies to items showing
a "textBox", such as textItems or selectItems).
align - align Default value is Canvas.LEFTAppearance overview and related methodspublic Alignment getAlign()
textAlign (typically only applies to items showing
a "textBox", such as textItems or selectItems).
Appearance overview and related methodspublic void setAllowExpressions(java.lang.Boolean allowExpressions)
form.getValuesAsCriteria()), allows the user to type in simple expressions to cause filtering with that operator. For
example, entering ">5" means values greater than 5, and ">0 and <5" means values between 0 and 5. The following
table lists character sequences that can be entered as a prefix to a value, and the corresponding operator that will
be used. Note that in the absence of a prefix, the operator specified via operator is used.
| Prefix | Operator |
| < | lessThan |
| > | greaterThan |
| <= | lessThanOrEqual |
| >= | greaterThanOrEqual |
| someValue...someValue | betweenInclusive |
| ! | notEqual |
| ^ | startsWith |
| | | endsWith |
| !^ | notStartsWith plus logical not |
| !@ | notEndsWith plus logical not |
| ~ | contains |
| !~ | notContains |
| # | isNull |
| !# | isNotNull |
| == | exact match (for fields where 'contains' is the default) |
Two further special notations are allowed:
In all cases, if an operator is disallowed for the field (via field.validOperators at either the dataSource or field
level), the operator character is ignored (treated as part of a literal value).
By default, the case-insensitive version of the operator is used (eg, startsWith will actually use "iStartsWith"). To avoid this, explicitly set item.operator (the default operator) to any case sensitive operator (eg "equals" or "contains") and case sensitive operators will be used for user-entered expressions.
Compound expressions (including "and" and "or") are allowed only for numeric or date/time types.
To enable this behavior for all fields in a form that allow text entry, see
allowExpressions.
Note that, like
operator, enabling
allowExpressions:true causes form.getValuesAsCriteria()) to return AdvancedCriteria.
allowExpressions - allowExpressions Default value is nullpublic java.lang.Boolean getAllowExpressions()
form.getValuesAsCriteria()), allows the user to type in simple expressions to cause filtering with that operator. For
example, entering ">5" means values greater than 5, and ">0 and <5" means values between 0 and 5. The following
table lists character sequences that can be entered as a prefix to a value, and the corresponding operator that will
be used. Note that in the absence of a prefix, the operator specified via operator is used.
| Prefix | Operator |
| < | lessThan |
| > | greaterThan |
| <= | lessThanOrEqual |
| >= | greaterThanOrEqual |
| someValue...someValue | betweenInclusive |
| ! | notEqual |
| ^ | startsWith |
| | | endsWith |
| !^ | notStartsWith plus logical not |
| !@ | notEndsWith plus logical not |
| ~ | contains |
| !~ | notContains |
| # | isNull |
| !# | isNotNull |
| == | exact match (for fields where 'contains' is the default) |
Two further special notations are allowed:
In all cases, if an operator is disallowed for the field (via field.validOperators at either the dataSource or field
level), the operator character is ignored (treated as part of a literal value).
By default, the case-insensitive version of the operator is used (eg, startsWith will actually use "iStartsWith"). To avoid this, explicitly set item.operator (the default operator) to any case sensitive operator (eg "equals" or "contains") and case sensitive operators will be used for user-entered expressions.
Compound expressions (including "and" and "or") are allowed only for numeric or date/time types.
To enable this behavior for all fields in a form that allow text entry, see
allowExpressions.
Note that, like
operator, enabling
allowExpressions:true causes form.getValuesAsCriteria()) to return AdvancedCriteria.
public void setAlwaysFetchMissingValues(java.lang.Boolean alwaysFetchMissingValues)
optionDataSource and fetchMissingValues
is true, when the item value changes, a fetch will be performed against the optionDataSource to retrieve the related
record if displayField is specified and the
new item value is not present in any valueMap explicitly specified on the item. Setting this property to true means
that a fetch will occur against the optionDataSource to retrieve the related record even if displayField is unset, or the item has a valueMap
which explicitly contains this field's value.
An example of a use case where this might be set would be if FormItem.formatValue or FormItem.formatEditorValue were written to display
properties from the selected record.
Note
- for efficiency we cache the associated record once a fetch has been performed, meaning if the value changes, then
reverts to a previously seen value, we do not kick off an additional fetch even if this property is true. If necessary
this cache may be explicitly invalidated via a call to FormItem.invalidateDisplayValueCache
Note : This is an advanced setting
alwaysFetchMissingValues - alwaysFetchMissingValues Default value is falsepublic java.lang.Boolean getAlwaysFetchMissingValues()
optionDataSource and fetchMissingValues
is true, when the item value changes, a fetch will be performed against the optionDataSource to retrieve the related
record if displayField is specified and the
new item value is not present in any valueMap explicitly specified on the item. Setting this property to true means
that a fetch will occur against the optionDataSource to retrieve the related record even if displayField is unset, or the item has a valueMap
which explicitly contains this field's value.
An example of a use case where this might be set would be if FormItem.formatValue or FormItem.formatEditorValue were written to display
properties from the selected record.
Note
- for efficiency we cache the associated record once a fetch has been performed, meaning if the value changes, then
reverts to a previously seen value, we do not kick off an additional fetch even if this property is true. If necessary
this cache may be explicitly invalidated via a call to FormItem.invalidateDisplayValueCache
public void setBrowserSpellCheck(java.lang.Boolean browserSpellCheck)
Notes:
- this property only applies to text based items
such as TextItem and TextAreaItem.
- this property is not supported on all browsers.
Note : This is an advanced setting
browserSpellCheck - browserSpellCheck Default value is nullDynamicForm.setBrowserSpellCheck(java.lang.Boolean)public java.lang.Boolean getBrowserSpellCheck()
Notes:
- this property only applies to text based items
such as TextItem and TextAreaItem.
- this property is not supported on all browsers.
DynamicForm.getBrowserSpellCheck()public void setCanFocus(java.lang.Boolean canFocus)
StaticTextItem will cause the item to be included in the page's tab order and
respond to keyboard events.
Note : This is an advanced setting
canFocus - canFocus Default value is nullFocus overview and related methodspublic java.lang.Boolean getCanFocus()
StaticTextItem will cause the item to be included in the page's tab order and
respond to keyboard events.
TextItems, TextAreaItems, etc), CanvasItems with a focusable canvas,
or items where canFocus was explicitly set to true.Focus overview and related methodspublic void setCellHeight(java.lang.Integer cellHeight)
itemLayout:"absolute".
cellHeight - cellHeight Default value is nullpublic java.lang.Integer getCellHeight()
itemLayout:"absolute".
public void setCellStyle(java.lang.String cellStyle)
NOTE: See the CompoundFormItem_skinning discussion for special
skinning considerations.
cellStyle - cellStyle Default value is "formCell"Appearance overview and related methodspublic java.lang.String getCellStyle()
NOTE: See the CompoundFormItem_skinning discussion for special
skinning considerations.
Appearance overview and related methodspublic Canvas getContainerWidget()
DynamicForm containing the item but in some cases editable
components handle writing out form items directly. An example of this is Grid
Editing - when a listGrid shows per-field editors, the containerWidget for each item will be the listGrid
body. Note that even if the containerWidget is not a DynamicForm, a DynamicForm will still exist for
the item (available as form), allowing access to
standard APIs such as DynamicForm.getValues
public void setCriteriaField(java.lang.String criteriaField)
operator, the name of the DataSource
field for the Criterion this FormItem generates. If not specified, defaults to name. Generally, because criteriaField
defaults to item.name, you don't need to specify it. However, if more than one FormItem specifies criteria
for the same DataSource field, they will need unique values for name but should set criteriaField to the name of DataSource field they
both target.
For example, if two DateItems are used to provide a min and max date for a single field called
"joinDate", set criteriaField to "joinDate" on
both fields but give the fields distinct names (eg "minDate" and "maxDate") and use those names for any programmatic
access, such as DynamicForm.setValue.
criteriaField - criteriaField Default value is nullpublic java.lang.String getCriteriaField()
operator, the name of the DataSource
field for the Criterion this FormItem generates. If not specified, defaults to name. Generally, because criteriaField
defaults to item.name, you don't need to specify it. However, if more than one FormItem specifies criteria
for the same DataSource field, they will need unique values for name but should set criteriaField to the name of DataSource field they
both target.
For example, if two DateItems are used to provide a min and max date for a single field called
"joinDate", set criteriaField to "joinDate" on
both fields but give the fields distinct names (eg "minDate" and "maxDate") and use those names for any programmatic
access, such as DynamicForm.setValue.
public void setDataPath(java.lang.String dataPath)
dataPath - dataPath Default value is nullpublic java.lang.String getDataPath()
public void setDateFormatter(DateDisplayFormat dateFormatter)
Note that Fields of type "date",
"datetime" or "time" will be edited using a DateItem or TimeItem by
default, but this can be overridden - for canEdit:false fields, a StaticTextItem is used by default, and the developer can always specify a
custom editorType as well as data type.
The timeFormatter may also be used to format underlying
Date values as times (ommitting the date part entirely). If both dateFormatter and
timeFormatter are specified on an item, for fields specified as type "time" the timeFormatter will be used,
otherwise the dateFormatter
If item.dateFormatter and item.timeFormatter is
unspecified, date display format may be defined at the component level via dateFormatter, or for fields of type
"datetime" datetimeFormatter.
Otherwise the default is to use the system-wide default short date format, configured via Date.setShortDisplayFormat.
Specify any valid DateDisplayFormat to change the format used by this item.
Note
that if this is a freeform editable field, such a TextItem, with type
specified as "date" or "datetime" the system will automatically attempt to parse user entered
values back to a Date value, assuming the entered string matches the date format for the field. Developers may further
customize this via an explicit inputFormat or
via entirely custom setEditorValueFormatter and setEditorValueParser methods.
Note : This is an advanced setting
dateFormatter - dateFormatter Default value is nullsetTimeFormatter(com.smartgwt.client.types.TimeDisplayFormat),
Appearance overview and related methodspublic DateDisplayFormat getDateFormatter()
Note that Fields of type "date",
"datetime" or "time" will be edited using a DateItem or TimeItem by
default, but this can be overridden - for canEdit:false fields, a StaticTextItem is used by default, and the developer can always specify a
custom editorType as well as data type.
The timeFormatter may also be used to format underlying
Date values as times (ommitting the date part entirely). If both dateFormatter and
timeFormatter are specified on an item, for fields specified as type "time" the timeFormatter will be used,
otherwise the dateFormatter
If item.dateFormatter and item.timeFormatter is
unspecified, date display format may be defined at the component level via dateFormatter, or for fields of type
"datetime" datetimeFormatter.
Otherwise the default is to use the system-wide default short date format, configured via Date.setShortDisplayFormat.
Specify any valid DateDisplayFormat to change the format used by this item.
Note
that if this is a freeform editable field, such a TextItem, with type
specified as "date" or "datetime" the system will automatically attempt to parse user entered
values back to a Date value, assuming the entered string matches the date format for the field. Developers may further
customize this via an explicit inputFormat or
via entirely custom setEditorValueFormatter and setEditorValueParser methods.
getTimeFormatter(),
Appearance overview and related methodspublic void setDefaultIconSrc(java.lang.String defaultIconSrc)
icon.src property.icon.showOver is true, this url will be modified by adding "_Over" to get an over state image for the icon.
Note : This is an advanced setting
defaultIconSrc - defaultIconSrc Default value is "[SKIN]/DynamicForm/default_formItem_icon.gif"public java.lang.String getDefaultIconSrc()
icon.src property.icon.showOver is true, this url will be modified by adding "_Over" to get an over state image for the icon.
public void setDisabled(java.lang.Boolean disabled)
setDisabled() method. Note that if the
widget containing this formItem is disabled, the formItem will behave in a disabled manner regardless of the setting of
the item.disabled property. Note that not all items can be disabled, and not all browsers show an obvious disabled
style for native form elements.
If this method is called after the component has been drawn/initialized:
Set this item to be enabled or disabled at runtime.
disabled - true if this item should be disabled. Default value is falsesetDisabled(java.lang.Boolean),
Appearance overview and related methods,
Enable & Disable Examplepublic java.lang.Boolean getDisabled()
setDisabled() method. Note that if the
widget containing this formItem is disabled, the formItem will behave in a disabled manner regardless of the setting of
the item.disabled property. Note that not all items can be disabled, and not all browsers show an obvious disabled style for native form elements.
setDisabled(java.lang.Boolean),
Appearance overview and related methods,
Enable & Disable Examplepublic void setDisplayField(java.lang.String displayField)
The display field can be
either another field value in the same record or a field that must be retrieved from a related optionDataSource.
If this item is not
databound (optionDataSource is unset), or
bound to the same dataSource as the form as a whole, this item will call form.getValue() the form named after is implemented by picking
up the value of the specified field from the Form's values object.
Otherwise this item will attempt to map its
underlying value to a display value by retrieving a record from the optionDataSource where the valueField matches this item's value, and displaying the
displayField value from that record. Note that if optionDataSource is set and this value is
not set, FormItem.getDisplayFieldName will
return the dataSource title field by default.
This essentially enables the specified optionDataSource
to be used as a server based valueMap.
displayField - displayField Default value is nullinvalidateDisplayValueCache()public java.lang.String getDisplayField()
The display field can be
either another field value in the same record or a field that must be retrieved from a related optionDataSource.
If this item is not
databound (optionDataSource is unset), or
bound to the same dataSource as the form as a whole, this item will call form.getValue() the form named after is implemented by picking
up the value of the specified field from the Form's values object.
Otherwise this item will attempt to map its
underlying value to a display value by retrieving a record from the optionDataSource where the valueField matches this item's value, and displaying the
displayField value from that record. Note that if optionDataSource is set and this value is
not set, FormItem.getDisplayFieldName will
return the dataSource title field by default.
This essentially enables the specified optionDataSource
to be used as a server based valueMap.
invalidateDisplayValueCache()public void setEmptyDisplayValue(java.lang.String emptyDisplayValue)
emptyDisplayValue - emptyDisplayValue Default value is ""public java.lang.String getEmptyDisplayValue()
public void setEmptyValueIcon(java.lang.String emptyValueIcon)
valueIcons)
emptyValueIcon - emptyValueIcon Default value is nullpublic java.lang.String getEmptyValueIcon()
valueIcons)
public void setEndRow(java.lang.Boolean endRow)
endRow - endRow Default value is falseFormLayout overview and related methodspublic java.lang.Boolean getEndRow()
FormLayout overview and related methodspublic void setErrorIconHeight(int errorIconHeight)
errorIconHeight - errorIconHeight Default value is 16setShowErrorIcon(java.lang.Boolean)public int getErrorIconHeight()
getShowErrorIcon()public void setErrorIconSrc(java.lang.String errorIconSrc)
errorIconSrc - errorIconSrc Default value is "[SKIN]/DynamicForm/validation_error_icon.png"setShowErrorIcon(java.lang.Boolean)public java.lang.String getErrorIconSrc()
getShowErrorIcon()public void setErrorIconWidth(int errorIconWidth)
errorIconWidth - errorIconWidth Default value is 16setShowErrorIcon(java.lang.Boolean)public int getErrorIconWidth()
getShowErrorIcon()public void setErrorMessageWidth(int errorMessageWidth)
showInlineErrors and showErrorText are both true and errorOrientation is "left" or "right",
errorMessageWidth is the amount to reduce the width of the editor to accommodate the error message and icon.
errorMessageWidth - errorMessageWidth Default value is 80Validation overview and related methodspublic int getErrorMessageWidth()
showInlineErrors and showErrorText are both true and errorOrientation is "left" or "right",
errorMessageWidth is the amount to reduce the width of the editor to accommodate the error message and icon.
Validation overview and related methodspublic void setFetchMissingValues(java.lang.Boolean fetchMissingValues)
optionDataSource, should the item ever perform a fetch against this dataSource to retrieve the related record. The
fetch occurs if the item value is non null on initial draw of the form or whenever setValue() is called. Once the fetch
completes, the returned record is available via the FormItem.getSelectedRecord api.
By default, a
fetch will only occur if displayField is
specified, and the item does not have an explicit valueMap containing the data value as a key.
However you can also set alwaysMissingFetchValues to have a fetch
occur even if no displayField is specified. This ensures FormItem.getSelectedRecord will return a record if
possible - useful for custom formatter functions, etc.
Note - for efficiency we cache the associated record once a
fetch has been performed, meaning if the value changes, then reverts to a previously seen value, we do not kick off an
additional fetch to pick up the display value for the previously seen data value. If necessary this cache may be
explicitly invalidated via a call to FormItem.invalidateDisplayValueCache
Note : This is an advanced setting
fetchMissingValues - fetchMissingValues Default value is truesetOptionDataSource(com.smartgwt.client.data.DataSource),
getSelectedRecord(),
setFilterLocally(java.lang.Boolean)public java.lang.Boolean getFetchMissingValues()
optionDataSource, should the item ever perform a fetch against this dataSource to retrieve the related record. The
fetch occurs if the item value is non null on initial draw of the form or whenever setValue() is called. Once the fetch
completes, the returned record is available via the FormItem.getSelectedRecord api.
By default, a
fetch will only occur if displayField is
specified, and the item does not have an explicit valueMap containing the data value as a key.
However you can also set alwaysMissingFetchValues to have a fetch
occur even if no displayField is specified. This ensures FormItem.getSelectedRecord will return a record if
possible - useful for custom formatter functions, etc.
Note - for efficiency we cache the associated record once a
fetch has been performed, meaning if the value changes, then reverts to a previously seen value, we do not kick off an
additional fetch to pick up the display value for the previously seen data value. If necessary this cache may be
explicitly invalidated via a call to FormItem.invalidateDisplayValueCache
com.smartgwt.client.widgets.form.fields.FormItem#getOptionDataSource,
getSelectedRecord(),
getFilterLocally()public void setFilterLocally(java.lang.Boolean filterLocally)
optionDataSource, displayField and fetchMissingValues), setting this property to
true ensures that when the form item value is set, entire data-set from the dataSource is loaded at once and used as a
valueMap, rather than just loading the display value for the current value. This avoids the need to perform fetches each
time setValue() is called with a new value. See also filterLocally for behavior on form items such as SelectItems that show pick-lists.
Note : This is an advanced setting
filterLocally - filterLocally Default value is nullpublic java.lang.Boolean getFilterLocally()
optionDataSource, displayField and fetchMissingValues), setting this property to
true ensures that when the form item value is set, entire data-set from the dataSource is loaded at once and used as a
valueMap, rather than just loading the display value for the current value. This avoids the need to perform fetches each
time setValue() is called with a new value. See also filterLocally for behavior on form items such as SelectItems that show pick-lists.
public void setGlobalTabIndex(java.lang.Integer globalTabIndex)
item.tabIndex. Use of this API is extremely advanced and essentially implies taking over management of tab index assignment for all components on the page.
Note : This is an advanced setting
globalTabIndex - globalTabIndex Default value is nullFocus overview and related methodspublic java.lang.Integer getGlobalTabIndex()
item.tabIndex. Use of this API is extremely advanced and essentially implies taking over management of tab index assignment for all components on the page.
Focus overview and related methodspublic void setHeight(int height)
See the
FormLayout overview for details.
height - height Default value is 20FormLayout overview and related methods,
Filling Examplepublic int getHeight()
See the
FormLayout overview for details.
FormLayout overview and related methods,
Filling Examplepublic void setHint(java.lang.String hint)
hint - new hint for the item. Default value is nullsetHintStyle(java.lang.String),
Appearance overview and related methods,
Hints Examplepublic java.lang.String getHint()
getHintStyle(),
Appearance overview and related methods,
Hints Examplepublic void setHintStyle(java.lang.String hintStyle)
hintStyle - new style for hint text. Default value is "formHint"setHint(java.lang.String),
Appearance overview and related methodspublic java.lang.String getHintStyle()
getHint(),
Appearance overview and related methodspublic void setHoverAlign(Alignment hoverAlign)
hoverAlign - hoverAlign Default value is nullDynamicForm.setItemHoverAlign(com.smartgwt.client.types.Alignment)public Alignment getHoverAlign()
DynamicForm.getItemHoverAlign()public void setHoverDelay(java.lang.Integer hoverDelay)
this.form.itemHoverDelay will be used instead.
Note : This is an advanced setting
hoverDelay - hoverDelay Default value is nullpublic java.lang.Integer getHoverDelay()
this.form.itemHoverDelay will be used instead.
public void setHoverHeight(java.lang.Integer hoverHeight)
hoverHeight - hoverHeight Default value is nullDynamicForm.setItemHoverHeight(java.lang.Integer)public java.lang.Integer getHoverHeight()
DynamicForm.getItemHoverHeight()public void setHoverOpacity(java.lang.Integer hoverOpacity)
hoverOpacity - hoverOpacity Default value is nullDynamicForm.setItemHoverOpacity(java.lang.Integer)public java.lang.Integer getHoverOpacity()
DynamicForm.getItemHoverOpacity()public void setHoverStyle(java.lang.String hoverStyle)
hoverStyle - hoverStyle Default value is nullDynamicForm.setItemHoverStyle(java.lang.String)public java.lang.String getHoverStyle()
DynamicForm.getItemHoverStyle()public void setHoverVAlign(VerticalAlignment hoverVAlign)
hoverVAlign - hoverVAlign Default value is nullDynamicForm.setItemHoverVAlign(java.lang.Integer)public VerticalAlignment getHoverVAlign()
DynamicForm.getItemHoverVAlign()public void setHoverWidth(java.lang.Integer hoverWidth)
hoverWidth - hoverWidth Default value is nullDynamicForm.setItemHoverWidth(java.lang.Integer)public java.lang.Integer getHoverWidth()
DynamicForm.getItemHoverWidth()public void setIconHeight(int iconHeight)
Note : This is an advanced setting
iconHeight - iconHeight Default value is 20public int getIconHeight()
public void setIconPrompt(java.lang.String iconPrompt)
Note : This is an advanced setting
iconPrompt - iconPrompt Default value is ""public java.lang.String getIconPrompt()
public void setIconVAlign(VerticalAlignment iconVAlign)
Note : This is an advanced setting
iconVAlign - iconVAlign Default value is "bottom"public VerticalAlignment getIconVAlign()
public void setIconWidth(int iconWidth)
Note : This is an advanced setting
iconWidth - iconWidth Default value is 20public int getIconWidth()
public void setImageURLPrefix(java.lang.String imageURLPrefix)
valueIcons when determining the URL for the image. Will not be applied if the valueIcon URL is absolute.
Note : This is an advanced setting
imageURLPrefix - imageURLPrefix Default value is nullpublic java.lang.String getImageURLPrefix()
valueIcons when determining the URL for the image. Will not be applied if the valueIcon URL is absolute.
public void setImageURLSuffix(java.lang.String imageURLSuffix)
valueIcons when
determining the URL for the image. A common usage would be to specify a suffix of ".gif" in which case the
valueIcons property would map values to the names of images without the ".gif" extension.
Note : This is an advanced setting
imageURLSuffix - imageURLSuffix Default value is nullpublic java.lang.String getImageURLSuffix()
valueIcons when
determining the URL for the image. A common usage would be to specify a suffix of ".gif" in which case the
valueIcons property would map values to the names of images without the ".gif" extension.
public void setImplicitSave(java.lang.Boolean implicitSave)
delay, as well as when the entire form is submitted.
Unless implicitSaveOnBlur is set to false on either this formItem or it's form changes will also be automatically saved on
editorExit.
implicitSave - implicitSave Default value is falsepublic java.lang.Boolean getImplicitSave()
delay, as well as when the entire form is submitted.
Unless implicitSaveOnBlur is set to false on either this formItem or it's form changes will also be automatically saved on
editorExit.
public void setImplicitSaveOnBlur(java.lang.Boolean implicitSaveOnBlur)
implicitSaveOnBlur - implicitSaveOnBlur Default value is falsepublic java.lang.Boolean getImplicitSaveOnBlur()
public void setInputFormat(java.lang.String inputFormat)
"date", if this is an editable field such as a TextItem, this property allows you to specify the inputFormat applied to the item.
Note : This is an advanced setting
inputFormat - inputFormat Default value is nullsetDateFormatter(com.smartgwt.client.types.DateDisplayFormat)public java.lang.String getInputFormat()
"date", if this is an editable field such as a TextItem, this property allows you to specify the inputFormat applied to the item.
getDateFormatter()public void setLeft(int left)
itemLayout:"absolute".
itemLayout:"absolute" only, set the left coordinate of this form item. Causes the form to redraw.
Note : This is an advanced setting
left - left Default value is 0public int getLeft()
itemLayout:"absolute".
public void setLocateItemBy(java.lang.String locateItemBy)
"title" use the title as an identifier within this
form"value" use the value of the item to identify it (often used for items with a static
defaultValue such as HeaderItems"index" use the index within the form's items array. Note : This is an advanced setting
locateItemBy - locateItemBy Default value is nullpublic java.lang.String getLocateItemBy()
"title" use the title as an identifier within this
form"value" use the value of the item to identify it (often used for items with a static
defaultValue such as HeaderItems"index" use the index within the form's items array.
public void setMultipleValueSeparator(java.lang.String multipleValueSeparator)
multipleValueSeparator - multipleValueSeparator Default value is ', 'public java.lang.String getMultipleValueSeparator()
public void setOperator(OperatorId operator)
OperatorId to be used when DynamicForm.getValuesAsCriteria is called.
item.operator can be used to create a form that offers search functions such as date range filtering,
without the more advanced user interface of the FilterBuilder.
When
item.operator is set for any FormItem in a form, form.getValuesAsCriteria() will return an
AdvancedCriteria object instead of a normal Criteria
object. Each FormItem will produce one Criterion affecting the DataSource field
specified by criteriaField. The criteria
produced by the FormItems will be grouped under the logical operator provided by operator.
if operator is set for some fields
but not others, the default operator is "equals" for fields with a valueMap or an optionDataSource, and for fields of
type "enum" (or of a type that inherits from "enum"). The default operator for all other fields is "iContains"
(case-insensitive match)
Note: Advanced criteria will only be created for items in a Databound form. If this
item is part of a form with no dataSource, the
operator attribute will have no effect.
operator - operator Default value is nullCriteriaEditing overview and related methodspublic OperatorId getOperator()
OperatorId to be used when DynamicForm.getValuesAsCriteria is called.
item.operator can be used to create a form that offers search functions such as date range filtering,
without the more advanced user interface of the FilterBuilder.
When
item.operator is set for any FormItem in a form, form.getValuesAsCriteria() will return an
AdvancedCriteria object instead of a normal Criteria
object. Each FormItem will produce one Criterion affecting the DataSource field
specified by criteriaField. The criteria
produced by the FormItems will be grouped under the logical operator provided by operator.
if operator is set for some fields
but not others, the default operator is "equals" for fields with a valueMap or an optionDataSource, and for fields of
type "enum" (or of a type that inherits from "enum"). The default operator for all other fields is "iContains"
(case-insensitive match)
Note: Advanced criteria will only be created for items in a Databound form. If this
item is part of a form with no dataSource, the
operator attribute will have no effect.
CriteriaEditing overview and related methodspublic void setOptionOperationId(java.lang.String optionOperationId)
optionDataSource, this attribute may be set to specify an explicit operationId when performing a fetch against the option dataSource to
pick up display value mapping.
Note : This is an advanced setting
optionOperationId - optionOperationId Default value is nullpublic java.lang.String getOptionOperationId()
optionDataSource, this attribute may be set to specify an explicit operationId when performing a fetch against the option dataSource to
pick up display value mapping.
public void setPickerIconHeight(java.lang.Integer pickerIconHeight)
showPickerIcon is true for this item, this
property governs the size of the picker icon. If unset picker icon will be sized as a square to fit in the available
height for the icon.
Note : This is an advanced setting
pickerIconHeight - pickerIconHeight Default value is nullpublic java.lang.Integer getPickerIconHeight()
showPickerIcon is true for this item, this
property governs the size of the picker icon. If unset picker icon will be sized as a square to fit in the available
height for the icon.
public void setPickerIconName(java.lang.String pickerIconName)
showPickerIcon is true, this attribute
specifies the name applied to the picker icon
Note : This is an advanced setting
pickerIconName - pickerIconName Default value is "picker"public java.lang.String getPickerIconName()
showPickerIcon is true, this attribute
specifies the name applied to the picker icon
public void setPickerIconSrc(java.lang.String pickerIconSrc)
showPickerIcon is true for this item, this
property governs the src of the picker icon image to be displayed.
Note : This is an advanced setting
pickerIconSrc - pickerIconSrc Default value is ""public java.lang.String getPickerIconSrc()
showPickerIcon is true for this item, this
property governs the src of the picker icon image to be displayed.
public void setPickerIconWidth(java.lang.Integer pickerIconWidth)
showPickerIcon is true for this item, this
property governs the size of the picker icon. If unset picker icon will be sized as a square to fit in the available
height for the icon.
Note : This is an advanced setting
pickerIconWidth - pickerIconWidth Default value is nullpublic java.lang.Integer getPickerIconWidth()
showPickerIcon is true for this item, this
property governs the size of the picker icon. If unset picker icon will be sized as a square to fit in the available
height for the icon.
public void setPrintTextBoxStyle(java.lang.String printTextBoxStyle)
textBoxStyle will be used instead. Note that focused
styling will never be displayed while printing, though error and disabled styling will.
printTextBoxStyle - printTextBoxStyle Default value is nullPrinting overview and related methodspublic java.lang.String getPrintTextBoxStyle()
textBoxStyle will be used instead. Note that focused
styling will never be displayed while printing, though error and disabled styling will.
Printing overview and related methodspublic void setPrintTitleStyle(java.lang.String printTitleStyle)
titleStyle will be used instead.
printTitleStyle - printTitleStyle Default value is nullPrinting overview and related methodspublic java.lang.String getPrintTitleStyle()
titleStyle will be used instead.
Printing overview and related methodspublic void setPrompt(java.lang.String prompt)
prompt - prompt Default value is nullBasics overview and related methodspublic java.lang.String getPrompt()
Basics overview and related methodspublic void setRejectInvalidValueOnChange(java.lang.Boolean rejectInvalidValueOnChange)
Note : This is an advanced setting
rejectInvalidValueOnChange - rejectInvalidValueOnChange Default value is falsepublic java.lang.Boolean getRejectInvalidValueOnChange()
public void setRequired(java.lang.Boolean required)
If the user does not fill in the required
field, the error message to be shown will be taken from these properties in the following order: requiredMessage, requiredMessage, requiredMessage, requiredField.
Note: if specified on a
FormItem, required is only enforced on the client. required should generally be specified on
a DataSourceField.
If this method is called after the component has been drawn/initialized:
Setter to mark this formItem as required, or not required at runtime. Note that an alternative approach to updating the required flag directly would be to simply use a requiredIf type validator.
Note that this method will not re-validate this item by default or clear any existing validation errors. If desired, this may be achieved by calling FormItem.validate or DynamicForm.clearErrors.
required - new required value.. Default value is nullValidation overview and related methods,
Show & Hide Examplepublic java.lang.Boolean getRequired()
If the user does not fill in the required
field, the error message to be shown will be taken from these properties in the following order: requiredMessage, requiredMessage, requiredMessage, requiredField.
Note: if specified on a
FormItem, required is only enforced on the client. required should generally be specified on
a DataSourceField.
Validation overview and related methods,
Show & Hide Examplepublic void setRequiredMessage(java.lang.String requiredMessage)
requiredMessage - requiredMessage Default value is nullValidation overview and related methodspublic java.lang.String getRequiredMessage()
Validation overview and related methodspublic void setRowSpan(int rowSpan)
rowSpan - rowSpan Default value is 1FormLayout overview and related methodspublic int getRowSpan()
FormLayout overview and related methodspublic void setSelectOnFocus(java.lang.Boolean selectOnFocus)
selectOnFocus behavior to be configured
on a per-FormItem basis. Normally all items in a form default to the value of selectOnFocus.
selectOnFocus - selectOnFocus Default value is nullFocus overview and related methodspublic java.lang.Boolean getSelectOnFocus()
selectOnFocus behavior to be configured
on a per-FormItem basis. Normally all items in a form default to the value of selectOnFocus.
Focus overview and related methodspublic void setShouldSaveValue(java.lang.Boolean shouldSaveValue)
form.getValues()? shouldSaveValue:false is used
to mark formItems which do not correspond to the underlying data model and should not save a value into the form's
values. Example includes visual separators, password
re-type fields, or checkboxes used to show/hide other form items.
A shouldSaveValue:false item should
be given a value either via defaultValue or by
calling form.setValue(item, value) or formItem.setValue(value). Providing a value via form.values or form.setValues() will automatically switch the item to
shouldSaveValue:true.
Note that
shouldSaveValue - shouldSaveValue Default value is truepublic java.lang.Boolean getShouldSaveValue()
form.getValues()? shouldSaveValue:false is used
to mark formItems which do not correspond to the underlying data model and should not save a value into the form's
values. Example includes visual separators, password
re-type fields, or checkboxes used to show/hide other form items.
A shouldSaveValue:false item should
be given a value either via defaultValue or by
calling form.setValue(item, value) or formItem.setValue(value). Providing a value via form.values or form.setValues() will automatically switch the item to
shouldSaveValue:true.
Note that
public void setShowDisabled(java.lang.Boolean showDisabled)
showDisabled
Note : This is an advanced setting
showDisabled - new showDisabled setting. Default value is truesetCellStyle(java.lang.String),
Appearance overview and related methodspublic java.lang.Boolean getShowDisabled()
getCellStyle(),
Appearance overview and related methodspublic void setShowErrorIcon(java.lang.Boolean showErrorIcon)
showErrorIcons, showErrorText, and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors:false.
showErrorIcons, showErrorText and showErrorStyle are all boolean properties, and
can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.
The HTML displayed
next to a form item with errors is generated by FormItem.getErrorHTML. The default implementation of that method respects showErrorIcons and
showErrorText as follows:
showErrorIcons, or showErrorIcon at the FormItem
level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance
is governed by errorIconSrc, errorIconWidth and errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The
attribute showTitlesWithErrorMessages may be set to prefix error messages with the form item's title + ":" (may be
desired if the item has showTitle set to false).
errorOrientation controls where the error
HTML should appear relative to form items. Therefore the combination of showErrorText:false and errorOrientation:"left" creates a
compact validation error display consisting of just an icon, to the left of the item with the error message available
via a hover (similar appearance to ListGrid validation error display).
In addition to this,
showErrorStyle determines whether fields with validation errors should have special styling applied to
them. See String for a discussion for how error styling is calculated.
showErrorIcon - showErrorIcon Default value is nullAppearance overview and related methodspublic java.lang.Boolean getShowErrorIcon()
showErrorIcons, showErrorText, and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors:false.
showErrorIcons, showErrorText and showErrorStyle are all boolean properties, and
can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.
The HTML displayed
next to a form item with errors is generated by FormItem.getErrorHTML. The default implementation of that method respects showErrorIcons and
showErrorText as follows:
showErrorIcons, or showErrorIcon at the FormItem
level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance
is governed by errorIconSrc, errorIconWidth and errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The
attribute showTitlesWithErrorMessages may be set to prefix error messages with the form item's title + ":" (may be
desired if the item has showTitle set to false).
errorOrientation controls where the error
HTML should appear relative to form items. Therefore the combination of showErrorText:false and errorOrientation:"left" creates a
compact validation error display consisting of just an icon, to the left of the item with the error message available
via a hover (similar appearance to ListGrid validation error display).
In addition to this,
showErrorStyle determines whether fields with validation errors should have special styling applied to
them. See String for a discussion for how error styling is calculated.
Appearance overview and related methodspublic void setShowErrorStyle(java.lang.Boolean showErrorStyle)
showErrorIcons, showErrorText, and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors:false.
showErrorIcons, showErrorText and showErrorStyle are all boolean properties, and
can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.
The HTML displayed
next to a form item with errors is generated by FormItem.getErrorHTML. The default implementation of that method respects showErrorIcons and
showErrorText as follows:
showErrorIcons, or showErrorIcon at the FormItem
level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance
is governed by errorIconSrc, errorIconWidth and errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The
attribute showTitlesWithErrorMessages may be set to prefix error messages with the form item's title + ":" (may be
desired if the item has showTitle set to false).
errorOrientation controls where the error
HTML should appear relative to form items. Therefore the combination of showErrorText:false and errorOrientation:"left" creates a
compact validation error display consisting of just an icon, to the left of the item with the error message available
via a hover (similar appearance to ListGrid validation error display).
In addition to this,
showErrorStyle determines whether fields with validation errors should have special styling applied to
them. See String for a discussion for how error styling is calculated.
showErrorStyle - showErrorStyle Default value is nullsetCellStyle(java.lang.String),
Appearance overview and related methodspublic java.lang.Boolean getShowErrorStyle()
showErrorIcons, showErrorText, and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors:false.
showErrorIcons, showErrorText and showErrorStyle are all boolean properties, and
can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.
The HTML displayed
next to a form item with errors is generated by FormItem.getErrorHTML. The default implementation of that method respects showErrorIcons and
showErrorText as follows:
showErrorIcons, or showErrorIcon at the FormItem
level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance
is governed by errorIconSrc, errorIconWidth and errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The
attribute showTitlesWithErrorMessages may be set to prefix error messages with the form item's title + ":" (may be
desired if the item has showTitle set to false).
errorOrientation controls where the error
HTML should appear relative to form items. Therefore the combination of showErrorText:false and errorOrientation:"left" creates a
compact validation error display consisting of just an icon, to the left of the item with the error message available
via a hover (similar appearance to ListGrid validation error display).
In addition to this,
showErrorStyle determines whether fields with validation errors should have special styling applied to
them. See String for a discussion for how error styling is calculated.
getCellStyle(),
Appearance overview and related methodspublic void setShowErrorText(java.lang.Boolean showErrorText)
showErrorIcons, showErrorText, and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors:false.
showErrorIcons, showErrorText and showErrorStyle are all boolean properties, and
can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.
The HTML displayed
next to a form item with errors is generated by FormItem.getErrorHTML. The default implementation of that method respects showErrorIcons and
showErrorText as follows:
showErrorIcons, or showErrorIcon at the FormItem
level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance
is governed by errorIconSrc, errorIconWidth and errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The
attribute showTitlesWithErrorMessages may be set to prefix error messages with the form item's title + ":" (may be
desired if the item has showTitle set to false).
errorOrientation controls where the error
HTML should appear relative to form items. Therefore the combination of showErrorText:false and errorOrientation:"left" creates a
compact validation error display consisting of just an icon, to the left of the item with the error message available
via a hover (similar appearance to ListGrid validation error display).
In addition to this,
showErrorStyle determines whether fields with validation errors should have special styling applied to
them. See String for a discussion for how error styling is calculated.
showErrorText - showErrorText Default value is nullAppearance overview and related methodspublic java.lang.Boolean getShowErrorText()
showErrorIcons, showErrorText, and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors:false.
showErrorIcons, showErrorText and showErrorStyle are all boolean properties, and
can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.
The HTML displayed
next to a form item with errors is generated by FormItem.getErrorHTML. The default implementation of that method respects showErrorIcons and
showErrorText as follows:
showErrorIcons, or showErrorIcon at the FormItem
level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance
is governed by errorIconSrc, errorIconWidth and errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The
attribute showTitlesWithErrorMessages may be set to prefix error messages with the form item's title + ":" (may be
desired if the item has showTitle set to false).
errorOrientation controls where the error
HTML should appear relative to form items. Therefore the combination of showErrorText:false and errorOrientation:"left" creates a
compact validation error display consisting of just an icon, to the left of the item with the error message available
via a hover (similar appearance to ListGrid validation error display).
In addition to this,
showErrorStyle determines whether fields with validation errors should have special styling applied to
them. See String for a discussion for how error styling is calculated.
Appearance overview and related methodspublic void setShowFocused(java.lang.Boolean showFocused)
Note : This is an advanced setting
showFocused - showFocused Default value is falsesetCellStyle(java.lang.String),
Appearance overview and related methodspublic java.lang.Boolean getShowFocused()
getCellStyle(),
Appearance overview and related methodspublic void setShowFocusedIcons(java.lang.Boolean showFocusedIcons)
showFocused property.
Note : This is an advanced setting
showFocusedIcons - showFocusedIcons Default value is nullpublic java.lang.Boolean getShowFocusedIcons()
showFocused property.
public void setShowFocusedPickerIcon(java.lang.Boolean showFocusedPickerIcon)
showPickerIcon is true for this item,
should the picker icon show a focused image when the form item has focus?
showFocusedPickerIcon - showFocusedPickerIcon Default value is falsepublic java.lang.Boolean getShowFocusedPickerIcon()
showPickerIcon is true for this item,
should the picker icon show a focused image when the form item has focus?
public void setShowHint(java.lang.Boolean showHint)
Note : This is an advanced setting
showHint - showHint Default value is trueAppearance overview and related methodspublic java.lang.Boolean getShowHint()
Appearance overview and related methodspublic void setShowIcons(java.lang.Boolean showIcons)
icons for
this item.
Note : This is an advanced setting
showIcons - showIcons Default value is truepublic java.lang.Boolean getShowIcons()
icons for
this item.
public void setShowOverIcons(java.lang.Boolean showOverIcons)
showOver
property.
Note : This is an advanced setting
showOverIcons - showOverIcons Default value is nullpublic java.lang.Boolean getShowOverIcons()
showOver
property.
public void setShowPickerIcon(java.lang.Boolean showPickerIcon)
icon for this form item.
Picker icons are customizable via pickerIconProperties. By default they will be rendered inside the Form Item's "control box" area, and will call FormItem.showPicker when clicked.
showPickerIcon - showPickerIcon Default value is falsepublic java.lang.Boolean getShowPickerIcon()
icon for this form item.
Picker icons are customizable via pickerIconProperties. By default they will be rendered inside the Form Item's "control box" area, and will call FormItem.showPicker when clicked.
public void setShowTitle(java.lang.Boolean showTitle)
Note: the default value of this attribute is overridden by some subclasses.
showTitle - showTitle Default value is truepublic java.lang.Boolean getShowTitle()
Note: the default value of this attribute is overridden by some subclasses.
public void setShowValueIconOnly(java.lang.Boolean showValueIconOnly)
valueIcons is set, this property may be set to
show the valueIcon only and prevent the standard form item element or text from displaying
Note : This is an advanced setting
showValueIconOnly - showValueIconOnly Default value is nullpublic java.lang.Boolean getShowValueIconOnly()
valueIcons is set, this property may be set to
show the valueIcon only and prevent the standard form item element or text from displaying
public void setStartRow(java.lang.Boolean startRow)
startRow - startRow Default value is falseFormLayout overview and related methodspublic java.lang.Boolean getStartRow()
FormLayout overview and related methodspublic void setStopOnError(java.lang.Boolean stopOnError)
This property defaults to stopOnError if unset.
Enabling this property also
implies validateOnExit is automatically
enabled. If there are server-based validators on this item, setting this property also implies that synchronousValidation is forced on.
stopOnError - stopOnError Default value is nullpublic java.lang.Boolean getStopOnError()
This property defaults to stopOnError if unset.
Enabling this property also
implies validateOnExit is automatically
enabled. If there are server-based validators on this item, setting this property also implies that synchronousValidation is forced on.
public void setSuppressValueIcon(java.lang.Boolean suppressValueIcon)
valueIcons is set, this property may be set to
prevent the value icons from showing up next to the form items value
Note : This is an advanced setting
suppressValueIcon - suppressValueIcon Default value is nullpublic java.lang.Boolean getSuppressValueIcon()
valueIcons is set, this property may be set to
prevent the value icons from showing up next to the form items value
public void setSynchronousValidation(java.lang.Boolean synchronousValidation)
If false, the form will try to avoid blocking user interaction until it is strictly required. That is until the user attempts to use a FormItem whose state could be affected by a server request that has not yet returned.
synchronousValidation - synchronousValidation Default value is nullpublic java.lang.Boolean getSynchronousValidation()
If false, the form will try to avoid blocking user interaction until it is strictly required. That is until the user attempts to use a FormItem whose state could be affected by a server request that has not yet returned.
public void setTabIndex(java.lang.Integer tabIndex)
tabIndex is automatically assigned as the order that items
appear in the items list.
To specify the tabindex of
an item within the page as a whole (not just this form), use globalTabIndex instead.
tabIndex - tabIndex Default value is nullFocus overview and related methodspublic java.lang.Integer getTabIndex()
tabIndex is automatically assigned as the order that items
appear in the items list.
To specify the tabindex of
an item within the page as a whole (not just this form), use globalTabIndex instead.
Focus overview and related methodspublic void setTextAlign(Alignment textAlign)
align may be used to control alignment of the entire form
item within its cell. May not apply to all form item types.
textAlign - textAlign Default value is Canvas.LEFTAppearance overview and related methodspublic Alignment getTextAlign()
align may be used to control alignment of the entire form
item within its cell. May not apply to all form item types.
Appearance overview and related methodspublic void setTextBoxStyle(java.lang.String textBoxStyle)
NOTE: See the CompoundFormItem_skinning discussion
for special skinning considerations.
textBoxStyle - textBoxStyle Default value is nullsetCellStyle(java.lang.String),
Appearance overview and related methodspublic java.lang.String getTextBoxStyle()
NOTE: See the CompoundFormItem_skinning discussion
for special skinning considerations.
getCellStyle(),
Appearance overview and related methodspublic void setTimeFormatter(TimeDisplayFormat timeFormatter)
"time" though if no explicit dateFormatter is specified it will be respected for other fields as well. If unspecified, a timeFormatter may be
defined at the component level and will be
respected by fields of type "time".
Note : This is an advanced setting
timeFormatter - timeFormatter Default value is nullAppearance overview and related methodspublic TimeDisplayFormat getTimeFormatter()
"time" though if no explicit dateFormatter is specified it will be respected for other fields as well. If unspecified, a timeFormatter may be
defined at the component level and will be
respected by fields of type "time".
Appearance overview and related methodspublic void setTitle(java.lang.String title)
title - title Default value is nullBasics overview and related methodspublic java.lang.String getTitle()
Basics overview and related methodspublic void setTitleAlign(Alignment titleAlign)
If null, dynamically set according to text direction.
titleAlign - titleAlign Default value is nullpublic Alignment getTitleAlign()
If null, dynamically set according to text direction.
public void setTitleColSpan(int titleColSpan)
This setting only applies for items that are showing a title and
whose TitleOrientation is either "left" or "right".
titleColSpan - titleColSpan Default value is 1FormLayout overview and related methodspublic int getTitleColSpan()
This setting only applies for items that are showing a title and
whose TitleOrientation is either "left" or "right".
FormLayout overview and related methodspublic void setTitleOrientation(TitleOrientation titleOrientation)
TitleOrientation lists valid
options. Note that titles on the left or right take up a cell in tabular form layouts, but titles on top do not.
titleOrientation - titleOrientation Default value is Canvas.LEFTDynamicForm.setTitleOrientation(com.smartgwt.client.types.TitleOrientation)public TitleOrientation getTitleOrientation()
TitleOrientation lists valid
options. Note that titles on the left or right take up a cell in tabular form layouts, but titles on top do not.
DynamicForm.getTitleOrientation()public void setTitleStyle(java.lang.String titleStyle)
titleStyle - titleStyle Default value is "formTitle"setCellStyle(java.lang.String)public java.lang.String getTitleStyle()
getCellStyle()public void setTitleVAlign(VerticalAlignment titleVAlign)
titleOrientation is "left" or
"right".
titleVAlign - titleVAlign Default value is Canvas.CENTERpublic VerticalAlignment getTitleVAlign()
titleOrientation is "left" or
"right".
public void setTop(int top)
itemLayout:"absolute".
itemLayout:"absolute" only, set the top coordinate of this form item. Causes the form to redraw.
Note : This is an advanced setting
top - top Default value is 0public int getTop()
itemLayout:"absolute".
public void setValidateOnChange(java.lang.Boolean validateOnChange)
Note that this property can also be set at the form level or on each validator; If true at
the form or field level, validators not explicitly set with validateOnChange:false will be fired on change
- displaying errors and rejecting the change on validation failure.
validateOnChange - validateOnChange Default value is falseDynamicForm.setValidateOnChange(java.lang.Boolean)public java.lang.Boolean getValidateOnChange()
Note that this property can also be set at the form level or on each validator; If true at
the form or field level, validators not explicitly set with validateOnChange:false will be fired on change
- displaying errors and rejecting the change on validation failure.
DynamicForm.getValidateOnChange()public void setValidateOnExit(java.lang.Boolean validateOnExit)
Note that this property can also be set at the form level. If true at either level the validator will be fired on editorExit.
validateOnExit - validateOnExit Default value is falseDynamicForm.setValidateOnExit(java.lang.Boolean)public java.lang.Boolean getValidateOnExit()
Note that this property can also be set at the form level. If true at either level the validator will be fired on editorExit.
DynamicForm.getValidateOnExit()public void setValidOperators(OperatorId... validOperators)
Applies only to
form/formItem when allowExpressions is
true, allowing the user to input expressions.
validOperators - validOperators Default value is nullpublic OperatorId[] getValidOperators()
Applies only to
form/formItem when allowExpressions is
true, allowing the user to input expressions.
public void setValueField(java.lang.String valueField)
displayField values from an optionDataSource, this property denotes the the
field to use as the underlying data value in records from the optionDataSource.name of this form item.
valueField - valueField Default value is nullpublic java.lang.String getValueField()
displayField values from an optionDataSource, this property denotes the the
field to use as the underlying data value in records from the optionDataSource.name of this form item.
public void setValueIconHeight(java.lang.Integer valueIconHeight)
valueIcons is specified, use this property to
specify a height for the value icon written out.
valueIconHeight - valueIconHeight Default value is nullsetValueIconWidth(java.lang.Integer),
setValueIconSize(int)public java.lang.Integer getValueIconHeight()
valueIcons is specified, use this property to
specify a height for the value icon written out.
getValueIconWidth(),
getValueIconSize()public void setValueIconLeftPadding(int valueIconLeftPadding)
valueIconLeftPadding - valueIconLeftPadding Default value is 0setValueIcons(java.util.Map)public int getValueIconLeftPadding()
com.smartgwt.client.widgets.form.fields.FormItem#getValueIconspublic void setValueIconRightPadding(int valueIconRightPadding)
valueIconRightPadding - valueIconRightPadding Default value is 3setValueIcons(java.util.Map)public int getValueIconRightPadding()
com.smartgwt.client.widgets.form.fields.FormItem#getValueIconspublic void setValueIconSize(int valueIconSize)
valueIcons is specified, this property may be
used to specify both the width and height of the icon written out. Note that valueIconWidth and valueIconHeight take precedence over this value, if
specified.
valueIconSize - valueIconSize Default value is 16setValueIconWidth(java.lang.Integer),
setValueIconHeight(java.lang.Integer)public int getValueIconSize()
valueIcons is specified, this property may be
used to specify both the width and height of the icon written out. Note that valueIconWidth and valueIconHeight take precedence over this value, if
specified.
getValueIconWidth(),
getValueIconHeight()public void setValueIconWidth(java.lang.Integer valueIconWidth)
valueIcons is specified, use this property to
specify a width for the value icon written out.
valueIconWidth - valueIconWidth Default value is nullsetValueIconHeight(java.lang.Integer),
setValueIconSize(int)public java.lang.Integer getValueIconWidth()
valueIcons is specified, use this property to
specify a width for the value icon written out.
getValueIconHeight(),
getValueIconSize()public void setVisible(java.lang.Boolean visible)
visible can only be set on creation. After creation, use
FormItem.show and FormItem.hide to manipulate visibility.
visible - visible Default value is trueAppearance overview and related methodspublic java.lang.Boolean getVisible()
visible can only be set on creation. After creation, use
FormItem.show and FormItem.hide to manipulate visibility.
Appearance overview and related methodspublic void setWidth(int width)
column spanning item). See the FormLayout overview for details.
width - width Default value is "*"FormLayout overview and related methods,
Spanning Examplepublic int getWidth()
column spanning item). See the FormLayout overview for details.
FormLayout overview and related methods,
Spanning Examplepublic void setWrapTitle(java.lang.Boolean wrapTitle)
wrapItemTitles at the DynamicForm level.
wrapTitle - wrapTitle Default value is nullpublic java.lang.Boolean getWrapTitle()
wrapItemTitles at the DynamicForm level.
public HandlerRegistration addBlurHandler(BlurHandler handler)
Called when this FormItem loses focus.
addBlurHandler in interface HasBlurHandlershandler - the blur handler
HandlerRegistration used to remove this handlerpublic void blurItem()
public java.lang.Boolean canEditCriterion(Criterion criterion)
DynamicForm.setValuesAsCriteria, this method is used
to determine which sub-criteria apply to which form item(s). This method will be called on each item, and passed the
sub-criterion of the AdvancedCriteria object. It should return true if the item can edit the criterion, otherwise false.
If it returns true, setValuesAsCriteria() will call FormItem.setCriterion to actually apply the criterion to
the form item, and DynamicForm.getValuesAsCriteria can subsequently retrieve the edited criterion by calling FormItem.getCriterion.
Default implementation will
return true if the criterion fieldName and operator match the fieldName and operator (or
default operator) for this item.
criterion - sub-criterion from an AdvancedCriteria object
CriteriaEditing overview and related methodspublic HandlerRegistration addChangeHandler(ChangeHandler handler)
Called when a FormItem's value is about to change as the result of user interaction. This method fires after the user performed an action that would change the value of this field, but before the element itself is changed.
Returning
false cancels the change. Note that if what you want to do is transform the user's input, for example,
automatically change separator characters to a standard separator character, you should implement transformInput rather than using a combination of
change() and setValue() to accomplish the same thing. Returning false from change is intended for
rejecting input entirely, such as typing invalid characters.
Note that if you ask the form for the current value in this handler, you will get the old value because the change has not yet been committed. The new value is available as a parameter to this method.
addChangeHandler in interface HasChangeHandlershandler - the change handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addChangedHandler(ChangedHandler handler)
Called when a FormItem's value has been changed as the result of user interaction. This method fires after the newly specified value has been stored.
addChangedHandler in interface HasChangedHandlershandler - the changed handler
HandlerRegistration used to remove this handlerpublic void clearValue()
Note that if a default value is specified, value will be set to that default value, otherwise value will be cleared, (and removed from the containing form's values).
public HandlerRegistration addClickHandler(ClickHandler handler)
Called when this FormItem is clicked on.
Note: click() is available on StaticTextItem, BlurbItems,
ButtonItem, and derivatives. Other form items (such as HiddenItem) do not support click().
addClickHandler in interface HasClickHandlershandler - the click handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler)
Called when this FormItem is double-clicked.
addDoubleClickHandler in interface HasDoubleClickHandlershandler - the doubleClick handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addFocusHandler(FocusHandler handler)
Called when this FormItem receives focus.
addFocusHandler in interface HasFocusHandlershandler - the focus handler
HandlerRegistration used to remove this handlerpublic void focusInItem()
public Criterion getCriterion()
DynamicForm.getValuesAsCriteria. This API is provided to allow you to specify a more complex criterion than the "field-operator-value" criterions that are built-in. Note that the built-in behavior is generally quite flexible and powerful enough for most requirements. An example of a case where you might want to override this method is if you wanted to implement a date range selection (ie, date > x AND date < y) on a form that was combining its other criteria fields with an "or" operator.
Note that this method is part of the criteria editing subsystem: if overridden, it is likely that you will want to also
override FormItem.hasAdvancedCriteria to
ensure this method is called by the form, and to support editing of existing advanced criteria you may also need to
override FormItem.canEditCriterion and FormItem.setCriterion.
The default implementation
will return a criterion including the form item value, fieldName and specified operator, or a default operator derived from the form item
data type if no explicit operator is specified.
CriteriaEditing overview and related methodspublic Criterion getCriterion(TextMatchStyle textMatchStyle)
DynamicForm.getValuesAsCriteria. This API is provided to allow you to specify a more complex criterion than the "field-operator-value" criterions that are built-in. Note that the built-in behavior is generally quite flexible and powerful enough for most requirements. An example of a case where you might want to override this method is if you wanted to implement a date range selection (ie, date > x AND date < y) on a form that was combining its other criteria fields with an "or" operator.
Note that this method is part of the criteria editing subsystem: if overridden, it is likely that you will want to also
override FormItem.hasAdvancedCriteria to
ensure this method is called by the form, and to support editing of existing advanced criteria you may also need to
override FormItem.canEditCriterion and FormItem.setCriterion.
The default implementation
will return a criterion including the form item value, fieldName and specified operator, or a default operator derived from the form item
data type if no explicit operator is specified.
textMatchStyle - If passed assume the textMatchStyle will be used when performing a fetch operation with these criteria. This may
impact the criterion's operator property.
CriteriaEditing overview and related methodspublic java.lang.String getDisplayFieldName()
displayField for this form item. If
unset, and optionDataSource is explicitly
specified, this method will return the title field for the optionDataSource
public java.lang.String getFieldName()
Drawing overview and related methodspublic java.lang.String getFullDataPath()
name that specifies no dataPath, on a form that specifies a dataPath of /order/items, this
method will return /order/items/name
public FormItemIcon getIcon(java.lang.String name)
name return a pointer to the icon
definition
name - specified name
public int getPageLeft()
Positioning overview and related methodspublic int getPageTop()
Positioning overview and related methodspublic ListGridRecord getSelectedRecord()
optionDataSource when fetchMissingValues
is true, and the missing value is fetched. fetchMissingValues kicks off the fetch when the
form item is initialized with a non null value or when setValue() is called on the item. Note that this method will
return null before the fetch completes, or if no record is found in the optionDataSource matching the underlying value.
public java.lang.String getValueFieldName()
valueField for this
item. If unset, default behavior will return the name
of this field.
optionDataSourcepublic java.lang.Boolean hasAdvancedCriteria()
AdvancedCriteria sub criterion object? If this method
returns true, DynamicForm.getValuesAsCriteria
on the form containing this item will always return an AdvancedCriteria object, calling
FormItem.getCriterion on each item to retrieve the
individual criteria. Default implementation will return true if operator is explicitly specified.
CriteriaEditing overview and related methodspublic void hide()
public HandlerRegistration addIconClickHandler(IconClickHandler handler)
StringMethod. Default action to fire when the user clicks on a form item icon. May be overridden by setting
click on the form item icon directly.
addIconClickHandler in interface HasIconClickHandlershandler - the iconClick handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addIconKeyPressHandler(IconKeyPressHandler handler)
StringMethod. Default action to fire when an icon has keyboard focus and the user types a key. May be
overridden by setting keyPress on the form item icon directly.
addIconKeyPressHandler in interface HasIconKeyPressHandlershandler - the iconKeyPress handler
HandlerRegistration used to remove this handlerpublic void invalidateDisplayValueCache()
displayField, the
value displayed to the user for this item may be derived from another field. The display field can be either another
field value in the same record or a field that must be retrieved from a related optionDataSource if fetchMissingValues is true. In this latter case,
we perform a fetch against the option dataSource when the item value changes in order to determine the display value to
show (and we make the associated record available via FormItem.getSelectedRecord).
We cache this data on the form item, so if the item value changes to a new value, then reverts to a previously-seen value, the display value and selected record are already available without the need for an additional fetch. The cached values will also be kept in synch with the dataSource data assuming it is modified via standard add, update or delete operations.
This method explicitly invalidates this cache of optionDataSource data, and if the item value is non null and fetchMissingValues is still true, re-fetches the data.
public java.lang.Boolean isDisabled()
getDisabled(),
Enable overview and related methodspublic java.lang.Boolean isDrawn()
Drawing overview and related methodspublic HandlerRegistration addItemHoverHandler(ItemHoverHandler handler)
Optional stringMethod to fire when the user hovers over this item. Call com.smartgwt.client.widgets.form.fields.events.ItemHoverEvent#cancel() from within ItemHoverHandler#onItemHover to suppress default behavior of showing
a hover canvas containing the HTML returned by formItem.itemHoverHTML() /
form.itemHoverHTML().
addItemHoverHandler in interface HasItemHoverHandlershandler - the itemHover handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addKeyDownHandler(KeyDownHandler handler)
StringMethod fired in response to a keydown while focused in this form item.
addKeyDownHandler in interface HasKeyDownHandlershandler - the keyDown handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addKeyPressHandler(KeyPressHandler handler)
StringMethod fired when the user presses a key while focused in this form item.
addKeyPressHandler in interface HasKeyPressHandlershandler - the keyPress handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addKeyUpHandler(KeyUpHandler handler)
StringMethod fired in response to a keyup while focused in this form item.
addKeyUpHandler in interface HasKeyUpHandlershandler - the keyUp handler
HandlerRegistration used to remove this handlerpublic void setCriterion(Criterion criterion)
DynamicForm.setValuesAsCriteria when FormItem.canEditCriterion returns true for this item.
Default implementation simply calls FormItem.setValue with the value of the criterion passed in
criterion - criterion to editpublic java.lang.Boolean shouldFetchMissingValue(java.lang.Object newValue)
optionDataSource, should we perform a fetch against that dataSource to find the record that matches this field's value?
If the value is non-null, this method is called when the item is first rendered or whenever the value is changed
via a call to FormItem.setValue. If it returns true,
a fetch will be dispatched against the optionDataSource to get the record matching the value
When the fetch completes, if a record was found that matches the data value (and the form item value has not subsequently changed again), the item will be re-rendered to reflect any changes to the display value, and the record matching the value will be available via getSelectedRecord.
Default behavior will return false if fetchMissingValues is set to
false. Otherwise it will return true if alwaysFetchMissingValues is set to true, or if a displayField is specified for this item and the item
value is not already present in the item's valueMap.
newValue - The new data value of the item.
public void show()
public void stopHover()
public HandlerRegistration addTitleClickHandler(TitleClickHandler handler)
Notification method fired when the user clicks the title for this item
addTitleClickHandler in interface HasTitleClickHandlershandler - the titleClick handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addTitleDoubleClickHandler(TitleDoubleClickHandler handler)
Notification method fired when the user double-clicks the title for this item
addTitleDoubleClickHandler in interface HasTitleDoubleClickHandlershandler - the titleDoubleClick handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addTitleHoverHandler(TitleHoverHandler handler)
Optional stringMethod to fire when the user hovers over this item's title. Call com.smartgwt.client.widgets.form.fields.events.TitleHoverEvent#cancel() from within TitleHoverHandler#onTitleHover to suppress default behavior of
showing a hover canvas containing the HTML returned by formItem.titleHoverHTML() /
form.titleHoverHTML().
addTitleHoverHandler in interface HasTitleHoverHandlershandler - the titleHover handler
HandlerRegistration used to remove this handlerpublic void updateState()
textBoxStyle). Calls to
updateState() normally occur automatically as a consequence of focus changes, items becoming disabled, etc.
This method is advanced and intended only for use in workarounds.
public java.lang.Boolean validate()
public void setInitHandler(FormItemInitHandler initHandler)
initHandler -
public void setAttribute(java.lang.String attribute,
java.lang.String value)
setAttribute in class DataClass
public void setAttribute(java.lang.String attribute,
java.lang.Boolean value)
setAttribute in class DataClass
public void setAttribute(java.lang.String attribute,
java.util.Map value)
setAttribute in class DataClass
public void setAttribute(java.lang.String attribute,
int[] value)
setAttribute in class DataClass
public void setAttribute(java.lang.String attribute,
BaseClass[] value)
setAttribute in class DataClass
public void setAttribute(java.lang.String attribute,
DataClass[] value)
setAttribute in class DataClass
public void setAttribute(java.lang.String attribute,
double value)
setAttribute in class DataClass
public void setAttribute(java.lang.String attribute,
int value)
setAttribute in class DataClass
public void setAttribute(java.lang.String attribute,
java.util.Date value)
setAttribute in class DataClass
public void setAttribute(java.lang.String attribute,
ValueEnum[] value)
setAttribute in class DataClass
public void setAttribute(java.lang.String attribute,
DataClass value)
setAttribute in class DataClass
public void setAttribute(java.lang.String attribute,
JavaScriptObject value)
setAttribute in class DataClass
public void setAttribute(java.lang.String attribute,
java.lang.String[] value)
setAttribute in class DataClass
public void setAttribute(java.lang.String attribute,
boolean value)
setAttribute in class DataClasspublic java.lang.String getAttribute(java.lang.String attribute)
getAttribute in class DataClasspublic java.lang.String getAttributeAsString(java.lang.String attribute)
getAttributeAsString in class DataClasspublic java.util.Date getAttributeAsDate(java.lang.String attribute)
getAttributeAsDate in class DataClasspublic java.lang.Double getAttributeAsDouble(java.lang.String attribute)
getAttributeAsDouble in class DataClasspublic JavaScriptObject getAttributeAsJavaScriptObject(java.lang.String attribute)
getAttributeAsJavaScriptObject in class DataClasspublic java.lang.Integer getAttributeAsInt(java.lang.String attribute)
getAttributeAsInt in class DataClasspublic java.lang.Float getAttributeAsFloat(java.lang.String attribute)
getAttributeAsFloat in class DataClasspublic java.lang.Boolean getAttributeAsBoolean(java.lang.String attribute)
getAttributeAsBoolean in class DataClass
public void setProperty(java.lang.String property,
java.lang.String value)
public void setProperty(java.lang.String property,
boolean value)
public void setProperty(java.lang.String property,
int value)
public void setProperty(java.lang.String property,
double value)
public void setProperty(java.lang.String property,
JavaScriptObject value)
protected boolean isCreated()
isCreated in class JsObjectpublic void setOptionDataSource(DataSource dataSource)
public void setName(java.lang.String name)
name - name Default value is nullpublic java.lang.String getName()
public void setValidators(Validator... validators)
validators - the validatorspublic void setIcons(FormItemIcon... icons)
icons - icons Default value is nullpublic void setErrorOrientation(FormErrorOrientation errorOrientation)
showInlineErrors is true, where
should the error icon and text appear relative to the form item itself. Valid options are "top",
"bottom", "left" or "right".errorOrientation.
errorOrientation - errorOrientation Default value is nullpublic void setType(java.lang.String type)
type - type Default value is "text"public void setColSpan(java.lang.String colSpan)
The colSpan setting does not include the title shown
for items with showTitle:true, so the
effective colSpan is one higher than this setting for items that are showing a title and whose
TitleOrientation is either "left" or "right".
colSpan - colSpan Default value is 1public void setColSpan(int colSpan)
The colSpan setting does not include the title shown
for items with showTitle:true, so the
effective colSpan is one higher than this setting for items that are showing a title and whose
TitleOrientation is either "left" or "right".
colSpan - colSpan Default value is 1public java.lang.String getType()
public void setDefaultValue(java.lang.String defaultValue)
null programatically, it will be reverted to the defaultValue. Developers
should use the values object if their intention
is to provide an initial value for a field in a form rather than a value to use in place of null.
defaultValue - defaultValue Default value is nullpublic void setDefaultValue(java.lang.Integer defaultValue)
null programatically, it will be reverted to the defaultValue. Developers
should use the values object if their intention
is to provide an initial value for a field in a form rather than a value to use in place of null.
defaultValue - defaultValue Default value is nullpublic void setDefaultValue(java.util.Date defaultValue)
null programatically, it will be reverted to the defaultValue. Developers
should use the values object if their intention
is to provide an initial value for a field in a form rather than a value to use in place of null.
defaultValue - defaultValue Default value is nullpublic void setDefaultValue(java.lang.Boolean defaultValue)
null programatically, it will be reverted to the defaultValue. Developers
should use the values object if their intention
is to provide an initial value for a field in a form rather than a value to use in place of null.
defaultValue - defaultValue Default value is nullpublic void setDefaultValue(java.lang.Float defaultValue)
null programatically, it will be reverted to the defaultValue. Developers
should use the values object if their intention
is to provide an initial value for a field in a form rather than a value to use in place of null.
defaultValue - defaultValue Default value is nullpublic void setValueMap(java.lang.String... valueMap)
valueMap - the value mappublic void setValueMap(java.util.LinkedHashMap valueMap)
valueMap - the value mappublic void setValueIcons(java.util.Map valueIcons)
valueIcons - mapping of logical values for this item to icon src URLspublic void setWidth(java.lang.String width)
public void setHeight(java.lang.String height)
public void setRedrawOnChange(boolean redrawOnChange)
redrawOnChange - true to redraw on change. Default is falsepublic void setEditorType(FormItem editorType)
The type of FormItem to use for
editing is normally derived automatically from type, which is the data type of the field, by the rules explained here.
Note : When you supply a custom FormItem via setEditorType(), you're really providing properties which are then used to create
multiple FormItems (eg, in grids, forms and trees) and there's an underlying limitation here where event handlers have to be written to
dynamically receive the actual FormItem rather than relying on "this" (because there's more than one "this").
editorType - editorType Default value is nullpublic void setValue(int value)
public void setValue(float value)
public void setValue(double value)
value - the form item valuepublic void setValue(java.util.Date value)
value - the form item valuepublic void setValue(java.lang.String value)
value - the form item valuepublic void setValue(boolean value)
value - the form item valuepublic void setValue(java.lang.Object value)
FormItemValueParser and FormItemValueFormatter
API's for custom value parsing and formatting.
value - the form item valuepublic java.lang.String getDisplayValue()
public java.lang.String getDisplayValue(java.lang.String value)
public int getVisibleHeight()
public int getVisibleWidth()
public Rectangle getPageRect()
public Rectangle getRect()
public void redraw()
setRedrawOnChange(boolean)public Rectangle getIconRect(FormItemIcon icon)
public Rectangle getIconPageRect(FormItemIcon icon)
public JavaScriptObject getConfig()
public JavaScriptObject getEditorTypeConfig()
public void setTooltip(java.lang.String tooltip)
setPrompt(java.lang.String).
tooltip - tooltip Default value is nullpublic java.lang.String getTooltip()
getPrompt()
public void setOptionFilterContext(RPCRequest rpcRequestProperties)
optionDataSource, and this property is
not null, this will be passed to the datasource as RPCRequest properties when
performing the fetch operation on the dataSource to obtain a data-value to display-value
mapping
Note : This is an advanced setting
rpcRequestProperties - optionFilterContext Default value is nullpublic RPCRequest getOptionFilterContext()
optionDataSource, and this property is
not null, this will be passed to the datasource as RPCRequest properties when
performing the fetch operation on the dataSource to obtain a data-value to display-value
mapping
public void setOptionCriteria(Criteria optionCriteria)
optionDataSource, and this property may be used
to specify criteria to pass to the datasource when
performing the fetch operation on the dataSource to obtain a data-value to display-value
mapping
Note : This is an advanced setting
optionCriteria - optionCriteria Default value is nullpublic Criteria getOptionCriteria()
optionDataSource, and this property may be used
to specify criteria to pass to the datasource when
performing the fetch operation on the dataSource to obtain a data-value to display-value
mapping
public void setShowIfCondition(FormItemIfFunction showIf)
showIf - the showIf handlersetRedrawOnChange(boolean)public void setErrorFormatter(FormItemErrorFormatter errorFormatter)
errorFormatter - the error formatter.public void setInputTransformer(FormItemInputTransformer inputTransformer)
change event.
inputTransformer - the input transformerpublic void setItemHoverFormatter(FormItemHoverFormatter hoverFormatter)
hoverFormatter - the hover formatterpublic void setItemTitleHoverFormatter(FormItemHoverFormatter hoverFormatter)
hoverFormatter - the hover formatterpublic DynamicForm getForm()
Note that you must treat this as a read-only reference to the from
public java.lang.Object getValue()
Note that for FormItems that have a ValueMap or where a formatter has been defined, getValue()
returns the underlying value of the FormItem, not the displayed value.
public void showPicker()
this.showPickerIcon to true. May also be called programatically.
public void setValueFormatter(FormItemValueFormatter formatter)
FormItemValueFormatter, if provided, is evaluated to get the
display value to show for this form items underlying data value. This provides a way to perform a more complex data
to display value manipulation than a simple valueMap. Note that this method will not be applied to values displayed in a freeform text entry field (such as a
TextItem or TextAreaItem), where an equivalent parser method would be required to convert a
user-entered value back into a data value. Use setEditorValueFormatter(com.smartgwt.client.widgets.form.FormItemValueFormatter) and setEditorValueParser(com.smartgwt.client.widgets.form.FormItemValueParser) instead for these cases.
formatter - the FormItemValueFormatterpublic void setEditorValueFormatter(FormItemValueFormatter formatter)
FormItemValueFormatter to map this item's current data value to a
display value. Note that this only applies to items which show a freeform entry area, such as a TextItem or TextAreaItem. For
display values which will not be directly manipulated by the user, use setValueFormatter(com.smartgwt.client.widgets.form.FormItemValueFormatter) instead.
See also setEditorValueParser(com.smartgwt.client.widgets.form.FormItemValueParser).
formatter - the FormItemValueFormatterpublic void setEditorValueParser(FormItemValueParser valueParser)
FormItemValueParser to map a user-entered display value to a data
value for storage. This method only applies to form items which show a freeform text entry area, such at the TextItem or TextAreaItem.
See also com.smartgwt.client.widgets.form.fields.FormItem#formatEditorValue
valueParser - the FormItemValueParserpublic void setValueIconMapper(ValueIconMapper valueIconMapper)
setValueIcons(java.util.Map).
valueIconMapper - the valueIconMapperpublic void setDisplayFormat(DateDisplayFormat displayFormat)
"date" or "time" will be edited using a DateItem or TimeItem by
default. However this can be overridden - for canEdit:false fields, a StaticTextItem is used by default, and the developer can always specify a
custom editorType as well as data type.
For fields of type "date", set
this property to a valid DateDisplayFormat to specify how the date should be
formatted.
For fields of type "time", set this property to a valid timeFormatter to specify how the time should be formatted.
Note that if
dateFormatter or timeFormatter are specified they will take precedence
over this setting.
If this field is of type "date" and is editable, the inputFormat may be used to specify how user-edited date
strings will be parsed.
Note : This is an advanced setting
displayFormat - displayFormat Default value is nullsetInputFormat(java.lang.String),
setDateFormatter(com.smartgwt.client.types.DateDisplayFormat),
setTimeFormatter(com.smartgwt.client.types.TimeDisplayFormat)public void setDisplayFormat(TimeFormatter displayFormat)
"date" or "time" will be edited using a DateItem or TimeItem by
default. However this can be overridden - for canEdit:false fields, a StaticTextItem is used by default, and the developer can always specify a
custom editorType as well as data type.
For fields of type "date", set
this property to a valid DateDisplayFormat to specify how the date should be
formatted.
For fields of type "time", set this property to a valid timeFormatter to specify how the time should be formatted.
Note that if
dateFormatter or timeFormatter are specified they will take precedence
over this setting.
If this field is of type "date" and is editable, the inputFormat may be used to specify how user-edited date
strings will be parsed.
Note : This is an advanced setting
displayFormat - displayFormat Default value is nullsetInputFormat(java.lang.String),
setDateFormatter(com.smartgwt.client.types.DateDisplayFormat),
setTimeFormatter(com.smartgwt.client.types.TimeDisplayFormat)public void enable()
#setDisabled(Boolean),setDisabled(false)).
public void disable()
#setDisabled(Boolean),setDisabled(true)).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||