Class DynamicForm
- All Implemented Interfaces:
HasAttachHandlers
,HasHandlers
,EventListener
,HasVisibility
,IsWidget
,LogicalStructure
,DataBoundComponent
,HasClearHandlers
,HasClickHandlers
,HasDoubleClickHandlers
,HasDragCompleteHandlers
,HasDragMoveHandlers
,HasDragRepositionMoveHandlers
,HasDragRepositionStartHandlers
,HasDragRepositionStopHandlers
,HasDragResizeMoveHandlers
,HasDragResizeStartHandlers
,HasDragResizeStopHandlers
,HasDragStartHandlers
,HasDragStopHandlers
,HasDropCompleteHandlers
,HasDropHandlers
,HasDropMoveHandlers
,HasDropOutHandlers
,HasDropOverHandlers
,HasFetchDataHandlers
,HasFocusChangedHandlers
,HasHoverHandlers
,HasHoverHiddenHandlers
,HasKeyDownHandlers
,HasKeyPressHandlers
,HasMouseDownHandlers
,HasMouseMoveHandlers
,HasMouseOutHandlers
,HasMouseOverHandlers
,HasMouseStillDownHandlers
,HasMouseUpHandlers
,HasMouseWheelHandlers
,HasMovedHandlers
,HasParentMovedHandlers
,HasResizedHandlers
,HasRightMouseDownHandlers
,HasRuleContextChangedHandlers
,HasScrolledHandlers
,HasShowContextMenuHandlers
,HasVisibilityChangedHandlers
,HasAsyncValidationReplyHandlers
,HasFormSubmitFailedHandlers
,HasHiddenValidationErrorsHandlers
,HasItemChangedHandlers
,HasItemChangeHandlers
,HasItemKeyPressHandlers
,HasSubmitValuesHandlers
,HasValuesChangedHandlers
- Direct Known Subclasses:
PropertySheet
,SearchForm
layout
, value management, validation and
databinding for the controls it manages.
To create a DynamicForm, create several FormItem
s and pass them to
setItems()
. For example:
DynamicForm form = new DynamicForm(); TextItem textItem = new TextItem("userName"); SelectItem selectItem = new SelectItem("usState"); form.setItems(textItem, selectItem);The item
name
is an identifier for the item that must be unique just within
this form. It is used:
- as the name under which the item's value is stored in the form (the form's
current values are accessible as
form.getValues()
- when retrieving the FormItem's current value (via
form.getValue()
) - to retrieve the item itself via
form.getItem()
setDataSource()
. In this case, FormItems are
chosen based on the data type of the field - see FormItemType
. You can override
the automatically chosen FormItem via DataSourceField.editorType
.
FormItem lifecycle is managed by the DynamicForm itself. FormItem instances are created and destroyed automatically when new fields are added to the form.
When using DataSource binding, you can also add additional FormItems not specified in the DataSource, or override any properties on the automatically generated FormItems, without having to re-declare any information that comes from the DataSource. See the QuickStart Guide chapter on Data Binding for an overview.
All FormItems share a common set of properties for controlling form\n
layout
. Other properties common to all FormItems are documented on the FormItem
class, and properties specific to particular FormItems are documented on the respective
FormItems.
NOTE: For very simple forms consisting of exactly one item, you still use a DynamicForm. See the "fontSelector" form in the Toolstrip example.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
-
Field Summary
Fields inherited from class com.smartgwt.client.widgets.BaseWidget
config, configOnly, factoryCreated, factoryProperties, id, nativeObject, scClassName
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd a asyncValidationReply handler.Add acom.smartgwt.client.widgets.DragCompleteHandler
.Add acom.smartgwt.client.widgets.DropCompleteHandler
.addFetchDataHandler
(FetchDataHandler handler) Add a fetchData handler.Add a formSubmitFailed handler.void
Convenience method to display a {@link com.smartgwt.client..FormulaBuilder} to create a new Formula Field.Add a hiddenValidationErrors handler.addItemChangedHandler
(ItemChangedHandler handler) Add a itemChanged handler.addItemChangeHandler
(ItemChangeHandler handler) Add a itemChange handler.Add a itemKeyPress handler.Add a submitValues handler.void
Convenience method to display a {@link com.smartgwt.client..SummaryBuilder} to create a new Summary Field.Add a valuesChanged handler.Whether at least one item is selected
void
This method is called automatically by the DynamicForm when the set of items changes and ensures that items show up in the correct tab order positions.void
Deprecated.As of Smartclient version 13.0, due to the removal of Apache Struts.void
If the form or valuesManager has associated userTask workflow task than notify it about cancelling the changes.static void
changeAutoChildDefaults
(String autoChildName, Canvas defaults) Changes the defaults for Canvas AutoChildren namedautoChildName
.static void
changeAutoChildDefaults
(String autoChildName, FormItem defaults) Changes the defaults for FormItem AutoChildren namedautoChildName
.Performs silent validation of the current form values, likevaluesAreValid()
.checkForValidationErrors
(ValidationStatusCallback callback, boolean validateHiddenFields) checkForValidationErrors
(ValidationStatusCallback callback, boolean validateHiddenFields, boolean skipServerValidation) Performs silent validation of the current form values, likevaluesAreValid()
.void
clearErrors
(boolean show) Clears all errors for this DynamicForm.void
clearFieldErrors
(String fieldName, boolean show) Clear any validation errors on the field passed in.void
clearValue
(String fieldName) Clears the value for some field via a call toFormItem.clearValue()
if appropriate.void
Reset to default form values and clear errorsvoid
Finish editing and store edited values inprocess state
.protected JavaScriptObject
create()
void

 Deselect all records

void
deselectRecord
(int record) Deselect aRecord
passed in explicitly, or by index.void
deselectRecord
(Record record) Deselect aRecord
passed in explicitly, or by index.void
deselectRecords
(int[] records) Deselect a list ofRecord
s passed in explicitly, or by index.void
deselectRecords
(Record[] records) Deselect a list ofRecord
s passed in explicitly, or by index.void
disableHilite
(String hiliteID) Disable a hilite

void
Disable all hilites.

void
Shows a FieldPicker interface allowing end-users to rearrange the order and visibiility of the fields in the associated DataBoundComponent.void
Shows a HiliteEditor interface allowing end-users to edit the data-hilites currently in use by this DataBoundComponent.void
Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified).void
editNewRecord
(Record initialValues) Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified).void
editNewRecord
(Map initialValues) Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified).void
editRecord
(Record record) Edit an existing record.void
editSelectedData
(ListGrid selectionComponent) Edit the record selected in the specified ListGrid.void
editSelectedData
(String listGridID) Edit the record selected in the specified ListGrid.void
enableHilite
(String hiliteID) Enable / disable ahilites


void
enableHilite
(String hiliteID, boolean enable) Enable / disable ahilites


void
Enable all hilites.

void
enableHiliting
(boolean enable) Enable all hilites.

void
void
exportData
(DSRequest requestProperties) void
exportData
(DSRequest requestProperties, RPCCallback callback) Uses a "fetch" operation on the currentDataSource
to retrieve data that matches the current filter and sort criteria for this component, then exports the resulting data to a file or window in the requested format.void
Retrieves data from the DataSource that matches the specified criteria.void
Retrieves data from the DataSource that matches the specified criteria.void
fetchData
(Criteria criteria, DSCallback callback) Retrieves data from the DataSource that matches the specified criteria.void
fetchData
(Criteria criteria, DSCallback callback, DSRequest requestProperties) Retrieves data from the DataSource that matches the specified criteria.void
fetchRelatedData
(ListGridRecord record, Canvas schema) Based on the relationship between the DataSource this component is bound to and the DataSource specified as the "schema" argument, call fetchData() to retrieve records in this data set that are related to the passed-in record.void
fetchRelatedData
(ListGridRecord record, Canvas schema, DSCallback callback) void
fetchRelatedData
(ListGridRecord record, Canvas schema, DSCallback callback, DSRequest requestProperties) Based on the relationship between the DataSource this component is bound to and the DataSource specified as the "schema" argument, call fetchData() to retrieve records in this data set that are related to the passed-in record.boolean
fieldIsEditable
(int field) Can the field be edited? This method looks atcanEdit
for the grid as well as theFormItem.canEdit
value, to determine whether editing is actually allowed.boolean
fieldIsEditable
(FormItem field) Can the field be edited? This method looks atcanEdit
for the grid as well as theFormItem.canEdit
value, to determine whether editing is actually allowed.boolean
fieldIsEditable
(String field) Can the field be edited? This method looks atcanEdit
for the grid as well as theFormItem.canEdit
value, to determine whether editing is actually allowed.void
Retrieves data that matches the provided criteria and displays the matching data in this component.void
filterData
(Criteria criteria) Retrieves data that matches the provided criteria and displays the matching data in this component.void
filterData
(Criteria criteria, DSCallback callback) Retrieves data that matches the provided criteria and displays the matching data in this component.void
filterData
(Criteria criteria, DSCallback callback, DSRequest requestProperties) Retrieves data that matches the provided criteria and displays the matching data in this component.find
(AdvancedCriteria adCriteria) Filters all objects according to the AdvancedCriteria passed and returns the first matching object or null if not foundRecord[]
findAll
(AdvancedCriteria adCriteria) Filters all objects according to the AdvancedCriteria passedint
findIndex
(AdvancedCriteria adCriteria) Finds the index of the first Record that matches with the AdvacendCriteria passed.int
findNextIndex
(int startIndex, AdvancedCriteria adCriteria) LikeRecordList.findIndex(java.util.Map)
, but considering the startIndex parameter.int
findNextIndex
(int startIndex, AdvancedCriteria adCriteria, int endIndex) LikeRecordList.findIndex(java.util.Map)
, but considering the startIndex and endIndex parameters.void
focus()
Give keyboard focus to this form.void
focusInItem
(int itemNumber) Move the keyboard focus into a particular item.void
focusInItem
(FormItem formItem) Move the keyboard focus into a particular item.void
focusInItem
(String itemName) Move the keyboard focus into a particular item.The URL to which the form will submit its values.Indicates whether to add "drop values" to items dropped on this component, if both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key.Text for a menu item allowing users to add a formula fieldoperationId
this component should use when performing add operations.Text for a menu item allowing users to add a formula fieldFor a form that produces filter criteria (seeform.getValuesAsCriteria()
), allows the user to enter simple expressions in any field in this form that takes text input.Should this form allow browser auto-completion of its items' values? Applies only to items based on native HTML form elements (TextItem
,PasswordItem
, etc), and will only have a user-visible impact for browsers where native autoComplete behavior is actually supported and enabled via user settings.IfDataBoundComponent.setAutoFetchData(Boolean)
is true, this attribute determines whether the initial fetch operation should be performed viaDataBoundComponent.fetchData()
orDataBoundComponent.filterData()
If true, when this component is first drawn, automatically callDataBoundComponent.fetchData()
orDataBoundComponent.filterData()
depending onDataBoundComponent.getAutoFetchAsFilter()
.IfautoFetchData
istrue
, this attribute allows the developer to specify a textMatchStyle for the initialDataBoundComponent.fetchData()
call.If true, when the form is drawn, focus will automatically be put into the first focusable element in the form.
Note that to put focus in a different item you can explicitly calldynamicForm.focusInItem(itemName)
If true, whenvalidation
fails focus will automatically be put into the first focusable field which failed validation.If this browser has a 'spellCheck' feature for text-based form item elements, should it be used for items in this form? Can be overridden at the item level viaFormItem.browserSpellCheck
Adds an item to the header context menu allowing users to launch a dialog to define a new
 field based on values present in other fields, using the {@link com.smartgwt.client..FormulaBuilder}.
Adds an item to the header context menu allowing users to launch a dialog to define a new
 text field that can contain both user-defined text and the formatted values present in other 
 fields, using the {@link com.smartgwt.client..SummaryBuilder}.
If set tofalse
, the form will be marked read-only.If this component is bound to a dataSource, this attribute may be specified to customize what fields from the dataSource may be edited by default.DynamicForms are considered to have focus if any of their form items have focus.Governs whether this form will be used to perform a standard HTML form submission.Should users be able to tab into theicons
andpicker icon
for items within this form by default?If true, the headers for anySectionItems
will be included in the page's tab order for accessibility.int
Width of border for the table that form is drawn in.int
The amount of empty space, in pixels, surrounding each form item within its cell in the layout grid.int
Deprecated.usegetCellPadding()
insteadReturns all values within this DynamicForm that have changed sinceDynamicForm.rememberValues
last ran.boolean
For dynamicForms containing aFileItem
for uploading files, should the browser verify that the file is accessible before submitting the uploaded file to the server?boolean
Should the titles for form items be clipped if they are too large for the available space?DefaultFormItem.clipStaticValue
setting for items in this form.A DynamicForm is adataArity
:single component.How to fetch and manage records retrieve from the server.int
When usingdata paging
, how many records to fetch at a time.The DataSource that this component should bind to for default fields and for performingDataSource requests
.DefaultDateDisplayFormat
for Date type values displayed in this form.DefaultDateDisplayFormat
for Date type values displayed in this form in fields of typedatetime
.Before we start editing values in this DataBoundComponent, should we perform a deep clone of the underlying values.Defaultsearch operator
to use for fields in a form that producesAdvancedCriteria
.If set to true, client-side validators will not run on the form when validate() is called.Record[]
During a drag-and-drop interaction, this method returns the set of records being dragged out of the component.Indicates what to do with data dragged into another DataBoundComponent.CSS Style to apply to the drag tracker when dragging occurs on this component.When an item is dropped on this component, andaddDropValues
is true and both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key, this object provides the "drop values" that Smart GWT will apply to the dropped object before updating it.Message to show when a user attempts to transfer duplicate records into this component, and
preventDuplicates
is enabled.Text for a menu item allowing users to edit a formula fieldDefault class used to construct theEditProxy
for this component when the component isfirst placed into edit mode
.Text for a menu item allowing users to edit the formatter for a fieldencoding for the form, use MULTIPART_ENCODING for file upload formsIfshowInlineErrors
is false we show all errors for the form item in a single item rendered at the top of the form.
This attribute specifies the cellStyle to apply to this item.Returns the set of errors.IfshowInlineErrors
isfalse
, all errors for the items in the form are rendered as a single item at the top of the form.If the current mouse event occurred over an item in this dynamicForm, returns that item.getEventItemInfo
(String fieldName) If the current mouse event occurred over an item, or the title of an item in this dynamicForm, return details about where the event occurred.Setting exportAll to true prevents the component from passing its list of fields to the 
 export call.String[]
The list of field-names to export.If Summary rows exist for this component, whether to include them when exporting client data.Operation ID this component should use when performing fetch operations.IfautoFetchData
istrue
, this attribute allows the developer to declaratively specifyDSRequest
properties for the initialfetchData()
call.Retrieve a field from this form byname
.Retrieve a field from this form byname
.Returna an array of field alignments for this gridint
Return the number of fields.String[]
getFieldErrors
(String fieldName) Returns any validation errors for some field in this valuesManager.FormItem[]
Return the form fields.FormItem[]
Return the form fields.Return the fields as JavaScriptObjects rather than as SmartGWT Java wrappers of the field class type (e.g.Warning to display to the user if a selected file in an UploadItem cannot be accessed.If true, we ensure that column widths are at least as large as you specify them.Return the current focus item for this form.Deprecated.Marker that can be set on a record to flag that record as hilited.Indicates whether the titles of required items in this form should use the special prefix and suffix specified by therequiredTitlePrefix
andrequiredTitleSuffix
attributes, instead of the standard prefix and suffix.Hilite[]
Return the set of hilite-objects currently applied to this DataBoundComponent.Get the current hilites encoded as a String, for saving.Criteria that are never shown to or edited by the user and are cumulative with any criteria provided viaDataBoundComponent.initialCriteria
,DataBoundComponent.setCriteria()
etc.When true, indicates that changes to items in this form will be automatically saved on adelay
, as well as when the entire form is submitted.int
WhenimplicitSave
is true, this attribute dictates the millisecond delay after which form items are automatically saved during editing.If true, form item values will be automatically saved when each item's "editorExit" handler is fired as well as on a delay and when the entire form is submitted.Criteria to use whenDataBoundComponent.setAutoFetchData(Boolean)
is used.An array ofSortSpecifier
objects used to set up the initial sort configuration for this form.Retrieve a FormItem in this form byname
ordataPath
.Text alignment for hovers shown for itemsint
If the user rolls over an item, how long a delay before we fire any hover action / show a hover for that item?A default height for hovers shown for itemsA default height for hovers shown for itemsOpacity for hovers shown for itemsCSS Style for hovers shown for itemsVertical text alignment for hovers shown for itemsVertical text alignment for hovers shown for itemsA default width for hovers shown for itemsA default width for hovers shown for itemsLayout style to use with this form.When a form is rendered inlinearMode
, should each item appear on its own row, spanning the full set of rendered columns by default?int
WhenlinearMode
is true, this property sets the amount of space reserved forhint-text
in formItems that set a hint.WhenlinearMode
is true, this property sets the amount of space reserved forhint-text
in formItems that set a hint.Switches the entire form to render in a style that is typical for form on a mobile device with oneFormItem
per row.Specifies thenumber of columns
when the form is being rendered inlinearMode
, overriding any automatically derived value in that mode.boolean
Switches the entire form to render in a style that is typical for form on ahandset device
with oneFormItem
per row by automatically defaultinglinearMode
totrue
on handsets.Getter implementing theLogicalStructure
interface, which supports Eclipse's logical structure debugging facility.int
When creating form items for fields with text type data, if the specified length of the field exceeds this threshold we will create form item of typethis.longTextEditorType
(a TextAreaItem by default), rather than a simple text item.Name of the Form Item class to use for text fields which exceed the longTextEditorThreshold for this form.The mechanism by which form data is sent to the action URL.int
Minimum width of a form column.Minimum horizontal space made available forFormItem.hint
text.A message to display to the user if server-side validation fails with an error but the server did not provide an error messageint
The number of columns of titles and items in this form's layout grid.Returns the set of values last stored byDynamicForm.rememberValues
.WhenFormItem.operator
has been set for anyFormItem
in this form, what logical operator should be applied across thecriteria
produced by the form items? Only applicable to forms that have adataSource
.static DynamicForm
getOrCreateRef
(JavaScriptObject jsObj) Default template HTML string when an item does not set its ownFormItem.originalValueMessage
.If set, detect and prevent duplicate records from being transferred to this component, either via
 drag and drop or viaDataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent)
.Indicates whether or not this component will load its dataprogressively
IfcanEdit
is set tofalse
, how should the items in this form be displayed to the user?DefaultFormItem.readOnlyTextBoxStyle
setting for items in this form.int
getRecordIndex
(Record record) Get the index of the provided record.
Return the underlying data of this DataBoundComponent as aRecordList
.If validateOnChange is true, and validation fails for an 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.operationId
this component should use when performing remove operations.The required message for required field errors.The string pre-pended to the title of every required item in this form ifhiliteRequiredFields
is true and theTitleOrientation
property is set to "right".The string appended to the title of every required item in this form ifhiliteRequiredFields
is true and theTitleOrientation
property is set to "right".The string pre-pended to the title of every required item in this form ifhiliteRequiredFields
is true.The string appended to the title of every required item in this form ifhiliteRequiredFields
is true.Return the underlying data of this DataBoundComponent as aResultSet
.Keyboard shortcut that causes the value of the currently focused form item to be reverted to whatever value would be shown ifresetValues()
were called.The string pre-pended to the title of an item in this form if its titleOrientation property is set to "right".The string appended to the title of an item in this form if its titleOrientation property is set to "right".Optional identifier for saved searches that should be applied to this component.Iftrue
, when the user hits the Enter key while focused in a text-item in this form, we automatically submit the form to the server using thesubmit()
method.DefaultDSOperationType
to be performed whensaveData()
is called.getSaveOperationType
(DSRequest requestProperties) DefaultDSOperationType
to be performed whenDynamicForm.saveData
is called.If the form has sections, [implemented asSectionItem
s], this attribute controls whether multiple sections can be expanded at once.If this property is set to true, whenever a text-based field in this form (TextItem
,TextAreaItem
) is given focus - whether programmatically (seefocusInItem()
), or via a mouse click, all text within the item will be selected.If this property is set to true, whenever a text-based field in this form (TextItem
,TextAreaItem
) is given focus programmatically (seefocusInItem()
), all text within the item will be selected.Whether to show fields of non-atomic types when a DataBoundComponent is given a
 DataSource but nocomponent.fields
.
If set, thisDynamicForm
will set bothshowComplexFields
andshowComplexFieldsRecursively
on any nested component used for showing/editing a complex field.DefaultFormItem.showDeletions
setting for items in this form.For databound forms, whether to show fields marked as detail fields.showErrorIcons
,showErrorText
,errorOrientation
, andshowErrorStyle
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).showErrorIcons
,showErrorText
,errorOrientation
, andshowErrorStyle
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).showErrorIcons
,showErrorText
,errorOrientation
, andshowErrorStyle
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).Whether to show fields markedhidden:true
when a DataBoundComponent is given a
 DataSource but nocomponent.fields
.
boolean
For fields oftype:"image"
, if the field is non editable, and being displayed withreadOnlyDisplay:"static"
, should the value (URL) be displayed as text, or should an image be rendered?If true, field errors are written into the form next to the item(s) where the errors occurred.Default setting for the form items'FormItem.showOldValueInHover
setting.This property applies to all of the items that a form has, and works according toFormItem.showPending
.boolean
Whether to associate saved searches by default with the currentDataSource
of a component when asavedSearchId
is not provided.Indicates whether on validation failure, the error message displayed to the user should be pre-pended with the title for the item.static Boolean
Returns true if the system is set to skip conversion of the Javascript object to a Java Map when calling the mapDisplayToValue() API.getSort()
Returns the currentSortSpecifiers
for this component.If true,ListGrid.getFieldState()
andListGrid.setFieldState(java.lang.String)
will omit state information for hidden fields by default.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.For editable fields with a specifiedFormItem.displayField
andFormItem.optionDataSource
, if the user selects a new value (typically from PickList based item such as a SelectItem), should the selected displayValue be updated on the record being edited in addition to the value for the actual item.
Note that this only applies for fields usinglocal display field values
- typicallyforeignKey fields
where the display field isincluded from
another dataSource.boolean
DefaultTextItem.suppressBrowserClearIcon
value for TextItems within this form.When callingsaveData()
on a form or valuesManager, by default if the server returns an error code, any callback passed into saveData() will not be fired.If enabled, whenever validation is triggered and a request to the server is required, user interactivity will be blocked until the request returns.The name of a window or frame that will receive the results returned by the form's action.DefaultTimeDisplayFormat
fortype:"time"
field values displayed in this form.Default alignment for item titles.Method to return the fieldName which represents the "title" for records in this
 Component.

 If this.titleField is explicitly specified it will always be used.
 Otherwise, default implementation will checktitleField
for databound
 components.

 For non databound components returns the first defined field name of"title"
, 
"name"
, or"id"
.getTitleFieldValue
(Record record) Get the value of the titleField for the passed record
Default orientation for titles for items in this form.The string pre-pended to the title of every item in this form.The string appended to the title of every item in this form.The error message for a failed validator that does not specify its own errorMessage.operationId
this component should use when performing update operations.If true, the set of fields given by the "default binding" (see 
fields
) is used, with any fields specified in
component.fields
acting as overrides that can suppress or modify the
 display of individual fields, without having to list the entire set of fields that
 should be shown.
TheuseFlatFields
flag causes all simple type fields anywhere in a nested
 set of DataSources to be exposed as a flat list for form binding.Associated userTask if current dynamic form used along with workflow.If true, form fields will be validated when each item's "change" handler is fired as well as when the entire form is submitted or validated.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.validationURL can be set to do server-side validation against a different URL from where the form will ultimately save, as part of an incremental upgrade strategy for Struts-like applications.getValueAsString
(String fieldName) An Object containing the initial values of the form as properties, where each propertyName is the name of aform item
in the form, and each property value is the value held by that form item.Return an AdvancedCriteria object based on the current set of values within this form.getValuesAsAdvancedCriteria
(TextMatchStyle textMatchStyle) Return an AdvancedCriteria object based on the current set of values within this form.Return search criteria based on the current set of values within this form.Return the current set of values within this form as a Record.Return the ValuesManager for this form.Should items within this form that are showing aFormItem.hint
have the hint text wrap? May be overridden at the item level viaFormItem.wrapHintText
.Whether titles for form items should wrap.Returns whether there are currently any errors visible to the user for this form, without performing validation.hasFieldErrors
(String fieldName) Returns whether there are currently any errors visible to the user for the specified field in this form, without performing any validation.void
Hide a form item viaFormItem.hide()
void
Invalidate the current data cache for this databound component via a call to the dataset'sinvalidateCache()
method, for example,ResultSet.invalidateCache()
.Returns true if this DynamicForm has the keyboard focus.Returns true ifsaveOperationType
is currently "add".Is this component waiting for an asynchronous validation to complete? This method will return true aftervalidate()
is called on a component with server-side validators for some field(s), until the server responds.protected void
onInit()
protected void
Make a snapshot of the current set of values, so we can reset to them later.void
reset()
Resets values to the state it was the last timesetValues()
orrememberValues()
was called.void
Same asreset()
.void
saveData()
Validate and then save the form's current values to theDataSource
this form is bound to.void
saveData
(DSCallback callback) void
saveData
(DSCallback callback, DSRequest requestProperties) Validate and then save the form's current values to theDataSource
this form is bound to.void
Select all records

void
selectRecord
(int record) Select/deselect aRecord
passed in explicitly, or by index.void
selectRecord
(int record, boolean newState) Select/deselect aRecord
passed in explicitly, or by index.void
selectRecord
(Record record) Select/deselect aRecord
passed in explicitly, or by index.void
selectRecord
(Record record, boolean newState) Select/deselect aRecord
passed in explicitly, or by index.void
selectRecords
(int[] records) Select/deselect a list ofRecord
s passed in explicitly, or by index.void
selectRecords
(int[] records, boolean newState) Select/deselect a list ofRecord
s passed in explicitly, or by index.void
selectRecords
(Record[] records) Select/deselect a list ofRecord
s passed in explicitly, or by index.void
selectRecords
(Record[] records, boolean newState) Select/deselect a list ofRecord
s passed in explicitly, or by index.The URL to which the form will submit its values.setAddDropValues
(Boolean addDropValues) Indicates whether to add "drop values" to items dropped on this component, if both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key.setAddFormulaFieldText
(String addFormulaFieldText) Text for a menu item allowing users to add a formula fieldsetAddOperation
(String addOperation) operationId
this component should use when performing add operations.setAddSummaryFieldText
(String addSummaryFieldText) Text for a menu item allowing users to add a formula fieldsetAllowExpressions
(Boolean allowExpressions) For a form that produces filter criteria (seeform.getValuesAsCriteria()
), allows the user to enter simple expressions in any field in this form that takes text input.setAutoComplete
(AutoComplete autoComplete) Should this form allow browser auto-completion of its items' values? Applies only to items based on native HTML form elements (TextItem
,PasswordItem
, etc), and will only have a user-visible impact for browsers where native autoComplete behavior is actually supported and enabled via user settings.setAutoFetchAsFilter
(Boolean autoFetchAsFilter) IfDataBoundComponent.setAutoFetchData(Boolean)
is true, this attribute determines whether the initial fetch operation should be performed viaDataBoundComponent.fetchData()
orDataBoundComponent.filterData()
setAutoFetchData
(Boolean autoFetchData) If true, when this component is first drawn, automatically callDataBoundComponent.fetchData()
orDataBoundComponent.filterData()
depending onDataBoundComponent.getAutoFetchAsFilter()
.setAutoFetchTextMatchStyle
(TextMatchStyle autoFetchTextMatchStyle) IfautoFetchData
istrue
, this attribute allows the developer to specify a textMatchStyle for the initialDataBoundComponent.fetchData()
call.setAutoFocus
(Boolean autoFocus) If true, when the form is drawn, focus will automatically be put into the first focusable element in the form.
Note that to put focus in a different item you can explicitly calldynamicForm.focusInItem(itemName)
setAutoFocusOnError
(Boolean autoFocusOnError) If true, whenvalidation
fails focus will automatically be put into the first focusable field which failed validation.setBrowserSpellCheck
(Boolean browserSpellCheck) If this browser has a 'spellCheck' feature for text-based form item elements, should it be used for items in this form? Can be overridden at the item level viaFormItem.browserSpellCheck
setCanAddFormulaFields
(Boolean canAddFormulaFields) Adds an item to the header context menu allowing users to launch a dialog to define a new
 field based on values present in other fields, using the {@link com.smartgwt.client..FormulaBuilder}.
setCanAddSummaryFields
(Boolean canAddSummaryFields) Adds an item to the header context menu allowing users to launch a dialog to define a new
 text field that can contain both user-defined text and the formatted values present in other 
 fields, using the {@link com.smartgwt.client..SummaryBuilder}.
setCanEdit
(Boolean canEdit) If set tofalse
, the form will be marked read-only.setCanEditFieldAttribute
(String canEditFieldAttribute) If this component is bound to a dataSource, this attribute may be specified to customize what fields from the dataSource may be edited by default.setCanFocus
(Boolean canFocus) DynamicForms are considered to have focus if any of their form items have focus.setCanSubmit
(Boolean canSubmit) Governs whether this form will be used to perform a standard HTML form submission.setCanTabToIcons
(Boolean canTabToIcons) Should users be able to tab into theicons
andpicker icon
for items within this form by default?setCanTabToSectionHeaders
(Boolean canTabToSectionHeaders) If true, the headers for anySectionItems
will be included in the page's tab order for accessibility.setCellBorder
(int cellBorder) Width of border for the table that form is drawn in.setCellPadding
(int cellPadding) The amount of empty space, in pixels, surrounding each form item within its cell in the layout grid.void
setCellSpacing
(int cellSpacing) Deprecated.usesetCellPadding(int)
insteadsetCheckFileAccessOnSubmit
(boolean checkFileAccessOnSubmit) For dynamicForms containing aFileItem
for uploading files, should the browser verify that the file is accessible before submitting the uploaded file to the server?setClipItemTitles
(boolean clipItemTitles) Should the titles for form items be clipped if they are too large for the available space?setClipStaticValue
(Boolean clipStaticValue) DefaultFormItem.clipStaticValue
setting for items in this form.void
setColWidths
(Object... colWidths) An array of widths for the columns of items in this form's layout grid.setDataArity
(String dataArity) A DynamicForm is adataArity
:single component.setDataFetchMode
(FetchMode dataFetchMode) How to fetch and manage records retrieve from the server.setDataPageSize
(int dataPageSize) When usingdata paging
, how many records to fetch at a time.setDataSource
(DataSource dataSource) The DataSource that this component should bind to for default fields and for performingDataSource requests
.void
setDataSource
(DataSource dataSource, FormItem... fields) Bind to a DataSource.setDataSource
(String dataSource) The DataSource that this component should bind to for default fields and for performingDataSource requests
.setDateFormatter
(DateDisplayFormat dateFormatter) DefaultDateDisplayFormat
for Date type values displayed in this form.setDatetimeFormatter
(DateDisplayFormat datetimeFormatter) DefaultDateDisplayFormat
for Date type values displayed in this form in fields of typedatetime
.setDeepCloneOnEdit
(Boolean deepCloneOnEdit) Before we start editing values in this DataBoundComponent, should we perform a deep clone of the underlying values.static void
setDefaultProperties
(DynamicForm dynamicFormProperties) Class level method to set the default properties of this class.setDefaultSearchOperator
(OperatorId defaultSearchOperator) Defaultsearch operator
to use for fields in a form that producesAdvancedCriteria
.setDisableValidation
(Boolean disableValidation) If set to true, client-side validators will not run on the form when validate() is called.setDragDataAction
(DragDataAction dragDataAction) Indicates what to do with data dragged into another DataBoundComponent.setDragDataCustomizer
(DragDataCustomizer customizer) During a drag-and-drop interaction, this method returns the set of records being dragged out of the component.setDragTrackerStyle
(String dragTrackerStyle) CSS Style to apply to the drag tracker when dragging occurs on this component.setDropValues
(Map dropValues) When an item is dropped on this component, andaddDropValues
is true and both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key, this object provides the "drop values" that Smart GWT will apply to the dropped object before updating it.setDuplicateDragMessage
(String duplicateDragMessage) Message to show when a user attempts to transfer duplicate records into this component, and
preventDuplicates
is enabled.setEditFormulaFieldText
(String editFormulaFieldText) Text for a menu item allowing users to edit a formula fieldsetEditProxyConstructor
(String editProxyConstructor) Default class used to construct theEditProxy
for this component when the component isfirst placed into edit mode
.setEditSummaryFieldText
(String editSummaryFieldText) Text for a menu item allowing users to edit the formatter for a fieldsetEncoding
(Encoding encoding) encoding for the form, use MULTIPART_ENCODING for file upload formssetErrorItemCellStyle
(String errorItemCellStyle) IfshowInlineErrors
is false we show all errors for the form item in a single item rendered at the top of the form.
This attribute specifies the cellStyle to apply to this item.void
setErrorOrientation
(FormErrorOrientation errorOrientation) If DynamicForm.showInlineErrors is true, where should the error icon and text appear relative to form items? Valid options are "top", "bottom", "left" or "right".void
Setter for validation errors on this form.setErrorsPreamble
(String errorsPreamble) IfshowInlineErrors
isfalse
, all errors for the items in the form are rendered as a single item at the top of the form.setExportAll
(Boolean exportAll) Setting exportAll to true prevents the component from passing its list of fields to the 
 export call.setExportFields
(String[] exportFields) The list of field-names to export.setExportIncludeSummaries
(Boolean exportIncludeSummaries) If Summary rows exist for this component, whether to include them when exporting client data.setFetchOperation
(String fetchOperation) Operation ID this component should use when performing fetch operations.setFetchRequestProperties
(DSRequest fetchRequestProperties) IfautoFetchData
istrue
, this attribute allows the developer to declaratively specifyDSRequest
properties for the initialfetchData()
call.void
setFieldErrors
(String fieldName, String[] errors, boolean showErrors) Set field validation errors for some field.void
setFieldErrors
(String fieldName, String error, boolean showErrors) Set field validation error for some field.setFields
(JavaScriptObject... fields) Field setter variant (alternative tosetFields(FormItem...)
,setFields(ListGridField...)
, etc.) that will accept an array of JavaScriptObject, rather than an array of SmartGWT Java wrappers of the field class type (e.g.void
An array of field objects, specifying the order, layout, and types of each field in the DynamicForm.setFileAccessFailedWarning
(String fileAccessFailedWarning) Warning to display to the user if a selected file in an UploadItem cannot be accessed.setFixedColWidths
(Boolean fixedColWidths) If true, we ensure that column widths are at least as large as you specify them.setFormSubmitFailedWarning
(String formSubmitFailedWarning) Deprecated.setHiliteProperty
(String hiliteProperty) Marker that can be set on a record to flag that record as hilited.setHiliteRequiredFields
(Boolean hiliteRequiredFields) Indicates whether the titles of required items in this form should use the special prefix and suffix specified by therequiredTitlePrefix
andrequiredTitleSuffix
attributes, instead of the standard prefix and suffix.setHilites
(Hilite[] hilites) Accepts an array of hilite objects and applies them to this DataBoundComponent.setHiliteState
(String hiliteState) Set the current hilites based on a hiliteState String previously returned from getHilitesState.setImplicitCriteria
(Criteria implicitCriteria) Criteria that are never shown to or edited by the user and are cumulative with any criteria provided viaDataBoundComponent.initialCriteria
,DataBoundComponent.setCriteria()
etc.setImplicitCriteria
(Criteria implicitCriteria, DSCallback callback) setImplicitCriteria
(Criteria criteria, DSCallback callback, Boolean initialFetch) setImplicitSave
(Boolean implicitSave) When true, indicates that changes to items in this form will be automatically saved on adelay
, as well as when the entire form is submitted.setImplicitSaveDelay
(int implicitSaveDelay) WhenimplicitSave
is true, this attribute dictates the millisecond delay after which form items are automatically saved during editing.setImplicitSaveOnBlur
(Boolean implicitSaveOnBlur) If true, form item values will be automatically saved when each item's "editorExit" handler is fired as well as on a delay and when the entire form is submitted.setInitialCriteria
(Criteria initialCriteria) Criteria to use whenDataBoundComponent.setAutoFetchData(Boolean)
is used.setInitialSort
(SortSpecifier... initialSort) An array ofSortSpecifier
objects used to set up the initial sort configuration for this form.setItemHoverAlign
(Alignment itemHoverAlign) Text alignment for hovers shown for itemssetItemHoverDelay
(int itemHoverDelay) If the user rolls over an item, how long a delay before we fire any hover action / show a hover for that item?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.setItemHoverHeight
(Integer itemHoverHeight) A default height for hovers shown for itemssetItemHoverHeight
(String itemHoverHeight) A default height for hovers shown for itemssetItemHoverOpacity
(Integer itemHoverOpacity) Opacity for hovers shown for itemssetItemHoverStyle
(String itemHoverStyle) CSS Style for hovers shown for itemssetItemHoverVAlign
(Integer itemHoverVAlign) Vertical text alignment for hovers shown for itemssetItemHoverVAlign
(String itemHoverVAlign) Vertical text alignment for hovers shown for itemssetItemHoverWidth
(Integer itemHoverWidth) A default width for hovers shown for itemssetItemHoverWidth
(String itemHoverWidth) A default width for hovers shown for itemssetItemLayout
(FormLayoutType itemLayout) Layout style to use with this form.void
void
setItemTitleHoverFormatter
(FormItemHoverFormatter hoverFormatter) TheFormItemHoverFormatter
should return the HTML to display in a hover canvas when the user holds the mousepointer over an item's title and the title is clipped.void
setItemValueHoverFormatter
(FormItemHoverFormatter hoverFormatter) TheFormItemHoverFormatter
should return the HTML to display in a hover canvas when the user holds the mousepointer over an item's value and the value is clipped.setLinearAutoSpanItems
(Boolean linearAutoSpanItems) When a form is rendered inlinearMode
, should each item appear on its own row, spanning the full set of rendered columns by default?setLinearHintWidth
(int linearHintWidth) WhenlinearMode
is true, this property sets the amount of space reserved forhint-text
in formItems that set a hint.setLinearHintWidth
(String linearHintWidth) WhenlinearMode
is true, this property sets the amount of space reserved forhint-text
in formItems that set a hint.setLinearMode
(Boolean linearMode) Switches the entire form to render in a style that is typical for form on a mobile device with oneFormItem
per row.setLinearNumCols
(Integer linearNumCols) Specifies thenumber of columns
when the form is being rendered inlinearMode
, overriding any automatically derived value in that mode.setLinearOnMobile
(boolean linearOnMobile) Switches the entire form to render in a style that is typical for form on ahandset device
with oneFormItem
per row by automatically defaultinglinearMode
totrue
on handsets.Setter implementing theLogicalStructure
interface, which supports Eclipse's logical structure debugging facility.setLongTextEditorThreshold
(int longTextEditorThreshold) When creating form items for fields with text type data, if the specified length of the field exceeds this threshold we will create form item of typethis.longTextEditorType
(a TextAreaItem by default), rather than a simple text item.setLongTextEditorType
(String longTextEditorType) Name of the Form Item class to use for text fields which exceed the longTextEditorThreshold for this form.setMethod
(FormMethod method) The mechanism by which form data is sent to the action URL.setMinColWidth
(int minColWidth) Minimum width of a form column.setMinHintWidth
(Integer minHintWidth) Minimum horizontal space made available forFormItem.hint
text.setNoErrorDetailsMessage
(String noErrorDetailsMessage) A message to display to the user if server-side validation fails with an error but the server did not provide an error messagesetNumCols
(int numCols) The number of columns of titles and items in this form's layout grid.setOperator
(OperatorId operator) WhenFormItem.operator
has been set for anyFormItem
in this form, what logical operator should be applied across thecriteria
produced by the form items? Only applicable to forms that have adataSource
.setOriginalValueMessage
(String originalValueMessage) Default template HTML string when an item does not set its ownFormItem.originalValueMessage
.setPreventDuplicates
(Boolean preventDuplicates) If set, detect and prevent duplicate records from being transferred to this component, either via
 drag and drop or viaDataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent)
.setProgressiveLoading
(Boolean progressiveLoading) Indicates whether or not this component will load its dataprogressively
setReadOnlyDisplay
(ReadOnlyDisplayAppearance readOnlyDisplay) IfcanEdit
is set tofalse
, how should the items in this form be displayed to the user?setReadOnlyTextBoxStyle
(String readOnlyTextBoxStyle) DefaultFormItem.readOnlyTextBoxStyle
setting for items in this form.setRejectInvalidValueOnChange
(Boolean rejectInvalidValueOnChange) If validateOnChange is true, and validation fails for an 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.setRemoveOperation
(String removeOperation) operationId
this component should use when performing remove operations.setRequiredMessage
(String requiredMessage) The required message for required field errors.setRequiredRightTitlePrefix
(String requiredRightTitlePrefix) The string pre-pended to the title of every required item in this form ifhiliteRequiredFields
is true and theTitleOrientation
property is set to "right".setRequiredRightTitleSuffix
(String requiredRightTitleSuffix) The string appended to the title of every required item in this form ifhiliteRequiredFields
is true and theTitleOrientation
property is set to "right".setRequiredTitlePrefix
(String requiredTitlePrefix) The string pre-pended to the title of every required item in this form ifhiliteRequiredFields
is true.setRequiredTitleSuffix
(String requiredTitleSuffix) The string appended to the title of every required item in this form ifhiliteRequiredFields
is true.setRevertValueKey
(KeyIdentifier revertValueKey) Keyboard shortcut that causes the value of the currently focused form item to be reverted to whatever value would be shown ifresetValues()
were called.setRightTitlePrefix
(String rightTitlePrefix) The string pre-pended to the title of an item in this form if its titleOrientation property is set to "right".setRightTitleSuffix
(String rightTitleSuffix) The string appended to the title of an item in this form if its titleOrientation property is set to "right".setSavedSearchId
(String savedSearchId) Optional identifier for saved searches that should be applied to this component.setSaveOnEnter
(Boolean saveOnEnter) Iftrue
, when the user hits the Enter key while focused in a text-item in this form, we automatically submit the form to the server using thesubmit()
method.setSaveOperationType
(DSOperationType saveOperationType) DefaultDSOperationType
to be performed whensaveData()
is called.setSectionVisibilityMode
(VisibilityMode sectionVisibilityMode) If the form has sections, [implemented asSectionItem
s], this attribute controls whether multiple sections can be expanded at once.setSelectOnClick
(Boolean selectOnClick) If this property is set to true, whenever a text-based field in this form (TextItem
,TextAreaItem
) is given focus - whether programmatically (seefocusInItem()
), or via a mouse click, all text within the item will be selected.setSelectOnFocus
(Boolean selectOnFocus) If this property is set to true, whenever a text-based field in this form (TextItem
,TextAreaItem
) is given focus programmatically (seefocusInItem()
), all text within the item will be selected.setShowComplexFields
(Boolean showComplexFields) Whether to show fields of non-atomic types when a DataBoundComponent is given a
 DataSource but nocomponent.fields
.
setShowComplexFieldsRecursively
(Boolean showComplexFieldsRecursively) If set, thisDynamicForm
will set bothshowComplexFields
andshowComplexFieldsRecursively
on any nested component used for showing/editing a complex field.setShowDeletions
(Boolean showDeletions) DefaultFormItem.showDeletions
setting for items in this form.setShowDetailFields
(Boolean showDetailFields) For databound forms, whether to show fields marked as detail fields.setShowErrorIcons
(Boolean showErrorIcons) showErrorIcons
,showErrorText
,errorOrientation
, andshowErrorStyle
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).setShowErrorStyle
(Boolean showErrorStyle) showErrorIcons
,showErrorText
,errorOrientation
, andshowErrorStyle
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).setShowErrorText
(Boolean showErrorText) showErrorIcons
,showErrorText
,errorOrientation
, andshowErrorStyle
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).setShowHiddenFields
(Boolean showHiddenFields) Whether to show fields markedhidden:true
when a DataBoundComponent is given a
 DataSource but nocomponent.fields
.
setShowImageAsURL
(boolean showImageAsURL) For fields oftype:"image"
, if the field is non editable, and being displayed withreadOnlyDisplay:"static"
, should the value (URL) be displayed as text, or should an image be rendered?setShowInlineErrors
(Boolean showInlineErrors) If true, field errors are written into the form next to the item(s) where the errors occurred.setShowOldValueInHover
(Boolean showOldValueInHover) Default setting for the form items'FormItem.showOldValueInHover
setting.setShowPending
(Boolean showPending) This property applies to all of the items that a form has, and works according toFormItem.showPending
.setShowSavedSearchesByDS
(boolean showSavedSearchesByDS) Whether to associate saved searches by default with the currentDataSource
of a component when asavedSearchId
is not provided.setShowTitlesWithErrorMessages
(Boolean showTitlesWithErrorMessages) Indicates whether on validation failure, the error message displayed to the user should be pre-pended with the title for the item.static void
setSkipConversionOnMapping
(Boolean convert) Call this method passing true to skip conversion of the Javascript object to a Java Map when calling the mapDisplayToValue() API.setSort
(SortSpecifier... sortSpecifiers) Sort the component on one or more fields.setSparseFieldState
(Boolean sparseFieldState) If true,ListGrid.getFieldState()
andListGrid.setFieldState(java.lang.String)
will omit state information for hidden fields by default.setStopOnError
(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.setStoreDisplayValues
(Boolean storeDisplayValues) For editable fields with a specifiedFormItem.displayField
andFormItem.optionDataSource
, if the user selects a new value (typically from PickList based item such as a SelectItem), should the selected displayValue be updated on the record being edited in addition to the value for the actual item.
Note that this only applies for fields usinglocal display field values
- typicallyforeignKey fields
where the display field isincluded from
another dataSource.setSuppressBrowserClearIcons
(boolean suppressBrowserClearIcons) DefaultTextItem.suppressBrowserClearIcon
value for TextItems within this form.setSuppressValidationErrorCallback
(Boolean suppressValidationErrorCallback) When callingsaveData()
on a form or valuesManager, by default if the server returns an error code, any callback passed into saveData() will not be fired.setSynchronousValidation
(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.The name of a window or frame that will receive the results returned by the form's action.setTimeFormatter
(TimeDisplayFormat timeFormatter) DefaultTimeDisplayFormat
fortype:"time"
field values displayed in this form.setTitleAlign
(Alignment titleAlign) Default alignment for item titles.setTitleField
(String titleField) Sets the best field to use for a user-visible title for an individual record from this component.setTitleOrientation
(TitleOrientation titleOrientation) Default orientation for titles for items in this form.setTitlePrefix
(String titlePrefix) The string pre-pended to the title of every item in this form.setTitleSuffix
(String titleSuffix) The string appended to the title of every item in this form.void
setTitleWidth
(int titleWidth) The width in pixels allocated to the title of every item in this form.void
setTitleWidth
(String titleWidth) The width in pixels allocated to the title of every item in this form.setUnknownErrorMessage
(String unknownErrorMessage) The error message for a failed validator that does not specify its own errorMessage.setUpdateOperation
(String updateOperation) operationId
this component should use when performing update operations.void
setUseAllDataSourceFields
(boolean useAllDataSourceFields) If true, the set of fields given by the "default binding" (see DataBoundComponent.fields) is used, with any fields specified in component.fields acting as overrides that can suppress or modify the display of individual fields, without having to list the entire set of fields that should be shown.setUseAllDataSourceFields
(Boolean useAllDataSourceFields) If true, the set of fields given by the "default binding" (see 
fields
) is used, with any fields specified in
component.fields
acting as overrides that can suppress or modify the
 display of individual fields, without having to list the entire set of fields that
 should be shown.
setUseFlatFields
(Boolean useFlatFields) TheuseFlatFields
flag causes all simple type fields anywhere in a nested
 set of DataSources to be exposed as a flat list for form binding.setUserTask
(UserTask userTask) Associated userTask if current dynamic form used along with workflow.setValidateOnChange
(Boolean validateOnChange) If true, form fields will be validated when each item's "change" handler is fired as well as when the entire form is submitted or validated.setValidateOnExit
(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.setValidationURL
(String validationURL) validationURL can be set to do server-side validation against a different URL from where the form will ultimately save, as part of an incremental upgrade strategy for Struts-like applications.void
Set the value for some field.void
Set the value for some field.void
Set the value for some field.void
setValue
(String fieldName, JavaScriptObject value) Set the value for some field.void
Set the value for some field.void
Set the value for some field.void
Set the value for some field.void
Set the value for some field.void
setValue
(String fieldName, RelativeDate value) Set the value for some field.void
Sets the value for some fieldvoid
Set the value for some field.void
Set the value for some field.void
Set the value for some field.An Object containing the initial values of the form as properties, where each propertyName is the name of aform item
in the form, and each property value is the value held by that form item.void
setValuesAsCriteria
(Criterion criteria) This method will display the specified criteria in this form for editing.setValuesManager
(ValuesManager valuesManager) Adds this DynamicForm as a member of the specified valuesManager.setWrapHintText
(Boolean wrapHintText) Should items within this form that are showing aFormItem.hint
have the hint text wrap? May be overridden at the item level viaFormItem.wrapHintText
.setWrapItemTitles
(Boolean wrapItemTitles) Whether titles for form items should wrap.void
If this form has any outstanding validation errors, show them now.

 This method is called when the set of errors are changed bysetErrors(java.util.Map, boolean)
or
validate()
.void
showFieldErrors
(String fieldName) If this form has any outstanding validation errors for the field passed in, show them now.void
Show a form item viaFormItem.show()
boolean
showItemContextMenu
(FormItem item) Called when the mouse is right-clicked in some formItem.FormItem[]
Helper method to take our specified items and sort them into their desired tab sequencevoid
submit()
submit()
is automatically called when aSubmitItem
included in the form is clicked, or, ifsaveOnEnter
is set, when the "Enter" key is pressed in a text input.void
submit
(DSCallback callback) void
submit
(DSCallback callback, DSRequest requestProperties) submit()
is automatically called when aSubmitItem
included in the form is clicked, or, ifsaveOnEnter
is set, when the "Enter" key is pressed in a text input.void
boolean
titleClipped
(FormItem item) Is the title for the given form item clipped? The form item must have title clipping enabled.void
transferRecords
(Record[] records, Record targetRecord, Integer index, Canvas sourceWidget, TransferRecordsCallback callback) Transfer a list ofRecord
s from another component (does not have to be a databound component) into this component.void
Simulates a drag / drop type transfer of the selected records in some other component to this component, without requiring any user interaction.void
transferSelectedData
(DataBoundComponent source, int index) Simulates a drag / drop type transfer of the selected records in some other component to this component, without requiring any user interaction.boolean
validate()
Validates the form without submitting it, and redraws the form to display error messages if there are any validation errors.boolean
validate
(boolean validateHiddenFields) Validates the form without submitting it, and redraws the form to display error messages if there are any validation errors.boolean
validateData
(DSCallback callback) boolean
validateData
(DSCallback callback, DSRequest requestProperties) validateData()
can be used to check for errors in server-side validators without showing such errors to the user.boolean
valuesAreValid
(boolean validateHiddenFields) Method to determine whether the current form values would pass validation.Compares the current set of values with the values stored by the call to therememberValues()
method.void
viewSelectedData
(ListGrid selectionComponent) Displays the currently selected record(s) of the selectionComponent widget (typically a listGrid) in this component.void
viewSelectedData
(TileGrid selectionComponent) Displays the currently selected record(s) of the selectionComponent widget (typically a listGrid) in this component.void
viewSelectedData
(String selectionComponent) Displays the currently selected record(s) of the selectionComponent widget (typically a listGrid) in this component.Methods inherited from class com.smartgwt.client.widgets.Canvas
addChild, addChild, addChild, addChild, addChild, addClearHandler, addClickHandler, addDoubleClickHandler, addDragMoveHandler, addDragRepositionMoveHandler, addDragRepositionStartHandler, addDragRepositionStopHandler, addDragResizeMoveHandler, addDragResizeStartHandler, addDragResizeStopHandler, addDragStartHandler, addDragStopHandler, addDropHandler, addDropMoveHandler, addDropOutHandler, addDropOverHandler, addFocusChangedHandler, addHoverHandler, addHoverHiddenHandler, addKeyDownHandler, addKeyPressHandler, addMouseDownHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseStillDownHandler, addMouseUpHandler, addMouseWheelHandler, addMovedHandler, addParentMovedHandler, addPeer, addPeer, addPeer, addPeer, addResizedHandler, addRightMouseDownHandler, addRuleContextChangedHandler, addScrolledHandler, addShowContextMenuHandler, addSnapAlignCandidate, addStyleName, addVisibilityChangedHandler, adjustForContent, animateFade, animateFade, animateFade, animateFade, animateFade, animateFade, animateFade, animateFade, animateHide, animateHide, animateHide, animateHide, animateHide, animateHide, animateHide, animateMove, animateMove, animateMove, animateMove, animateRect, animateRect, animateRect, animateRect, animateResize, animateResize, animateResize, animateResize, animateScroll, animateScroll, animateScroll, animateScroll, animateScroll, animateScroll, animateShow, animateShow, animateShow, animateShow, animateShow, animateShow, animateShow, asSGWTComponent, blur, bringToFront, clear, clearExplicitTabIndex, clickMaskUp, clickMaskUp, contains, contains, containsEvent, containsEventTarget, containsFocus, containsPoint, containsPoint, dataContextChanged, deparent, depeer, disable, enable, encloses, focusAfterGroup, focusAtEnd, focusInNextTabElement, focusInPreviousTabElement, getAbsoluteLeft, getAbsoluteTop, getAccessKey, getAdaptiveHeightPriority, getAdaptiveWidthPriority, getAlwaysManageFocusNavigation, getAlwaysShowScrollbars, getAnimateAcceleration, getAnimateFadeTime, getAnimateHideAcceleration, getAnimateHideEffect, getAnimateHideTime, getAnimateMoveAcceleration, getAnimateMoveTime, getAnimateRectAcceleration, getAnimateRectTime, getAnimateResizeAcceleration, getAnimateResizeLayoutMode, getAnimateResizeTime, getAnimateScrollAcceleration, getAnimateScrollTime, getAnimateShowAcceleration, getAnimateShowEffect, getAnimateShowTime, getAnimateTime, getAppImgDir, getAriaHandleID, getAriaRole, getAriaStateDefaults, getAutoMaskComponents, getAutoParent, getAutoPopulateData, getAutoShowParent, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorder, getBorderRadius, getBottom, getById, getByJSObject, getByLocalId, getCanAcceptDrop, getCanAdaptHeight, getCanAdaptWidth, getCanDrag, getCanDragReposition, getCanDragResize, getCanDragScroll, getCanDrop, getCanDropBefore, getCanHover, getCanSelectText, getCanvasAutoChild, getCanvasItem, getChildren, getChildrenResizeSnapAlign, getChildrenSnapAlign, getChildrenSnapCenterAlign, getChildrenSnapEdgeAlign, getChildrenSnapResizeToGrid, getChildrenSnapToGrid, getChildTabPosition, getClassName, getComponentMask, getComponentMaskDefaults, getContentElement, getContents, getContextMenu, getCorrectZoomOverflow, getCursor, getDataContext, getDataPath, getDefaultHeight, getDefaultWidth, getDefiningProperty, getDefiningPropertyName, getDefiningPropertyNameOptions, getDestroyed, getDestroying, getDisabled, getDisabledCursor, getDisableTouchScrollingForDrag, getDoubleClickDelay, getDragAppearance, getDragIntersectStyle, getDragMaskType, getDragMaxHeight, getDragMaxWidth, getDragMinHeight, getDragMinWidth, getDragOpacity, getDragRepositionAppearance, getDragRepositionCursor, getDragResizeAppearance, getDragScrollDelay, getDragStartDistance, getDragTarget, getDragTargetAsString, getDragType, getDropTarget, getDropTargetAsString, getDropTypes, getDropTypesAsString, getDynamicContents, getEdgeBackgroundColor, getEdgeCenterBackgroundColor, getEdgeImage, getEdgeMarginSize, getEdgeOffset, getEdgeOpacity, getEdgeShowCenter, getEdgeSize, getEditNode, getEditProxy, getElement, getElement, getEnableWhen, getEndLine, getEventEdge, getEventEdge, getExtraSpace, getFacetId, getFloatingScrollbars, getFormItemAutoChild, getForwardSVGeventsToObject, getFullDataPath, getGroupBorderCSS, getGroupLabelBackgroundColor, getGroupLabelStyleName, getGroupPadding, getGroupTitle, getHeight, getHeightAsString, getHideUsingDisplayNone, getHoverAlign, getHoverAutoDestroy, getHoverAutoFitMaxWidth, getHoverAutoFitMaxWidthAsString, getHoverAutoFitWidth, getHoverComponent, getHoverDelay, getHoverFocusKey, getHoverHeight, getHoverHTML, getHoverMoveWithMouse, getHoverOpacity, getHoverPersist, getHoverScreen, getHoverStyle, getHoverVAlign, getHoverWidth, getHoverWrap, getHSnapPosition, getHSnapPosition, getHtmlElement, getHtmlElementAsString, getHtmlPosition, getImage, getImgURL, getImgURL, getInnerContentHeight, getInnerContentWidth, getInnerHeight, getInnerWidth, getIsGroup, getIsPrinting, getIsRuleScope, getIsSnapAlignCandidate, getKeepInParentRect, getLayoutAlign, getLeaveGroupLabelSpace, getLeavePageSpace, getLeft, getLeftAsString, getLocalId, getLocateByIDOnly, getLocateChildrenBy, getLocateChildrenType, getLocatePeersBy, getLocatePeersType, getLocatorName, getMargin, getMasterCanvas, getMasterElement, getMatchElement, getMatchElementHeight, getMatchElementWidth, getMaxHeight, getMaxWidth, getMaxZoomOverflowError, getMenuConstructor, getMinHeight, getMinNonEdgeSize, getMinWidth, getMomentumScrollMinSpeed, getMouseStillDownDelay, getMouseStillDownInitialDelay, getName, getNativeAutoHideScrollbars, getNextZIndex, getNoDoubleClicks, getNoDropCursor, getOffsetHeight, getOffsetWidth, getOffsetX, getOffsetY, getOpacity, getOuterElement, getOverflow, getPadding, getPageBottom, getPageLeft, getPageRect, getPageRight, getPageTop, getPaletteDefaults, getPanelContainer, getParentCanvas, getParentElement, getPeers, getPendingMarkerStyle, getPendingMarkerVisible, getPercentBox, getPercentSource, getPersistentMatchElement, getPointerSettings, getPointerTarget, getPointerTargetAsString, getPosition, getPrefix, getPrintChildrenAbsolutelyPositioned, getPrintHTML, getPrintHTML, getPrintStyleName, getPrompt, getProportionalResizeModifiers, getProportionalResizing, getReceiveScrollbarEvents, getRect, getRedrawOnResize, getResizeBarTarget, getResizeFrom, getRight, getRuleContext, getRuleContext, getRuleScope, getScrollbarSize, getScrollBottom, getScrollHeight, getScrollLeft, getScrollRight, getScrollTop, getScrollWidth, getShadowColor, getShadowDepth, getShadowHOffset, getShadowImage, getShadowOffset, getShadowSoftness, getShadowSpread, getShadowVOffset, getShouldPrint, getShowCustomScrollbars, getShowDragShadow, getShowEdges, getShowHover, getShowHoverComponents, getShowPointer, getShowResizeBar, getShowShadow, getShowSnapGrid, getShrinkElementOnHide, getSizeMayChangeOnRedraw, getSkinImgDir, getSnapAlignCandidates, getSnapAlignCenterLineStyle, getSnapAlignEdgeLineStyle, getSnapAxis, getSnapEdge, getSnapGridLineProperties, getSnapGridStyle, getSnapHDirection, getSnapHGap, getSnapOffsetLeft, getSnapOffsetTop, getSnapOnDrop, getSnapPosition, getSnapPosition, getSnapResizeToAlign, getSnapResizeToGrid, getSnapTo, getSnapToAlign, getSnapToCenterAlign, getSnapToEdgeAlign, getSnapToGrid, getSnapVDirection, getSnapVGap, getStartLine, getStyleName, getTabIndex, getTestDataContext, getTestInstance, getTitle, getTooltip, getTop, getTopAsString, getTopElement, getUISummary, getUpdateTabPositionOnDraw, getUpdateTabPositionOnReparent, getUseBackMask, getUseCSSShadow, getUseDragMask, getUseImageForSVG, getUseNativeDrag, getUseOpacityFilter, getUseTouchScrolling, getValuesManagerAsString, getViewportHeight, getViewportWidth, getVisibility, getVisibleHeight, getVisibleWhen, getVisibleWidth, getVSnapPosition, getVSnapPosition, getWidth, getWidthAsString, getWorkflows, getZIndex, getZIndex, handleHover, hide, hideClickMask, hideClickMask, hideComponentMask, hideComponentMask, hideContextMenu, imgHTML, imgHTML, imgHTML, initComplete, intersects, isDirty, isDisabled, isVisible, keyUp, layoutChildren, linkHTML, linkHTML, linkHTML, linkHTML, linkHTML, linkHTML, markForDestroy, markForRedraw, markForRedraw, moveAbove, moveBelow, moveBy, moveTo, onAttach, onDetach, pageScrollDown, pageScrollUp, parentResized, placeNear, placeNear, placeNear, print, print, print, print, printComponents, provideRuleContext, provideRuleContext, redraw, redraw, registerFontScaledPaddingStyles, removeChild, removeChild, removePeer, removePeer, removeRuleContext, removeSnapAlignCandidate, resizeAutoChildAttributes, resizeBy, resizeControls, resizeControlsTo, resizeFonts, resizeFonts, resizeFonts, resizeFontsTo, resizeIcons, resizePadding, resizePadding, resizeTo, resizeTo, revealChild, revealChild, scrollBy, scrollByPercent, scrollTo, scrollTo, scrollTo, scrollToBottom, scrollToLeft, scrollToPercent, scrollToRight, scrollToTop, sendToBack, setAccessKey, setAdaptHeightByCustomizer, setAdaptiveHeightPriority, setAdaptiveWidthPriority, setAdaptWidthByCustomizer, setAlign, setAllowExternalFilters, setAlwaysManageFocusNavigation, setAlwaysShowScrollbars, setAnimateAcceleration, setAnimateFadeTime, setAnimateHideAcceleration, setAnimateHideEffect, setAnimateHideTime, setAnimateMoveAcceleration, setAnimateMoveTime, setAnimateRectAcceleration, setAnimateRectTime, setAnimateResizeAcceleration, setAnimateResizeLayoutMode, setAnimateResizeTime, setAnimateScrollAcceleration, setAnimateScrollTime, setAnimateShowAcceleration, setAnimateShowEffect, setAnimateShowTime, setAnimateTime, setAppImgDir, setAriaRole, setAriaState, setAutoChildConstructor, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildVisibility, setAutoHeight, setAutoMaskComponents, setAutoParent, setAutoPopulateData, setAutoResizeAutoChildAttributes, setAutoResizeIcons, setAutoShowParent, setAutoWidth, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBorderRadius, setBottom, setCanAcceptDrop, setCanAdaptHeight, setCanAdaptWidth, setCanDrag, setCanDragReposition, setCanDragResize, setCanDragScroll, setCanDrop, setCanDropBefore, setCanHover, setCanSelectText, setChildren, setChildrenResizeSnapAlign, setChildrenSnapAlign, setChildrenSnapCenterAlign, setChildrenSnapEdgeAlign, setChildrenSnapResizeToGrid, setChildrenSnapToGrid, setComponentMaskDefaults, setContents, setContextMenu, setCorrectZoomOverflow, setCursor, setDataContext, setDataPath, setDefaultHeight, setDefaultPageSpace, setDefaultProperties, setDefaultShowCustomScrollbars, setDefaultWidth, setDefiningProperty, setDefiningPropertyNameOptions, setDisabled, setDisabledCursor, setDisableTouchScrollingForDrag, setDoubleClickDelay, setDragAppearance, setDragIntersectStyle, setDragMaskType, setDragMaxHeight, setDragMaxWidth, setDragMinHeight, setDragMinWidth, setDragOpacity, setDragRepositionAppearance, setDragRepositionCursor, setDragResizeAppearance, setDragScrollDelay, setDragStartDistance, setDragTarget, setDragTarget, setDragType, setDropTarget, setDropTarget, setDropTypes, setDropTypes, setDynamicContents, setEdgeBackgroundColor, setEdgeCenterBackgroundColor, setEdgeImage, setEdgeMarginSize, setEdgeOffset, setEdgeOpacity, setEdgeShowCenter, setEdgeSize, setEditMode, setEditMode, setEditMode, setElement, setEnableWhen, setEndLine, setExtraSpace, setFacetId, setFloatingScrollbars, setForwardSVGeventsToObject, setGroupBorderCSS, setGroupLabelBackgroundColor, setGroupLabelStyleName, setGroupPadding, setGroupTitle, setHeight, setHeight, setHeight, setHeight100, setHideUsingDisplayNone, setHoverAlign, setHoverAutoDestroy, setHoverAutoFitMaxWidth, setHoverAutoFitMaxWidth, setHoverAutoFitWidth, setHoverDelay, setHoverFocusKey, setHoverHeight, setHoverMoveWithMouse, setHoverOpacity, setHoverPersist, setHoverScreen, setHoverStyle, setHoverVAlign, setHoverWidth, setHoverWrap, setHtmlElement, setHtmlElement, setHtmlPosition, setImage, setImage, setInitHandler, setIsGroup, setIsRuleScope, setIsSnapAlignCandidate, setKeepInParentRect, setKeepInParentRect, setKeepInParentRect, setLayoutAlign, setLayoutAlign, setLeaveGroupLabelSpace, setLeavePageSpace, setLeft, setLeft, setLocateByIDOnly, setLocateChildrenBy, setLocateChildrenType, setLocatePeersBy, setLocatePeersType, setLocatorName, setLocatorParent, setLocatorParent, setLogicalStructure, setMargin, setMatchElement, setMatchElementHeight, setMatchElementWidth, setMaxHeight, setMaxWidth, setMaxZoomOverflowError, setMenuConstructor, setMinHeight, setMinNonEdgeSize, setMinWidth, setMomentumScrollMinSpeed, setMouseStillDownDelay, setMouseStillDownInitialDelay, setName, setNativeAutoHideScrollbars, setNeverUseFilters, setNoDoubleClicks, setNoDropCursor, setOpacity, setOverflow, setPadding, setPageLeft, setPageTop, setPanelContainer, setParentCanvas, setParentElement, setPeers, setPendingMarkerStyle, setPendingMarkerVisible, setPercentBox, setPercentSource, setPersistentMatchElement, setPointerSettings, setPointerTarget, setPosition, setPrefix, setPrintChildrenAbsolutelyPositioned, setPrintStyleName, setPrompt, setProportionalResizeModifiers, setProportionalResizing, setReceiveScrollbarEvents, setRect, setRect, setRedrawOnResize, setRelativeTabPosition, setResizeBarTarget, setResizeFrom, setResizeFrom, setRight, setRuleScope, setScrollbarConstructor, setScrollbarSize, setShadowColor, setShadowDepth, setShadowHOffset, setShadowImage, setShadowOffset, setShadowSoftness, setShadowSpread, setShadowVOffset, setShouldPrint, setShowCustomScrollbars, setShowDragShadow, setShowEdges, setShowHover, setShowHoverComponents, setShowPointer, setShowResizeBar, setShowShadow, setShowSnapGrid, setShrinkElementOnHide, setSizeMayChangeOnRedraw, setSkinImgDir, setSmoothFade, setSnapAlignCandidates, setSnapAlignCenterLineStyle, setSnapAlignEdgeLineStyle, setSnapAxis, setSnapEdge, setSnapGridLineProperties, setSnapGridStyle, setSnapHDirection, setSnapHGap, setSnapOffsetLeft, setSnapOffsetTop, setSnapOnDrop, setSnapResizeToAlign, setSnapResizeToGrid, setSnapTo, setSnapToAlign, setSnapToCenterAlign, setSnapToEdgeAlign, setSnapToGrid, setSnapVDirection, setSnapVGap, setStartLine, setStyleName, setTabIndex, setTestDataContext, setTitle, setTooltip, setTop, setTop, setUpdateTabPositionOnDraw, setUpdateTabPositionOnReparent, setUseBackMask, setUseCSSShadow, setUseDragMask, setUseImageForSVG, setUseNativeDrag, setUseOpacityFilter, setUseTouchScrolling, setValuesManager, setVisibility, setVisible, setVisibleWhen, setWidth, setWidth, setWidth, setWidth100, setWorkflows, setZIndex, shouldDragScroll, show, showClickMask, showComponentMask, showComponentMask, showNextTo, showNextTo, showNextTo, showNextTo, showPendingMarker, showPrintPreview, showPrintPreview, showPrintPreview, showPrintPreview, showRecursively, startDebuggingOverflow, stopDebuggingOverflow, updateChildTabPosition, updateChildTabPositions, updateEditNode, updateHover, updateHover, updateShadow, updateTabPositionForDraw, visibleAtPoint, willAcceptDrop
Methods inherited from class com.smartgwt.client.widgets.BaseWidget
addDrawHandler, addDynamicProperty, addDynamicProperty, addDynamicProperty, addDynamicProperty, applyFactoryProperties, clearDynamicProperty, completeCreation, destroy, doAddHandler, doInit, doOnRender, draw, equals, error, errorIfNotCreated, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDateArray, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsFloatArray, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getConfig, getDOM, getHandlerCount, getID, getInnerHTML, getJsObj, getOrCreateJsObj, getRef, getScClassName, hasAutoAssignedID, hasDynamicProperty, hashCode, initNativeObject, internalSetID, internalSetID, isConfigOnly, isCreated, isDrawn, isFactoryCreated, onBind, onDestroy, onDraw, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setDefaultProperties, setDragTracker, setFactoryCreated, setID, setJavaScriptObject, setLogicalStructure, setLogicalStructure, setNullProperty, setPosition, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setScClassName, toString
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.smartgwt.client.widgets.DataBoundComponent
getOrCreateJsObj
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
-
Constructor Details
-
DynamicForm
public DynamicForm() -
DynamicForm
-
-
Method Details
-
getOrCreateRef
-
changeAutoChildDefaults
Changes the defaults for Canvas AutoChildren namedautoChildName
.- Parameters:
autoChildName
- name of an AutoChild to customize the defaults for.defaults
- Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, seeSGWTProperties
.- See Also:
-
changeAutoChildDefaults
Changes the defaults for FormItem AutoChildren namedautoChildName
.- Parameters:
autoChildName
- name of an AutoChild to customize the defaults for.defaults
- FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, seeSGWTProperties
.- See Also:
-
create
-
setAction
The URL to which the form will submit its values.NOTE: this is used only in the very rare case that a form is used to submit data directly to a URL. Normal server contact is through RPCManager.
SeecanSubmit
for more on this.
If this method is called after the component has been drawn/initialized: Sets theaction
for this form.- Parameters:
action
- New action URL. Default value is "#"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getAction
The URL to which the form will submit its values.NOTE: this is used only in the very rare case that a form is used to submit data directly to a URL. Normal server contact is through RPCManager.
SeecanSubmit
for more on this.- Returns:
- Current action value. Default value is "#"
- See Also:
-
setAllowExpressions
For a form that produces filter criteria (seeform.getValuesAsCriteria()
), allows the user to enter simple expressions in any field in this form that takes text input.Also note that enabling
allowExpressions
for an entire form changes thedefaultSearchOperator
to"iContainsPattern"
, so that simple search expressions similar to SQL "LIKE" patterns can be entered in most fields.See
FormItem.allowExpressions
for details.- Parameters:
allowExpressions
- New allowExpressions value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getAllowExpressions
For a form that produces filter criteria (seeform.getValuesAsCriteria()
), allows the user to enter simple expressions in any field in this form that takes text input.Also note that enabling
allowExpressions
for an entire form changes thedefaultSearchOperator
to"iContainsPattern"
, so that simple search expressions similar to SQL "LIKE" patterns can be entered in most fields.See
FormItem.allowExpressions
for details.- Returns:
- Current allowExpressions value. Default value is null
- See Also:
-
setAutoComplete
Should this form allow browser auto-completion of its items' values? Applies only to items based on native HTML form elements (TextItem
,PasswordItem
, etc), and will only have a user-visible impact for browsers where native autoComplete behavior is actually supported and enabled via user settings.This property may be explicitly specified per item via
FormItem.autoComplete
.Note that even with this value set to
"none"
, native browser auto-completion may occur for log in forms (forms containing username andpassword
fields). This behavior varies by browser, and is a result of an intentional change by some browser developers to disregard the HTML setting autocomplete=off for password items or log-in forms.- Parameters:
autoComplete
- New autoComplete value. Default value is "none"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getAutoComplete
Should this form allow browser auto-completion of its items' values? Applies only to items based on native HTML form elements (TextItem
,PasswordItem
, etc), and will only have a user-visible impact for browsers where native autoComplete behavior is actually supported and enabled via user settings.This property may be explicitly specified per item via
FormItem.autoComplete
.Note that even with this value set to
"none"
, native browser auto-completion may occur for log in forms (forms containing username andpassword
fields). This behavior varies by browser, and is a result of an intentional change by some browser developers to disregard the HTML setting autocomplete=off for password items or log-in forms.- Returns:
- Current autoComplete value. Default value is "none"
- See Also:
-
setAutoFocus
If true, when the form is drawn, focus will automatically be put into the first focusable element in the form.
Note that to put focus in a different item you can explicitly calldynamicForm.focusInItem(itemName)
- Parameters:
autoFocus
- New autoFocus value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getAutoFocus
If true, when the form is drawn, focus will automatically be put into the first focusable element in the form.
Note that to put focus in a different item you can explicitly calldynamicForm.focusInItem(itemName)
- Returns:
- Current autoFocus value. Default value is false
- See Also:
-
setAutoFocusOnError
If true, whenvalidation
fails focus will automatically be put into the first focusable field which failed validation.- Parameters:
autoFocusOnError
- New autoFocusOnError value. Default value is true- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getAutoFocusOnError
If true, whenvalidation
fails focus will automatically be put into the first focusable field which failed validation.- Returns:
- Current autoFocusOnError value. Default value is true
- See Also:
-
setBrowserSpellCheck
If this browser has a 'spellCheck' feature for text-based form item elements, should it be used for items in this form? Can be overridden at the item level viaFormItem.browserSpellCheck
Notes:
- this property only applies to text based items such as TextItem and TextAreaItem.
- this property is not supported on all browsers.- Parameters:
browserSpellCheck
- New browserSpellCheck value. Default value is true- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getBrowserSpellCheck
If this browser has a 'spellCheck' feature for text-based form item elements, should it be used for items in this form? Can be overridden at the item level viaFormItem.browserSpellCheck
Notes:
- this property only applies to text based items such as TextItem and TextAreaItem.
- this property is not supported on all browsers.- Returns:
- Current browserSpellCheck value. Default value is true
- See Also:
-
setCanEdit
If set tofalse
, the form will be marked read-only. A widget on the form is editable if either (1) beginning with the widget and continuing up the containment hierarchy, including the form, the first widget to have a non-nullcanEdit
attribute has canEdit:true, or (2) neither the widget nor any parent has a non-nullcanEdit
attribute. This setting allows you to enable or disable the default editability of the form's items at one time.This setting differs from the enabled/disabled state in that most form items will allow copying of the contents while read-only but do not while disabled.
Note that a form is considered editable if
canEdit
is null (default) ortrue
.Note that this property may validly be
null
as a distinct state fromfalse
. SeefieldIsEditable()
for an API that will always returntrue
orfalse
and give a definitive answer as to whether editing is possible.
If this method is called after the component has been drawn/initialized: Is this form editable or read-only? Setting the form to non-editable causes all form items to render as read-only unless a form item is specifically marked as editable (the item'scanEdit
attribute istrue
).Note : This is an advanced setting
- Parameters:
canEdit
- Can this form be edited?. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getCanEdit
If set tofalse
, the form will be marked read-only. A widget on the form is editable if either (1) beginning with the widget and continuing up the containment hierarchy, including the form, the first widget to have a non-nullcanEdit
attribute has canEdit:true, or (2) neither the widget nor any parent has a non-nullcanEdit
attribute. This setting allows you to enable or disable the default editability of the form's items at one time.This setting differs from the enabled/disabled state in that most form items will allow copying of the contents while read-only but do not while disabled.
Note that a form is considered editable if
canEdit
is null (default) ortrue
.Note that this property may validly be
null
as a distinct state fromfalse
. SeefieldIsEditable()
for an API that will always returntrue
orfalse
and give a definitive answer as to whether editing is possible.- Returns:
- Current canEdit value. Default value is null
- See Also:
-
setCanEditFieldAttribute
public DynamicForm setCanEditFieldAttribute(String canEditFieldAttribute) throws IllegalStateException If this component is bound to a dataSource, this attribute may be specified to customize what fields from the dataSource may be edited by default. For example theSearchForm
class has this attribute set to"canFilter"
which allows search forms to edit dataSource fields marked ascanEdit:false
(but not those marked ascanFilter:false
).Note that if
canEdit
is explicitly specified on a field in theDataBoundComponent.fields
array, that property will be respected in preference to the canEditAttribute value. (SeeFormItem.canEdit
,ListGridField.canEdit
). Also note that individual dataBoundComponents may have additional logic around whether a field can be edited - for exampleListGrid.canEditCell()
may be overridden.Note : This is an advanced setting
- Parameters:
canEditFieldAttribute
- New canEditFieldAttribute value. Default value is "canEdit"- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getCanEditFieldAttribute
If this component is bound to a dataSource, this attribute may be specified to customize what fields from the dataSource may be edited by default. For example theSearchForm
class has this attribute set to"canFilter"
which allows search forms to edit dataSource fields marked ascanEdit:false
(but not those marked ascanFilter:false
).Note that if
canEdit
is explicitly specified on a field in theDataBoundComponent.fields
array, that property will be respected in preference to the canEditAttribute value. (SeeFormItem.canEdit
,ListGridField.canEdit
). Also note that individual dataBoundComponents may have additional logic around whether a field can be edited - for exampleListGrid.canEditCell()
may be overridden.- Returns:
- Current canEditFieldAttribute value. Default value is "canEdit"
- See Also:
-
setCanFocus
DynamicForms are considered to have focus if any of their form items have focus. Note that settingdynamicForm.canFocus
to false will have no effect on whether form items within the form may receive focus. This property will only govern whether the form may receive focus if the form contains no focusable items.Note : This is an advanced setting
- Overrides:
setCanFocus
in classCanvas
- Parameters:
canFocus
- New canFocus value. Default value is true- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getCanFocus
DynamicForms are considered to have focus if any of their form items have focus. Note that settingdynamicForm.canFocus
to false will have no effect on whether form items within the form may receive focus. This property will only govern whether the form may receive focus if the form contains no focusable items.- Overrides:
getCanFocus
in classCanvas
- Returns:
- Current canFocus value. Default value is true
- See Also:
-
setCanSubmit
Governs whether this form will be used to perform a standard HTML form submission. Note that if true,submit()
will perform a native HTML submission to the specifiedaction
URL.
Wherever possible we strongly recommend using theDataBound Component Methods
to send data to the server as they provide a far more sophisticated interface, with built in options for server validation, required fields, etc.
Note : This is an advanced setting
- Parameters:
canSubmit
- New canSubmit value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getCanSubmit
Governs whether this form will be used to perform a standard HTML form submission. Note that if true,submit()
will perform a native HTML submission to the specifiedaction
URL.
Wherever possible we strongly recommend using theDataBound Component Methods
to send data to the server as they provide a far more sophisticated interface, with built in options for server validation, required fields, etc.- Returns:
- Current canSubmit value. Default value is false
- See Also:
-
setCanTabToIcons
Should users be able to tab into theicons
andpicker icon
for items within this form by default?May be overridden at the item level by
FormItem.canTabToIcons
.Developers may also suppress tabbing to individual icons by setting
FormItemIcon.tabIndex
to-1
.Note : This is an advanced setting
- Parameters:
canTabToIcons
- New canTabToIcons value. Default value is true- Returns:
DynamicForm
instance, for chaining setter calls
-
getCanTabToIcons
Should users be able to tab into theicons
andpicker icon
for items within this form by default?May be overridden at the item level by
FormItem.canTabToIcons
.Developers may also suppress tabbing to individual icons by setting
FormItemIcon.tabIndex
to-1
.- Returns:
- Current canTabToIcons value. Default value is true
-
setCanTabToSectionHeaders
public DynamicForm setCanTabToSectionHeaders(Boolean canTabToSectionHeaders) throws IllegalStateException If true, the headers for anySectionItems
will be included in the page's tab order for accessibility. May also be set at the item level viaSectionItem.canTabToHeader
If unset, section headers will be focusable if
SC.setScreenReaderMode()
has been called. SeeAccessibility
.Note : This is an advanced setting
- Parameters:
canTabToSectionHeaders
- New canTabToSectionHeaders value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getCanTabToSectionHeaders
If true, the headers for anySectionItems
will be included in the page's tab order for accessibility. May also be set at the item level viaSectionItem.canTabToHeader
If unset, section headers will be focusable if
SC.setScreenReaderMode()
has been called. SeeAccessibility
.- Returns:
- Current canTabToSectionHeaders value. Default value is null
-
setCellBorder
Width of border for the table that form is drawn in. This is primarily used for debugging form layout.- Parameters:
cellBorder
- New cellBorder value. Default value is 0- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getCellBorder
public int getCellBorder()Width of border for the table that form is drawn in. This is primarily used for debugging form layout.- Returns:
- Current cellBorder value. Default value is 0
- See Also:
-
setCellPadding
The amount of empty space, in pixels, surrounding each form item within its cell in the layout grid.- Parameters:
cellPadding
- New cellPadding value. Default value is 2- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getCellPadding
public int getCellPadding()The amount of empty space, in pixels, surrounding each form item within its cell in the layout grid.- Returns:
- Current cellPadding value. Default value is 2
- See Also:
-
setCheckFileAccessOnSubmit
For dynamicForms containing aFileItem
for uploading files, should the browser verify that the file is accessible before submitting the uploaded file to the server?In some cases the browser may not be able to access the selected file.
This can occur when the file has been modified in the file system after selection in the browser, or if the current user doesn't have permission to view the file.By default, before submitting the file to the server the browser will verify that it can access the file's contents and display the
fileAccessFailedWarning
if file access fails.
Note that accessing the file's contents is an asynchronous process, so form submission is not performed synchronously.This means that if application code calls
saveData()
on a form containing a fileItem and then synchronouslyclears
it from the DOM, the upload will never be kicked off.
SettingcheckFileAccessOnSubmit
to false will suppress the (asynchronous) check, and can be used to bypass this limitation, but this is not recommended except as a short term backwards-compatibility workaround. Instead we'd recommend using thesaveData callback
to clear the form when the upload has completed. This also gives the user an opportunity to correct validation errors and re-submit the form if necessary.Note : This is an advanced setting
- Parameters:
checkFileAccessOnSubmit
- New checkFileAccessOnSubmit value. Default value is true- Returns:
DynamicForm
instance, for chaining setter calls
-
getCheckFileAccessOnSubmit
public boolean getCheckFileAccessOnSubmit()For dynamicForms containing aFileItem
for uploading files, should the browser verify that the file is accessible before submitting the uploaded file to the server?In some cases the browser may not be able to access the selected file.
This can occur when the file has been modified in the file system after selection in the browser, or if the current user doesn't have permission to view the file.By default, before submitting the file to the server the browser will verify that it can access the file's contents and display the
fileAccessFailedWarning
if file access fails.
Note that accessing the file's contents is an asynchronous process, so form submission is not performed synchronously.This means that if application code calls
saveData()
on a form containing a fileItem and then synchronouslyclears
it from the DOM, the upload will never be kicked off.
SettingcheckFileAccessOnSubmit
to false will suppress the (asynchronous) check, and can be used to bypass this limitation, but this is not recommended except as a short term backwards-compatibility workaround. Instead we'd recommend using thesaveData callback
to clear the form when the upload has completed. This also gives the user an opportunity to correct validation errors and re-submit the form if necessary.- Returns:
- Current checkFileAccessOnSubmit value. Default value is true
-
setClipItemTitles
Should the titles for form items be clipped if they are too large for the available space?Can be overridden for individual items via
FormItem.clipTitle
.- Parameters:
clipItemTitles
- New clipItemTitles value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls
-
getClipItemTitles
public boolean getClipItemTitles()Should the titles for form items be clipped if they are too large for the available space?Can be overridden for individual items via
FormItem.clipTitle
.- Returns:
- Current clipItemTitles value. Default value is false
-
setClipStaticValue
DefaultFormItem.clipStaticValue
setting for items in this form. When unset, this is equivalent tofalse
.- Parameters:
clipStaticValue
- New clipStaticValue value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getClipStaticValue
DefaultFormItem.clipStaticValue
setting for items in this form. When unset, this is equivalent tofalse
.- Returns:
- Current clipStaticValue value. Default value is null
-
setDataArity
A DynamicForm is adataArity
:single component.Note : This is an advanced setting
- Parameters:
dataArity
- New dataArity value. Default value is "single"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getDataArity
A DynamicForm is adataArity
:single component.- Returns:
- Current dataArity value. Default value is "single"
- See Also:
-
setDataFetchMode
How to fetch and manage records retrieve from the server. SeeFetchMode
.This setting only applies to the
ResultSet
automatically created by callingfetchData()
. If a pre-existing ResultSet is passed to setData() instead, it's existing setting forResultSet.fetchMode
applies.- Specified by:
setDataFetchMode
in interfaceDataBoundComponent
- Parameters:
dataFetchMode
- New dataFetchMode value. Default value is "paged"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getDataFetchMode
How to fetch and manage records retrieve from the server. SeeFetchMode
.This setting only applies to the
ResultSet
automatically created by callingfetchData()
. If a pre-existing ResultSet is passed to setData() instead, it's existing setting forResultSet.fetchMode
applies.- Specified by:
getDataFetchMode
in interfaceDataBoundComponent
- Returns:
- Current dataFetchMode value. Default value is "paged"
- See Also:
-
setDataSource
The DataSource that this component should bind to for default fields and for performingDataSource requests
.Can be specified as either a DataSource instance or the String ID of a DataSource.
- Specified by:
setDataSource
in interfaceDataBoundComponent
- Parameters:
dataSource
- New dataSource value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
setDataSource
The DataSource that this component should bind to for default fields and for performingDataSource requests
.Can be specified as either a DataSource instance or the String ID of a DataSource.
- Specified by:
setDataSource
in interfaceDataBoundComponent
- Parameters:
dataSource
- New dataSource value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
setDateFormatter
DefaultDateDisplayFormat
for Date type values displayed in this form.If some field's value is set to a native Date object, how should it be displayed to the user? If specified this is the default display format to use, and will apply to all fields except those specified as
type:"time"
(SeetimeFormatter
).May be overridden at the component level for fields of type
datetime
viadatetimeFormatter
.Note that if specified,
FormItem.dateFormatter
andFormItem.timeFormatter
take precedence over the format specified at the component level.If no explicit formatter is specified at the field or component level, dates will be formatted according to the system-wide
short date display format
orshort datetime display format
depending on the specified field type.- Parameters:
dateFormatter
- New dateFormatter value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls
-
getDateFormatter
DefaultDateDisplayFormat
for Date type values displayed in this form.If some field's value is set to a native Date object, how should it be displayed to the user? If specified this is the default display format to use, and will apply to all fields except those specified as
type:"time"
(SeetimeFormatter
).May be overridden at the component level for fields of type
datetime
viadatetimeFormatter
.Note that if specified,
FormItem.dateFormatter
andFormItem.timeFormatter
take precedence over the format specified at the component level.If no explicit formatter is specified at the field or component level, dates will be formatted according to the system-wide
short date display format
orshort datetime display format
depending on the specified field type.- Returns:
- Current dateFormatter value. Default value is null
-
setDatetimeFormatter
DefaultDateDisplayFormat
for Date type values displayed in this form in fields of typedatetime
.For datetime fields, this attribute will be used instead of
dateFormatter
when formatting Date values.Note that if specified,
FormItem.dateFormatter
andFormItem.timeFormatter
take precedence over the format specified at the component level.If no explicit formatter is specified at the field or component level, datetime field values will be formatted according to the system-wide
short datetime display format
.- Parameters:
datetimeFormatter
- New datetimeFormatter value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls
-
getDatetimeFormatter
DefaultDateDisplayFormat
for Date type values displayed in this form in fields of typedatetime
.For datetime fields, this attribute will be used instead of
dateFormatter
when formatting Date values.Note that if specified,
FormItem.dateFormatter
andFormItem.timeFormatter
take precedence over the format specified at the component level.If no explicit formatter is specified at the field or component level, datetime field values will be formatted according to the system-wide
short datetime display format
.- Returns:
- Current datetimeFormatter value. Default value is null
-
setDefaultSearchOperator
public DynamicForm setDefaultSearchOperator(OperatorId defaultSearchOperator) throws IllegalStateException Defaultsearch operator
to use for fields in a form that producesAdvancedCriteria
. Default is "iContains" unlessallowExpressions
is enabled for the form as a whole, in which case the default is"iContainsPattern"
.Does not apply to special fields where exact match is obviously the right default setting, such as fields of type:"enum", or fields with a
valueMap
oroptionDataSource
.defaultSearchOperator
also has no effect in a form that does not produceAdvancedCriteria
- seegetValuesAsCriteria()
for settings that cause a form to produce AdvancedCriteria.- Parameters:
defaultSearchOperator
- New defaultSearchOperator value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getDefaultSearchOperator
Defaultsearch operator
to use for fields in a form that producesAdvancedCriteria
. Default is "iContains" unlessallowExpressions
is enabled for the form as a whole, in which case the default is"iContainsPattern"
.Does not apply to special fields where exact match is obviously the right default setting, such as fields of type:"enum", or fields with a
valueMap
oroptionDataSource
.defaultSearchOperator
also has no effect in a form that does not produceAdvancedCriteria
- seegetValuesAsCriteria()
for settings that cause a form to produce AdvancedCriteria.- Returns:
- Current defaultSearchOperator value. Default value is null
-
setDisableValidation
If set to true, client-side validators will not run on the form when validate() is called. Server-side validators (if any) will still run on attempted save.- Parameters:
disableValidation
- New disableValidation value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getDisableValidation
If set to true, client-side validators will not run on the form when validate() is called. Server-side validators (if any) will still run on attempted save.- Returns:
- Current disableValidation value. Default value is null
- See Also:
-
setEditProxyConstructor
public DynamicForm setEditProxyConstructor(String editProxyConstructor) throws IllegalStateException Default class used to construct theEditProxy
for this component when the component isfirst placed into edit mode
.- Overrides:
setEditProxyConstructor
in classCanvas
- Parameters:
editProxyConstructor
- New editProxyConstructor value. Default value is "FormEditProxy"- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getEditProxyConstructor
Default class used to construct theEditProxy
for this component when the component isfirst placed into edit mode
.- Overrides:
getEditProxyConstructor
in classCanvas
- Returns:
- Current editProxyConstructor value. Default value is "FormEditProxy"
- See Also:
-
setEncoding
encoding for the form, use MULTIPART_ENCODING for file upload formsNote : This is an advanced setting
- Parameters:
encoding
- New encoding value. Default value is DynamicForm.NORMAL- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getEncoding
encoding for the form, use MULTIPART_ENCODING for file upload forms- Returns:
- Current encoding value. Default value is DynamicForm.NORMAL
- See Also:
-
setErrorItemCellStyle
IfshowInlineErrors
is false we show all errors for the form item in a single item rendered at the top of the form.
This attribute specifies the cellStyle to apply to this item.- Parameters:
errorItemCellStyle
- New errorItemCellStyle value. Default value is "formCellError"- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getErrorItemCellStyle
IfshowInlineErrors
is false we show all errors for the form item in a single item rendered at the top of the form.
This attribute specifies the cellStyle to apply to this item.- Returns:
- Current errorItemCellStyle value. Default value is "formCellError"
- See Also:
-
setErrorsPreamble
IfshowInlineErrors
isfalse
, all errors for the items in the form are rendered as a single item at the top of the form. This attribute specifies an introductory message rendered out before the individual error messages.- Parameters:
errorsPreamble
- New errorsPreamble value. Default value is "The following errors were found"- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getErrorsPreamble
IfshowInlineErrors
isfalse
, all errors for the items in the form are rendered as a single item at the top of the form. This attribute specifies an introductory message rendered out before the individual error messages.- Returns:
- Current errorsPreamble value. Default value is "The following errors were found"
- See Also:
-
setFetchRequestProperties
public DynamicForm setFetchRequestProperties(DSRequest fetchRequestProperties) throws IllegalStateException IfautoFetchData
istrue
, this attribute allows the developer to declaratively specifyDSRequest
properties for the initialfetchData()
call.Note that any properties governing more specific request attributes for the initial fetch (such as
autoFetchTextMatchStyle
) will be applied on top of this properties block.- Parameters:
fetchRequestProperties
- New fetchRequestProperties value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getFetchRequestProperties
IfautoFetchData
istrue
, this attribute allows the developer to declaratively specifyDSRequest
properties for the initialfetchData()
call.Note that any properties governing more specific request attributes for the initial fetch (such as
autoFetchTextMatchStyle
) will be applied on top of this properties block.- Returns:
- Current fetchRequestProperties value. Default value is null
- See Also:
-
setFileAccessFailedWarning
Warning to display to the user if a selected file in an UploadItem cannot be accessed. This will be displayed on form submission when the browser is unable to access the selected file for upload.Typically this indicates a browser-level security restriction - for example the file has been edited on the disk, or had its permissions changed after the user selected it, but before they attempted to submit the form.
When this occurs the selected file will be cleared from the upload item and this message will be displayed to the user in a
warn dialog
.- Parameters:
fileAccessFailedWarning
- New fileAccessFailedWarning value. Default value is "Unable to access the selected file(s) for upload. Please re-select the file and try again."- Returns:
DynamicForm
instance, for chaining setter calls
-
getFileAccessFailedWarning
Warning to display to the user if a selected file in an UploadItem cannot be accessed. This will be displayed on form submission when the browser is unable to access the selected file for upload.Typically this indicates a browser-level security restriction - for example the file has been edited on the disk, or had its permissions changed after the user selected it, but before they attempted to submit the form.
When this occurs the selected file will be cleared from the upload item and this message will be displayed to the user in a
warn dialog
.- Returns:
- Current fileAccessFailedWarning value. Default value is "Unable to access the selected file(s) for upload. Please re-select the file and try again."
-
setFixedColWidths
If true, we ensure that column widths are at least as large as you specify them. This means that if any single column overflows (due to, eg, a long unbreakable title), the form as a whole overflows.If false, columns will have their specified sizes as long as no column overflows. If any column overflows, space will be taken from any other columns that aren't filling the available room, until there is no more free space, in which case the form as a whole overflows.
- Parameters:
fixedColWidths
- New fixedColWidths value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getFixedColWidths
If true, we ensure that column widths are at least as large as you specify them. This means that if any single column overflows (due to, eg, a long unbreakable title), the form as a whole overflows.If false, columns will have their specified sizes as long as no column overflows. If any column overflows, space will be taken from any other columns that aren't filling the available room, until there is no more free space, in which case the form as a whole overflows.
- Returns:
- Current fixedColWidths value. Default value is false
- See Also:
-
setFormSubmitFailedWarning
Deprecated.Warning to display to the user if an attempt tonatively submit
a form is unable to submit to the server. The most common cause for this failure is that the user has typed an invalid file-path into an upload type field.Note : This is an advanced setting
- Parameters:
formSubmitFailedWarning
- New formSubmitFailedWarning value. Default value is "Form was unable to be submitted. The most likely cause for this is an invalid value in an upload field."- Returns:
DynamicForm
instance, for chaining setter calls
-
getFormSubmitFailedWarning
Deprecated.Warning to display to the user if an attempt tonatively submit
a form is unable to submit to the server. The most common cause for this failure is that the user has typed an invalid file-path into an upload type field.- Returns:
- Current formSubmitFailedWarning value. Default value is "Form was unable to be submitted. The most likely cause for this is an invalid value in an upload field."
-
setHiliteRequiredFields
Indicates whether the titles of required items in this form should use the special prefix and suffix specified by therequiredTitlePrefix
andrequiredTitleSuffix
attributes, instead of the standard prefix and suffix.- Parameters:
hiliteRequiredFields
- New hiliteRequiredFields value. Default value is true- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getHiliteRequiredFields
Indicates whether the titles of required items in this form should use the special prefix and suffix specified by therequiredTitlePrefix
andrequiredTitleSuffix
attributes, instead of the standard prefix and suffix.- Returns:
- Current hiliteRequiredFields value. Default value is true
- See Also:
-
setImplicitSave
When true, indicates that changes to items in this form will be automatically saved on adelay
, as well as when the entire form is submitted. Unlessform.implicitSaveOnBlur
is set to false, changes will also be automatically saved on editorExit for each item. This attribute can also be set directly on FormItems.- Parameters:
implicitSave
- New implicitSave value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls
-
getImplicitSave
When true, indicates that changes to items in this form will be automatically saved on adelay
, as well as when the entire form is submitted. Unlessform.implicitSaveOnBlur
is set to false, changes will also be automatically saved on editorExit for each item. This attribute can also be set directly on FormItems.- Returns:
- Current implicitSave value. Default value is false
-
setImplicitSaveDelay
WhenimplicitSave
is true, this attribute dictates the millisecond delay after which form items are automatically saved during editing.- Parameters:
implicitSaveDelay
- New implicitSaveDelay value. Default value is 2000- Returns:
DynamicForm
instance, for chaining setter calls
-
getImplicitSaveDelay
public int getImplicitSaveDelay()WhenimplicitSave
is true, this attribute dictates the millisecond delay after which form items are automatically saved during editing.- Returns:
- Current implicitSaveDelay value. Default value is 2000
-
setImplicitSaveOnBlur
If true, form item values will be automatically saved when each item's "editorExit" handler is fired as well as on a delay and when the entire form is submitted. This attribute can also be set directly on FormItems.- Parameters:
implicitSaveOnBlur
- New implicitSaveOnBlur value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls
-
getImplicitSaveOnBlur
If true, form item values will be automatically saved when each item's "editorExit" handler is fired as well as on a delay and when the entire form is submitted. This attribute can also be set directly on FormItems.- Returns:
- Current implicitSaveOnBlur value. Default value is false
-
setInitialSort
An array ofSortSpecifier
objects used to set up the initial sort configuration for this form.- Parameters:
initialSort
- New initialSort value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getInitialSort
An array ofSortSpecifier
objects used to set up the initial sort configuration for this form.- Returns:
- Current initialSort value. Default value is null
-
setItemHoverAlign
Text alignment for hovers shown for items- Parameters:
itemHoverAlign
- New itemHoverAlign value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getItemHoverAlign
Text alignment for hovers shown for items- Returns:
- Current itemHoverAlign value. Default value is null
- See Also:
-
setItemHoverDelay
If the user rolls over an item, how long a delay before we fire any hover action / show a hover for that item?- Parameters:
itemHoverDelay
- New itemHoverDelay value. Default value is 500- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getItemHoverDelay
public int getItemHoverDelay()If the user rolls over an item, how long a delay before we fire any hover action / show a hover for that item?- Returns:
- Current itemHoverDelay value. Default value is 500
- See Also:
-
setItemHoverHeight
A default height for hovers shown for items- Parameters:
itemHoverHeight
- New itemHoverHeight value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getItemHoverHeight
A default height for hovers shown for items- Returns:
- Current itemHoverHeight value. Default value is null
- See Also:
-
setItemHoverHeight
A default height for hovers shown for items- Parameters:
itemHoverHeight
- New itemHoverHeight value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getItemHoverHeightAsString
A default height for hovers shown for items- Returns:
- Current itemHoverHeight value. Default value is null
- See Also:
-
setItemHoverOpacity
Opacity for hovers shown for items- Parameters:
itemHoverOpacity
- New itemHoverOpacity value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getItemHoverOpacity
Opacity for hovers shown for items- Returns:
- Current itemHoverOpacity value. Default value is null
- See Also:
-
setItemHoverStyle
CSS Style for hovers shown for items- Parameters:
itemHoverStyle
- New itemHoverStyle value. Default value is "formHover"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getItemHoverStyle
CSS Style for hovers shown for items- Returns:
- Current itemHoverStyle value. Default value is "formHover"
- See Also:
-
setItemHoverVAlign
Vertical text alignment for hovers shown for items- Parameters:
itemHoverVAlign
- New itemHoverVAlign value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getItemHoverVAlign
Vertical text alignment for hovers shown for items- Returns:
- Current itemHoverVAlign value. Default value is null
- See Also:
-
setItemHoverVAlign
Vertical text alignment for hovers shown for items- Parameters:
itemHoverVAlign
- New itemHoverVAlign value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getItemHoverVAlignAsString
Vertical text alignment for hovers shown for items- Returns:
- Current itemHoverVAlign value. Default value is null
- See Also:
-
setItemHoverWidth
A default width for hovers shown for items- Parameters:
itemHoverWidth
- New itemHoverWidth value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getItemHoverWidth
A default width for hovers shown for items- Returns:
- Current itemHoverWidth value. Default value is null
- See Also:
-
setItemHoverWidth
A default width for hovers shown for items- Parameters:
itemHoverWidth
- New itemHoverWidth value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getItemHoverWidthAsString
A default width for hovers shown for items- Returns:
- Current itemHoverWidth value. Default value is null
- See Also:
-
setItemLayout
Layout style to use with this form.The default of "table" uses a tabular layout similar to HTML tables, but with much more powerful control over sizing, item visibility and reflow, overflow handling, etc.
itemLayout:"absolute"
allows absolute positioning of every form item. This provides maximum flexibility in placement, with the following limitations:- titles, which normally take up an adjacent cell, are not shown. Use StaticTextItems to show titles
- no automatic reflow when showing or hiding items.
FormItem.setLeft()
andFormItem.setTop()
can be used for manual reflow. - only pixel and percent sizes are allowed, no "*". Percent widths mean percentage of the overall form size rather than the column size
- with different font styling or internationalized titles, items may overlap that did not overlap in the skin used at design time
Note : This is an advanced setting
- Parameters:
itemLayout
- New itemLayout value. Default value is "table"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getItemLayout
Layout style to use with this form.The default of "table" uses a tabular layout similar to HTML tables, but with much more powerful control over sizing, item visibility and reflow, overflow handling, etc.
itemLayout:"absolute"
allows absolute positioning of every form item. This provides maximum flexibility in placement, with the following limitations:- titles, which normally take up an adjacent cell, are not shown. Use StaticTextItems to show titles
- no automatic reflow when showing or hiding items.
FormItem.setLeft()
andFormItem.setTop()
can be used for manual reflow. - only pixel and percent sizes are allowed, no "*". Percent widths mean percentage of the overall form size rather than the column size
- with different font styling or internationalized titles, items may overlap that did not overlap in the skin used at design time
- Returns:
- Current itemLayout value. Default value is "table"
- See Also:
-
setLinearAutoSpanItems
When a form is rendered inlinearMode
, should each item appear on its own row, spanning the full set of rendered columns by default?- Parameters:
linearAutoSpanItems
- New linearAutoSpanItems value. Default value is true- Returns:
DynamicForm
instance, for chaining setter calls
-
getLinearAutoSpanItems
When a form is rendered inlinearMode
, should each item appear on its own row, spanning the full set of rendered columns by default?- Returns:
- Current linearAutoSpanItems value. Default value is true
-
setLinearHintWidth
WhenlinearMode
is true, this property sets the amount of space reserved forhint-text
in formItems that set a hint. May be set to a pixel-size like 100 or a percentage, such as "30%".- Parameters:
linearHintWidth
- New linearHintWidth value. Default value is 100- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getLinearHintWidth
public int getLinearHintWidth()WhenlinearMode
is true, this property sets the amount of space reserved forhint-text
in formItems that set a hint. May be set to a pixel-size like 100 or a percentage, such as "30%".- Returns:
- Current linearHintWidth value. Default value is 100
- See Also:
-
setLinearHintWidth
WhenlinearMode
is true, this property sets the amount of space reserved forhint-text
in formItems that set a hint. May be set to a pixel-size like 100 or a percentage, such as "30%".- Parameters:
linearHintWidth
- New linearHintWidth value. Default value is 100- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getLinearHintWidthAsString
WhenlinearMode
is true, this property sets the amount of space reserved forhint-text
in formItems that set a hint. May be set to a pixel-size like 100 or a percentage, such as "30%".- Returns:
- Current linearHintWidth value. Default value is 100
- See Also:
-
setLinearMode
Switches the entire form to render in a style that is typical for form on a mobile device with oneFormItem
per row.The
linearOnMobile
attribute allows linear mode to be enabled on mobile interfaces automatically.While
linearMode
is active, the form's table layout is determined using the following logic:- If
TitleOrientation
is not explicitly specified, it will be defaulted totop
, causing each item's title to appear above its element.
Note: in linear mode, each item will have the same title orientation. The item-levelFormItem.titleOrientation
attribute will be ignored. - For those items with a
hint
that supportshowing the hint in the field
,showHintInField
will be defaulted true if unset. - For items showing validation errors inline, by
default
error text
will be displayed, and errors willbe rendered above the item element
. - The
numCols
property for the form is ignored. The form will render as a single column of items - or two columns iftitleOrientation
is specified as"left"
or"right"
by default. To override this, a developer may specify an explicitlinearNumCols
allowing multiple items to potentially be placed next to each other. -
FormItem.width
is ignored and all items receive "*" width unlessFormItem.linearWidth
is specified.
colWidths
, but the number of columns doesn't match the number of columns being rendered in linear mode, it will be ignored.If
linearAutoSpanItems
is true, each item in linear mode will span the full set of columns by default. With this setting enabled,linearNumCols
can be understood as a way to allow some items that are known to not require the full width of the UI to appear next to each other in an otherwise single-column form.When
linearAutoSpanItems
is enabled, the following properties are available for further customizing the placement and sizing of items in a linear form:-
FormItem.colSpan
is ignored and defaulted to "*", unlessFormItem.linearColSpan
is specified. -
FormItem.startRow
andFormItem.endRow
are ignored and all items will default tostartRow:false
andendRow:true
. This may be overridden per item viaFormItem.linearStartRow
andFormItem.linearEndRow
.
SplitPane
.- Parameters:
linearMode
- New linearMode value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
- If
-
getLinearMode
Switches the entire form to render in a style that is typical for form on a mobile device with oneFormItem
per row.The
linearOnMobile
attribute allows linear mode to be enabled on mobile interfaces automatically.While
linearMode
is active, the form's table layout is determined using the following logic:- If
TitleOrientation
is not explicitly specified, it will be defaulted totop
, causing each item's title to appear above its element.
Note: in linear mode, each item will have the same title orientation. The item-levelFormItem.titleOrientation
attribute will be ignored. - For those items with a
hint
that supportshowing the hint in the field
,showHintInField
will be defaulted true if unset. - For items showing validation errors inline, by
default
error text
will be displayed, and errors willbe rendered above the item element
. - The
numCols
property for the form is ignored. The form will render as a single column of items - or two columns iftitleOrientation
is specified as"left"
or"right"
by default. To override this, a developer may specify an explicitlinearNumCols
allowing multiple items to potentially be placed next to each other. -
FormItem.width
is ignored and all items receive "*" width unlessFormItem.linearWidth
is specified.
colWidths
, but the number of columns doesn't match the number of columns being rendered in linear mode, it will be ignored.If
linearAutoSpanItems
is true, each item in linear mode will span the full set of columns by default. With this setting enabled,linearNumCols
can be understood as a way to allow some items that are known to not require the full width of the UI to appear next to each other in an otherwise single-column form.When
linearAutoSpanItems
is enabled, the following properties are available for further customizing the placement and sizing of items in a linear form:-
FormItem.colSpan
is ignored and defaulted to "*", unlessFormItem.linearColSpan
is specified. -
FormItem.startRow
andFormItem.endRow
are ignored and all items will default tostartRow:false
andendRow:true
. This may be overridden per item viaFormItem.linearStartRow
andFormItem.linearEndRow
.
SplitPane
.- Returns:
- Current linearMode value. Default value is null
- See Also:
- If
-
setLinearNumCols
Specifies thenumber of columns
when the form is being rendered inlinearMode
, overriding any automatically derived value in that mode.- Parameters:
linearNumCols
- New linearNumCols value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getLinearNumCols
Specifies thenumber of columns
when the form is being rendered inlinearMode
, overriding any automatically derived value in that mode.- Returns:
- Current linearNumCols value. Default value is null
- See Also:
-
setLinearOnMobile
Switches the entire form to render in a style that is typical for form on ahandset device
with oneFormItem
per row by automatically defaultinglinearMode
totrue
on handsets.Note: This property should not be changed framework-wide via addProperties() as the framework itself assumes and relies upon normal behavior for forms. If you want most of your forms to use
linearMode
on mobile, create a subclass wherelinearOnMobile
defaults to true, and pervasively use that subclass.- Parameters:
linearOnMobile
- New linearOnMobile value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getLinearOnMobile
public boolean getLinearOnMobile()Switches the entire form to render in a style that is typical for form on ahandset device
with oneFormItem
per row by automatically defaultinglinearMode
totrue
on handsets.Note: This property should not be changed framework-wide via addProperties() as the framework itself assumes and relies upon normal behavior for forms. If you want most of your forms to use
linearMode
on mobile, create a subclass wherelinearOnMobile
defaults to true, and pervasively use that subclass.- Returns:
- Current linearOnMobile value. Default value is false
- See Also:
-
setLongTextEditorThreshold
When creating form items for fields with text type data, if the specified length of the field exceeds this threshold we will create form item of typethis.longTextEditorType
(a TextAreaItem by default), rather than a simple text item. Overridden by explicitly specifyingeditorType
for the field.- Parameters:
longTextEditorThreshold
- New longTextEditorThreshold value. Default value is 255- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getLongTextEditorThreshold
public int getLongTextEditorThreshold()When creating form items for fields with text type data, if the specified length of the field exceeds this threshold we will create form item of typethis.longTextEditorType
(a TextAreaItem by default), rather than a simple text item. Overridden by explicitly specifyingeditorType
for the field.- Returns:
- Current longTextEditorThreshold value. Default value is 255
- See Also:
-
setLongTextEditorType
Name of the Form Item class to use for text fields which exceed the longTextEditorThreshold for this form.- Parameters:
longTextEditorType
- New longTextEditorType value. Default value is "textArea"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getLongTextEditorType
Name of the Form Item class to use for text fields which exceed the longTextEditorThreshold for this form.- Returns:
- Current longTextEditorType value. Default value is "textArea"
- See Also:
-
setMethod
The mechanism by which form data is sent to the action URL. See FormMethod type for details.NOTE: this is used only in the very rare case that a form is used to submit data directly to a URL. Normal server contact is through
DataBound Component Methods
.
If this method is called after the component has been drawn/initialized: Sets themethod
for this form.- Parameters:
method
- html form submission method (get or post). Default value is DynamicForm.POST- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getMethod
The mechanism by which form data is sent to the action URL. See FormMethod type for details.NOTE: this is used only in the very rare case that a form is used to submit data directly to a URL. Normal server contact is through
DataBound Component Methods
.- Returns:
- Current method value. Default value is DynamicForm.POST
- See Also:
-
setMinColWidth
Minimum width of a form column.- Parameters:
minColWidth
- New minColWidth value. Default value is 20- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getMinColWidth
public int getMinColWidth()Minimum width of a form column.- Returns:
- Current minColWidth value. Default value is 20
- See Also:
-
setMinHintWidth
Minimum horizontal space made available forFormItem.hint
text. Typically this reflects how much space the hint text takes up before it wraps. May be overridden at the item level viaFormItem.minHintWidth
.This setting does not apply to hints that are
shown in field
.- Parameters:
minHintWidth
- New minHintWidth value. Default value is 80- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getMinHintWidth
Minimum horizontal space made available forFormItem.hint
text. Typically this reflects how much space the hint text takes up before it wraps. May be overridden at the item level viaFormItem.minHintWidth
.This setting does not apply to hints that are
shown in field
.- Returns:
- Current minHintWidth value. Default value is 80
- See Also:
-
setNoErrorDetailsMessage
A message to display to the user if server-side validation fails with an error but the server did not provide an error message- Parameters:
noErrorDetailsMessage
- New noErrorDetailsMessage value. Default value is "Error during validation; no error details were provided"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getNoErrorDetailsMessage
A message to display to the user if server-side validation fails with an error but the server did not provide an error message- Returns:
- Current noErrorDetailsMessage value. Default value is "Error during validation; no error details were provided"
- See Also:
-
setNumCols
The number of columns of titles and items in this form's layout grid. A title and corresponding item each have their own column, so to display two form elements per row (each having a title and item), you would set this property to 4.- Parameters:
numCols
- New numCols value. Default value is 2- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getNumCols
public int getNumCols()The number of columns of titles and items in this form's layout grid. A title and corresponding item each have their own column, so to display two form elements per row (each having a title and item), you would set this property to 4.- Returns:
- Current numCols value. Default value is 2
- See Also:
-
setOperator
WhenFormItem.operator
has been set for anyFormItem
in this form, what logical operator should be applied across thecriteria
produced by the form items? Only applicable to forms that have adataSource
.- Parameters:
operator
- New operator value. Default value is "and"- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getOperator
WhenFormItem.operator
has been set for anyFormItem
in this form, what logical operator should be applied across thecriteria
produced by the form items? Only applicable to forms that have adataSource
.- Returns:
- Current operator value. Default value is "and"
-
setOriginalValueMessage
Default template HTML string when an item does not set its ownFormItem.originalValueMessage
.Variables in the template are substituted as follows:
Variable Substitution $value
The item's old value as stored in the map returned by getOldValues()
.$newValue
The item's new value. For
$value
and$newValue
, any formatters or stored/display value mapping will be applied.Note : This is an advanced setting
- Parameters:
originalValueMessage
- New originalValueMessage value. Default value is "Original value: $value"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getOriginalValueMessage
Default template HTML string when an item does not set its ownFormItem.originalValueMessage
.Variables in the template are substituted as follows:
Variable Substitution $value
The item's old value as stored in the map returned by getOldValues()
.$newValue
The item's new value. For
$value
and$newValue
, any formatters or stored/display value mapping will be applied.- Returns:
- Current originalValueMessage value. Default value is "Original value: $value"
- See Also:
-
setReadOnlyDisplay
IfcanEdit
is set tofalse
, how should the items in this form be displayed to the user?Can be overridden via
FormItem.readOnlyDisplay
on individual form items.
If this method is called after the component has been drawn/initialized: Setter for thereadOnlyDisplay
attribute.- Parameters:
readOnlyDisplay
- New read-only display appearance. Default value is "readOnly"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getReadOnlyDisplay
IfcanEdit
is set tofalse
, how should the items in this form be displayed to the user?Can be overridden via
FormItem.readOnlyDisplay
on individual form items.- Returns:
- Current readOnlyDisplay value. Default value is "readOnly"
- See Also:
-
setReadOnlyTextBoxStyle
DefaultFormItem.readOnlyTextBoxStyle
setting for items in this form.Note: The default style may vary depending on the skin.
- Parameters:
readOnlyTextBoxStyle
- New readOnlyTextBoxStyle value. Default value is "staticTextItem"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getReadOnlyTextBoxStyle
DefaultFormItem.readOnlyTextBoxStyle
setting for items in this form.Note: The default style may vary depending on the skin.
- Returns:
- Current readOnlyTextBoxStyle value. Default value is "staticTextItem"
- See Also:
-
setRejectInvalidValueOnChange
If validateOnChange is true, and validation fails for an 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. May be set at the item or form level.Note : This is an advanced setting
- Parameters:
rejectInvalidValueOnChange
- New rejectInvalidValueOnChange value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls
-
getRejectInvalidValueOnChange
If validateOnChange is true, and validation fails for an 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. May be set at the item or form level.- Returns:
- Current rejectInvalidValueOnChange value. Default value is null
-
setRequiredMessage
The required message for required field errors.- Parameters:
requiredMessage
- New requiredMessage value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getRequiredMessage
The required message for required field errors.- Returns:
- Current requiredMessage value. Default value is null
- See Also:
-
setRequiredRightTitlePrefix
The string pre-pended to the title of every required item in this form ifhiliteRequiredFields
is true and theTitleOrientation
property is set to "right".- Parameters:
requiredRightTitlePrefix
- New requiredRightTitlePrefix value. Default value is "<b>: "- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getRequiredRightTitlePrefix
The string pre-pended to the title of every required item in this form ifhiliteRequiredFields
is true and theTitleOrientation
property is set to "right".- Returns:
- Current requiredRightTitlePrefix value. Default value is "<b>: "
- See Also:
-
setRequiredRightTitleSuffix
The string appended to the title of every required item in this form ifhiliteRequiredFields
is true and theTitleOrientation
property is set to "right".- Parameters:
requiredRightTitleSuffix
- New requiredRightTitleSuffix value. Default value is "</b>"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getRequiredRightTitleSuffix
The string appended to the title of every required item in this form ifhiliteRequiredFields
is true and theTitleOrientation
property is set to "right".- Returns:
- Current requiredRightTitleSuffix value. Default value is "</b>"
- See Also:
-
setRequiredTitlePrefix
The string pre-pended to the title of every required item in this form ifhiliteRequiredFields
is true.- Parameters:
requiredTitlePrefix
- New requiredTitlePrefix value. Default value is "<b>"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getRequiredTitlePrefix
The string pre-pended to the title of every required item in this form ifhiliteRequiredFields
is true.- Returns:
- Current requiredTitlePrefix value. Default value is "<b>"
- See Also:
-
setRequiredTitleSuffix
The string appended to the title of every required item in this form ifhiliteRequiredFields
is true.- Parameters:
requiredTitleSuffix
- New requiredTitleSuffix value. Default value is " :</b>"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getRequiredTitleSuffix
The string appended to the title of every required item in this form ifhiliteRequiredFields
is true.- Returns:
- Current requiredTitleSuffix value. Default value is " :</b>"
- See Also:
-
setRevertValueKey
Keyboard shortcut that causes the value of the currently focused form item to be reverted to whatever value would be shown ifresetValues()
were called.- Parameters:
revertValueKey
- New revertValueKey value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getRevertValueKey
Keyboard shortcut that causes the value of the currently focused form item to be reverted to whatever value would be shown ifresetValues()
were called.- Returns:
- Current revertValueKey value. Default value is null
- See Also:
-
setRightTitlePrefix
The string pre-pended to the title of an item in this form if its titleOrientation property is set to "right".- Parameters:
rightTitlePrefix
- New rightTitlePrefix value. Default value is ": "- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getRightTitlePrefix
The string pre-pended to the title of an item in this form if its titleOrientation property is set to "right".- Returns:
- Current rightTitlePrefix value. Default value is ": "
- See Also:
-
setRightTitleSuffix
The string appended to the title of an item in this form if its titleOrientation property is set to "right".- Parameters:
rightTitleSuffix
- New rightTitleSuffix value. Default value is ""- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getRightTitleSuffix
The string appended to the title of an item in this form if its titleOrientation property is set to "right".- Returns:
- Current rightTitleSuffix value. Default value is ""
- See Also:
-
setSaveOnEnter
Iftrue
, when the user hits the Enter key while focused in a text-item in this form, we automatically submit the form to the server using thesubmit()
method.- Parameters:
saveOnEnter
- New saveOnEnter value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getSaveOnEnter
Iftrue
, when the user hits the Enter key while focused in a text-item in this form, we automatically submit the form to the server using thesubmit()
method.- Returns:
- Current saveOnEnter value. Default value is false
- See Also:
-
setSaveOperationType
DefaultDSOperationType
to be performed whensaveData()
is called. This property is automatically set on a call toeditRecord()
oreditNewRecord()
, or may be set directly viasetSaveOperationType()
.If
saveOperationType
is unset, the form will heuristically determine whether an "add" or "update" operation is intended based on whether the primaryKey field is present and editable.
If this method is called after the component has been drawn/initialized: Setter for the defaultDSOperationType
whensaveData()
is called. Note that this property can also be set by callingeditRecord()
oreditNewRecord()
- Parameters:
saveOperationType
- Operation type to use as a default. Valid values are"add"
or"update"
. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls
-
getSaveOperationType
DefaultDSOperationType
to be performed whensaveData()
is called. This property is automatically set on a call toeditRecord()
oreditNewRecord()
, or may be set directly viasetSaveOperationType()
.If
saveOperationType
is unset, the form will heuristically determine whether an "add" or "update" operation is intended based on whether the primaryKey field is present and editable.- Returns:
- Returns the
DSOperationType
to be performed whensaveData()
orValuesManager.saveData()
is called.
Valid options are"add"
or"update"
.If a
DSRequest
configuration object is passed in containing an explicit operationType this will be returned. Otherwisethis.saveOperationType
will be returned if set. Note thatsaveOperationType
is automatically set via calls to data binding methods such aseditNewRecord()
, or it may beset explicitly
.If no explicit saveOperationType is present, the system will use the following heuristic to determine the save operationType:
- If the form has
no value for the
primaryKey field
this method will return "add". The assumption is that this is a new record, and the field will be populated when the record is created, (as with a "sequence" type field). - If,
when the form's values were populated
, the form had value for theprimaryKey field
but it has subsequently be changed, this method will return "add". In this case the value has been changed, either by the user or programmatically so a different (new) record is assumed. This is determined by looking at theoldValues
for the form. - If the
primaryKey field
is editable and a value is now present for the primary key field, but was not present in theoldValues
for the form, this method will return "add". In this case either no initial values were provided, or a 'sparse' set of values for a new record (with no primary key) were provided to the form and the user has subsequently explicitly entered a new primaryKey field value. - Otherwise this method will return "update". Either the primaryKey field is non editable, or the user has not changed it from its initial value.
- If the form has
no value for the
-
setSectionVisibilityMode
If the form has sections, [implemented asSectionItem
s], this attribute controls whether multiple sections can be expanded at once.- Parameters:
sectionVisibilityMode
- New sectionVisibilityMode value. Default value is "multiple"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getSectionVisibilityMode
If the form has sections, [implemented asSectionItem
s], this attribute controls whether multiple sections can be expanded at once.- Returns:
- Current sectionVisibilityMode value. Default value is "multiple"
- See Also:
-
setSelectOnClick
If this property is set to true, whenever a text-based field in this form (TextItem
,TextAreaItem
) is given focus - whether programmatically (seefocusInItem()
), or via a mouse click, all text within the item will be selected.If you only want the value to be selected when on programmatic focus or keyboard navigation (this is the native browser behavior), set
selectOnFocus
instead.May be overridden at the form item level via
FormItem.selectOnClick
.- Parameters:
selectOnClick
- New selectOnClick value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getSelectOnClick
If this property is set to true, whenever a text-based field in this form (TextItem
,TextAreaItem
) is given focus - whether programmatically (seefocusInItem()
), or via a mouse click, all text within the item will be selected.If you only want the value to be selected when on programmatic focus or keyboard navigation (this is the native browser behavior), set
selectOnFocus
instead.May be overridden at the form item level via
FormItem.selectOnClick
.- Returns:
- Current selectOnClick value. Default value is false
- See Also:
-
setSelectOnFocus
If this property is set to true, whenever a text-based field in this form (TextItem
,TextAreaItem
) is given focus programmatically (seefocusInItem()
), all text within the item will be selected.Note that this flag affects only programmatic focus. It's the normal behavior of text fields to select all text if the user navigates into them via keyboard, or if the user navigates via mouse, to place the text insertion point at the mouse click, and Smart GWT preserves these behaviors.
selectOnFocus
is only needed for cases like a form within a pop-up dialog that should have the first field selected.If you also want the value to be selected when the user clicks on the field, set
selectOnClick
instead.If
selectOnFocus
is false, the selection is not modified on focus - any previous selection within the item will be maintained.May be overridden at the form item level via
FormItem.selectOnFocus
.- Parameters:
selectOnFocus
- New selectOnFocus value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getSelectOnFocus
If this property is set to true, whenever a text-based field in this form (TextItem
,TextAreaItem
) is given focus programmatically (seefocusInItem()
), all text within the item will be selected.Note that this flag affects only programmatic focus. It's the normal behavior of text fields to select all text if the user navigates into them via keyboard, or if the user navigates via mouse, to place the text insertion point at the mouse click, and Smart GWT preserves these behaviors.
selectOnFocus
is only needed for cases like a form within a pop-up dialog that should have the first field selected.If you also want the value to be selected when the user clicks on the field, set
selectOnClick
instead.If
selectOnFocus
is false, the selection is not modified on focus - any previous selection within the item will be maintained.May be overridden at the form item level via
FormItem.selectOnFocus
.- Returns:
- Current selectOnFocus value. Default value is false
- See Also:
-
setShowComplexFieldsRecursively
public DynamicForm setShowComplexFieldsRecursively(Boolean showComplexFieldsRecursively) throws IllegalStateException If set, thisDynamicForm
will set bothshowComplexFields
andshowComplexFieldsRecursively
on any nested component used for showing/editing a complex field. Thus any of this form's items that handle complex fields will themselves also show complex fields. This allows for handling of field structures of any complexity.If set, this value automatically sets
showComplexFields
as well.- Parameters:
showComplexFieldsRecursively
- New showComplexFieldsRecursively value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getShowComplexFieldsRecursively
If set, thisDynamicForm
will set bothshowComplexFields
andshowComplexFieldsRecursively
on any nested component used for showing/editing a complex field. Thus any of this form's items that handle complex fields will themselves also show complex fields. This allows for handling of field structures of any complexity.If set, this value automatically sets
showComplexFields
as well.- Returns:
- Current showComplexFieldsRecursively value. Default value is null
-
setShowDeletions
DefaultFormItem.showDeletions
setting for items in this form.Note : This is an advanced setting
- Parameters:
showDeletions
- New showDeletions value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getShowDeletions
DefaultFormItem.showDeletions
setting for items in this form.- Returns:
- Current showDeletions value. Default value is null
-
setShowDetailFields
For databound forms, whether to show fields marked as detail fields.- Specified by:
setShowDetailFields
in interfaceDataBoundComponent
- Parameters:
showDetailFields
- New showDetailFields value. Default value is true- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getShowDetailFields
For databound forms, whether to show fields marked as detail fields.- Specified by:
getShowDetailFields
in interfaceDataBoundComponent
- Returns:
- Current showDetailFields value. Default value is true
-
setShowErrorIcons
showErrorIcons
,showErrorText
,errorOrientation
, andshowErrorStyle
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, setshowInlineErrors
:false.showErrorIcons
,showErrorText
,errorOrientation
andshowErrorStyle
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 respectsshowErrorIcons
andshowErrorText
as follows:showErrorIcons
, orshowErrorIcon
at the FormItem level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance is governed byFormItem.errorIconSrc
,FormItem.errorIconWidth
andFormItem.errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The attributeshowTitlesWithErrorMessages
may be set to prefix error messages with the form item's title +":"
(may be desired if the item hasFormItem.showTitle
set to false).
IfshowErrorText
is unset, the error text will be shown iflinearMode
is true (orlinearOnMobile
is true for mobile devices), otherwise it will not be shown.In addition to this:
errorOrientation
controls where the error HTML should appear relative to form items. Therefore the combination ofshowErrorText
:false
anderrorOrientation
:"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).
IferrorOrientation
is unset, the error orientation will default to "top" iflinearMode
is enabled (orlinearOnMobile
is true for mobile devices) and error text is not showing, "left" otherwise.showErrorStyle
determines whether fields with validation errors should have special styling applied to them. Error styling is achieved by applying suffixes to existing styling applied to various parts of the form item. SeeFormItemBaseStyle
for more on this.- Parameters:
showErrorIcons
- New showErrorIcons value. Default value is true- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getShowErrorIcons
showErrorIcons
,showErrorText
,errorOrientation
, andshowErrorStyle
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, setshowInlineErrors
:false.showErrorIcons
,showErrorText
,errorOrientation
andshowErrorStyle
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 respectsshowErrorIcons
andshowErrorText
as follows:showErrorIcons
, orshowErrorIcon
at the FormItem level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance is governed byFormItem.errorIconSrc
,FormItem.errorIconWidth
andFormItem.errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The attributeshowTitlesWithErrorMessages
may be set to prefix error messages with the form item's title +":"
(may be desired if the item hasFormItem.showTitle
set to false).
IfshowErrorText
is unset, the error text will be shown iflinearMode
is true (orlinearOnMobile
is true for mobile devices), otherwise it will not be shown.In addition to this:
errorOrientation
controls where the error HTML should appear relative to form items. Therefore the combination ofshowErrorText
:false
anderrorOrientation
:"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).
IferrorOrientation
is unset, the error orientation will default to "top" iflinearMode
is enabled (orlinearOnMobile
is true for mobile devices) and error text is not showing, "left" otherwise.showErrorStyle
determines whether fields with validation errors should have special styling applied to them. Error styling is achieved by applying suffixes to existing styling applied to various parts of the form item. SeeFormItemBaseStyle
for more on this.- Returns:
- Current showErrorIcons value. Default value is true
- See Also:
-
setShowErrorStyle
showErrorIcons
,showErrorText
,errorOrientation
, andshowErrorStyle
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, setshowInlineErrors
:false.showErrorIcons
,showErrorText
,errorOrientation
andshowErrorStyle
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 respectsshowErrorIcons
andshowErrorText
as follows:showErrorIcons
, orshowErrorIcon
at the FormItem level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance is governed byFormItem.errorIconSrc
,FormItem.errorIconWidth
andFormItem.errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The attributeshowTitlesWithErrorMessages
may be set to prefix error messages with the form item's title +":"
(may be desired if the item hasFormItem.showTitle
set to false).
IfshowErrorText
is unset, the error text will be shown iflinearMode
is true (orlinearOnMobile
is true for mobile devices), otherwise it will not be shown.In addition to this:
errorOrientation
controls where the error HTML should appear relative to form items. Therefore the combination ofshowErrorText
:false
anderrorOrientation
:"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).
IferrorOrientation
is unset, the error orientation will default to "top" iflinearMode
is enabled (orlinearOnMobile
is true for mobile devices) and error text is not showing, "left" otherwise.showErrorStyle
determines whether fields with validation errors should have special styling applied to them. Error styling is achieved by applying suffixes to existing styling applied to various parts of the form item. SeeFormItemBaseStyle
for more on this.- Parameters:
showErrorStyle
- New showErrorStyle value. Default value is true- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getShowErrorStyle
showErrorIcons
,showErrorText
,errorOrientation
, andshowErrorStyle
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, setshowInlineErrors
:false.showErrorIcons
,showErrorText
,errorOrientation
andshowErrorStyle
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 respectsshowErrorIcons
andshowErrorText
as follows:showErrorIcons
, orshowErrorIcon
at the FormItem level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance is governed byFormItem.errorIconSrc
,FormItem.errorIconWidth
andFormItem.errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The attributeshowTitlesWithErrorMessages
may be set to prefix error messages with the form item's title +":"
(may be desired if the item hasFormItem.showTitle
set to false).
IfshowErrorText
is unset, the error text will be shown iflinearMode
is true (orlinearOnMobile
is true for mobile devices), otherwise it will not be shown.In addition to this:
errorOrientation
controls where the error HTML should appear relative to form items. Therefore the combination ofshowErrorText
:false
anderrorOrientation
:"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).
IferrorOrientation
is unset, the error orientation will default to "top" iflinearMode
is enabled (orlinearOnMobile
is true for mobile devices) and error text is not showing, "left" otherwise.showErrorStyle
determines whether fields with validation errors should have special styling applied to them. Error styling is achieved by applying suffixes to existing styling applied to various parts of the form item. SeeFormItemBaseStyle
for more on this.- Returns:
- Current showErrorStyle value. Default value is true
- See Also:
-
setShowErrorText
showErrorIcons
,showErrorText
,errorOrientation
, andshowErrorStyle
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, setshowInlineErrors
:false.showErrorIcons
,showErrorText
,errorOrientation
andshowErrorStyle
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 respectsshowErrorIcons
andshowErrorText
as follows:showErrorIcons
, orshowErrorIcon
at the FormItem level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance is governed byFormItem.errorIconSrc
,FormItem.errorIconWidth
andFormItem.errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The attributeshowTitlesWithErrorMessages
may be set to prefix error messages with the form item's title +":"
(may be desired if the item hasFormItem.showTitle
set to false).
IfshowErrorText
is unset, the error text will be shown iflinearMode
is true (orlinearOnMobile
is true for mobile devices), otherwise it will not be shown.In addition to this:
errorOrientation
controls where the error HTML should appear relative to form items. Therefore the combination ofshowErrorText
:false
anderrorOrientation
:"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).
IferrorOrientation
is unset, the error orientation will default to "top" iflinearMode
is enabled (orlinearOnMobile
is true for mobile devices) and error text is not showing, "left" otherwise.showErrorStyle
determines whether fields with validation errors should have special styling applied to them. Error styling is achieved by applying suffixes to existing styling applied to various parts of the form item. SeeFormItemBaseStyle
for more on this.- Parameters:
showErrorText
- New showErrorText value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getShowErrorText
showErrorIcons
,showErrorText
,errorOrientation
, andshowErrorStyle
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, setshowInlineErrors
:false.showErrorIcons
,showErrorText
,errorOrientation
andshowErrorStyle
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 respectsshowErrorIcons
andshowErrorText
as follows:showErrorIcons
, orshowErrorIcon
at the FormItem level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance is governed byFormItem.errorIconSrc
,FormItem.errorIconWidth
andFormItem.errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The attributeshowTitlesWithErrorMessages
may be set to prefix error messages with the form item's title +":"
(may be desired if the item hasFormItem.showTitle
set to false).
IfshowErrorText
is unset, the error text will be shown iflinearMode
is true (orlinearOnMobile
is true for mobile devices), otherwise it will not be shown.In addition to this:
errorOrientation
controls where the error HTML should appear relative to form items. Therefore the combination ofshowErrorText
:false
anderrorOrientation
:"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).
IferrorOrientation
is unset, the error orientation will default to "top" iflinearMode
is enabled (orlinearOnMobile
is true for mobile devices) and error text is not showing, "left" otherwise.showErrorStyle
determines whether fields with validation errors should have special styling applied to them. Error styling is achieved by applying suffixes to existing styling applied to various parts of the form item. SeeFormItemBaseStyle
for more on this.- Returns:
- Current showErrorText value. Default value is false
- See Also:
-
setShowImageAsURL
For fields oftype:"image"
, if the field is non editable, and being displayed withreadOnlyDisplay:"static"
, should the value (URL) be displayed as text, or should an image be rendered?May be overridden for individual items via
FormItem.showImageAsURL
.- Parameters:
showImageAsURL
- New showImageAsURL value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls
-
getShowImageAsURL
public boolean getShowImageAsURL()For fields oftype:"image"
, if the field is non editable, and being displayed withreadOnlyDisplay:"static"
, should the value (URL) be displayed as text, or should an image be rendered?May be overridden for individual items via
FormItem.showImageAsURL
.- Returns:
- Current showImageAsURL value. Default value is false
-
setShowInlineErrors
If true, field errors are written into the form next to the item(s) where the errors occurred. Errors may appear as text or just an icon (viashowErrorText
:false).If false, errors are written at the top of the form.
To do some other kind of error display, override
showErrors()
.- Parameters:
showInlineErrors
- New showInlineErrors value. Default value is true- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getShowInlineErrors
If true, field errors are written into the form next to the item(s) where the errors occurred. Errors may appear as text or just an icon (viashowErrorText
:false).If false, errors are written at the top of the form.
To do some other kind of error display, override
showErrors()
.- Returns:
- Current showInlineErrors value. Default value is true
- See Also:
-
setShowOldValueInHover
Default setting for the form items'FormItem.showOldValueInHover
setting.Note : This is an advanced setting
- Parameters:
showOldValueInHover
- New showOldValueInHover value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls
-
getShowOldValueInHover
Default setting for the form items'FormItem.showOldValueInHover
setting.- Returns:
- Current showOldValueInHover value. Default value is null
-
setShowPending
This property applies to all of the items that a form has, and works according toFormItem.showPending
.Also, in a form with showPending:true, an individual
FormItem
can set showPending:false and vice versa.Note : This is an advanced setting
- Parameters:
showPending
- New showPending value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getShowPending
This property applies to all of the items that a form has, and works according toFormItem.showPending
.Also, in a form with showPending:true, an individual
FormItem
can set showPending:false and vice versa.- Returns:
- Current showPending value. Default value is null
-
setShowTitlesWithErrorMessages
Indicates whether on validation failure, the error message displayed to the user should be pre-pended with the title for the item.- Parameters:
showTitlesWithErrorMessages
- New showTitlesWithErrorMessages value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getShowTitlesWithErrorMessages
Indicates whether on validation failure, the error message displayed to the user should be pre-pended with the title for the item.- Returns:
- Current showTitlesWithErrorMessages value. Default value is false
- See Also:
-
setStopOnError
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.Enabling this property also implies
FormItem.validateOnExit
is automatically enabled. If there are server-based validators on this item, setting this property also implies thatFormItem.synchronousValidation
is forced on.- Parameters:
stopOnError
- New stopOnError value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
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.Enabling this property also implies
FormItem.validateOnExit
is automatically enabled. If there are server-based validators on this item, setting this property also implies thatFormItem.synchronousValidation
is forced on.- Returns:
- Current stopOnError value. Default value is null
-
setStoreDisplayValues
For editable fields with a specifiedFormItem.displayField
andFormItem.optionDataSource
, if the user selects a new value (typically from PickList based item such as a SelectItem), should the selected displayValue be updated on the record being edited in addition to the value for the actual item.
Note that this only applies for fields usinglocal display field values
- typicallyforeignKey fields
where the display field isincluded from
another dataSource.Default value is
true
. This is typically desirable for editing records with a displayField-mapped field, as it ensures the edited record will be be updated to contain the correct display value as well as the correct data value. As such, the expected display value is available on the record for display (for example in a ListGrid cell).It may not be desirable for an interface specifically intended for
gathering criteria
- in this case, results ought to be limited by an item's actual selected value, not by whatever text is displayed to the user.See
DataSourceField.displayField
for more details.Note: the modified display field value will be passed to the server along with the modified foreignKey field value if a
databound update operation
is performed. This occurs even if the displayField isincluded from another DataSource
and therefore read-only. In this case the server will simply ignore the modified display field value. This is as expected - a subsequent fetch for the same record would recalculate the displayField value on the server using the updated foreignKey field value (and return the same display value previously displayed to the user).This attribute can also be set for
individual items
.Note : This is an advanced setting
- Parameters:
storeDisplayValues
- New storeDisplayValues value. Default value is true- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getStoreDisplayValues
For editable fields with a specifiedFormItem.displayField
andFormItem.optionDataSource
, if the user selects a new value (typically from PickList based item such as a SelectItem), should the selected displayValue be updated on the record being edited in addition to the value for the actual item.
Note that this only applies for fields usinglocal display field values
- typicallyforeignKey fields
where the display field isincluded from
another dataSource.Default value is
true
. This is typically desirable for editing records with a displayField-mapped field, as it ensures the edited record will be be updated to contain the correct display value as well as the correct data value. As such, the expected display value is available on the record for display (for example in a ListGrid cell).It may not be desirable for an interface specifically intended for
gathering criteria
- in this case, results ought to be limited by an item's actual selected value, not by whatever text is displayed to the user.See
DataSourceField.displayField
for more details.Note: the modified display field value will be passed to the server along with the modified foreignKey field value if a
databound update operation
is performed. This occurs even if the displayField isincluded from another DataSource
and therefore read-only. In this case the server will simply ignore the modified display field value. This is as expected - a subsequent fetch for the same record would recalculate the displayField value on the server using the updated foreignKey field value (and return the same display value previously displayed to the user).This attribute can also be set for
individual items
.- Returns:
- Current storeDisplayValues value. Default value is true
-
setSuppressBrowserClearIcons
DefaultTextItem.suppressBrowserClearIcon
value for TextItems within this form.- Parameters:
suppressBrowserClearIcons
- New suppressBrowserClearIcons value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls
-
getSuppressBrowserClearIcons
public boolean getSuppressBrowserClearIcons()DefaultTextItem.suppressBrowserClearIcon
value for TextItems within this form.- Returns:
- Current suppressBrowserClearIcons value. Default value is false
-
setSuppressValidationErrorCallback
When callingsaveData()
on a form or valuesManager, by default if the server returns an error code, any callback passed into saveData() will not be fired. If the error code returned by the server indicates a validation error, it will be displayed to the user by updating the form items to show the error messages, and firing any specified hiddenValidationErrors handler, otherwise the standard RPCManager error handling logic would be invoked.Developers who want to handle errors themselves can override this default by specifying
dsRequest.willHandleError
on the DSRequest. In this case the callback passed in will be fired even if the server returns an error status code.If
suppressValidationErrorCallback
is set to true, if a save attempt returns a validation error code, the user-specified callback will not be fired even ifwillHandleError:true
was specified on the dsRequest - though for other error codes, the callback would be fired if willHandleError is specified on the request. Note that this is the historical behavior for SmartGWT builds 4.0 and earlierNote : This is an advanced setting
- Parameters:
suppressValidationErrorCallback
- New suppressValidationErrorCallback value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls
-
getSuppressValidationErrorCallback
When callingsaveData()
on a form or valuesManager, by default if the server returns an error code, any callback passed into saveData() will not be fired. If the error code returned by the server indicates a validation error, it will be displayed to the user by updating the form items to show the error messages, and firing any specified hiddenValidationErrors handler, otherwise the standard RPCManager error handling logic would be invoked.Developers who want to handle errors themselves can override this default by specifying
dsRequest.willHandleError
on the DSRequest. In this case the callback passed in will be fired even if the server returns an error status code.If
suppressValidationErrorCallback
is set to true, if a save attempt returns a validation error code, the user-specified callback will not be fired even ifwillHandleError:true
was specified on the dsRequest - though for other error codes, the callback would be fired if willHandleError is specified on the request. Note that this is the historical behavior for SmartGWT builds 4.0 and earlier- Returns:
- Current suppressValidationErrorCallback value. Default value is false
-
setSynchronousValidation
public DynamicForm setSynchronousValidation(Boolean synchronousValidation) throws IllegalStateException If enabled, whenever validation is triggered and a request to the server is required, user interactivity will be blocked until the request returns. Can be set for the entire form or individual FormItems.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.
- Parameters:
synchronousValidation
- New synchronousValidation value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getSynchronousValidation
If enabled, whenever validation is triggered and a request to the server is required, user interactivity will be blocked until the request returns. Can be set for the entire form or individual FormItems.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.
- Returns:
- Current synchronousValidation value. Default value is false
-
setTarget
The name of a window or frame that will receive the results returned by the form's action. The default null indicates to use the current frame.NOTE: this is used only in the very rare case that a form is used to submit data directly to a URL. Normal server contact is through
DataBound Component Methods
.
If this method is called after the component has been drawn/initialized: Sets thetarget
for this form.Note : This is an advanced setting
- Parameters:
target
- New submission target. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getTarget
The name of a window or frame that will receive the results returned by the form's action. The default null indicates to use the current frame.NOTE: this is used only in the very rare case that a form is used to submit data directly to a URL. Normal server contact is through
DataBound Component Methods
.- Returns:
- Current target value. Default value is null
- See Also:
-
setTimeFormatter
DefaultTimeDisplayFormat
fortype:"time"
field values displayed in this form.Note that if specified,
FormItem.dateFormatter
andFormItem.timeFormatter
take precedence over the format specified at the component level.If no explicit formatter is specified at the field or component level, time values will be formatted according to the system-wide String. specified field type.
- Parameters:
timeFormatter
- New timeFormatter value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls
-
getTimeFormatter
DefaultTimeDisplayFormat
fortype:"time"
field values displayed in this form.Note that if specified,
FormItem.dateFormatter
andFormItem.timeFormatter
take precedence over the format specified at the component level.If no explicit formatter is specified at the field or component level, time values will be formatted according to the system-wide String. specified field type.
- Returns:
- Current timeFormatter value. Default value is null
-
setTitleAlign
Default alignment for item titles. If unset default alignment will be derived fromtext direction
as described ingetTitleAlign()
- Parameters:
titleAlign
- New titleAlign value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls
-
getTitleAlign
Default alignment for item titles. If unset default alignment will be derived fromtext direction
as described ingetTitleAlign()
- Returns:
- Get the alignment for the title for some item. Default implementation is as follows:
- If
FormItem.titleAlign
is specified, it will be respected - If not, and
this.titleAlign
is set, it will be respected - Otherwise titles will be aligned according to
text direction
; fortitleOrientation
"top", this method returns"left"
if text direction is LTR, and"right"
if not; for horizontal orientations, this method returns"right"
if text direction is LTR, or"left"
if text direction is RTL.
- If
-
setTitleOrientation
Default orientation for titles for items in this form.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.
If this method is called after the component has been drawn/initialized: Modify this form'sTitleOrientation
at runtime- Parameters:
titleOrientation
- new default item titleOrientation. Default value is "left"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getTitleOrientation
Default orientation for titles for items in this form.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.- Returns:
- Return the orientation of the title for a specific item or the default title orientation if no item is passed. Default value is "left"
- See Also:
-
setTitlePrefix
The string pre-pended to the title of every item in this form. See also +{requiredTitlePrefix} for fields that are required.- Parameters:
titlePrefix
- New titlePrefix value. Default value is ""- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getTitlePrefix
The string pre-pended to the title of every item in this form. See also +{requiredTitlePrefix} for fields that are required.- Returns:
- Current titlePrefix value. Default value is ""
- See Also:
-
setTitleSuffix
The string appended to the title of every item in this form. See also +{requiredTitleSuffix} for fields that are required.- Parameters:
titleSuffix
- New titleSuffix value. Default value is " :"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getTitleSuffix
The string appended to the title of every item in this form. See also +{requiredTitleSuffix} for fields that are required.- Returns:
- Current titleSuffix value. Default value is " :"
- See Also:
-
setUnknownErrorMessage
The error message for a failed validator that does not specify its own errorMessage.- Parameters:
unknownErrorMessage
- New unknownErrorMessage value. Default value is "Invalid value"- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getUnknownErrorMessage
The error message for a failed validator that does not specify its own errorMessage.- Returns:
- Current unknownErrorMessage value. Default value is "Invalid value"
- See Also:
-
setUserTask
Associated userTask if current dynamic form used along with workflow. SeeuserTask
for more details.- Parameters:
userTask
- New userTask value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getUserTask
Associated userTask if current dynamic form used along with workflow. SeeuserTask
for more details.- Returns:
- Current userTask value. Default value is null
-
setValidateOnChange
If true, form fields will be validated when each item's "change" handler is fired as well as when the entire form is submitted or validated.Note that this property can also be set at the item level or on each validator to enable finer granularity validation in response to user interaction. 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.- Parameters:
validateOnChange
- New validateOnChange value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getValidateOnChange
If true, form fields will be validated when each item's "change" handler is fired as well as when the entire form is submitted or validated.Note that this property can also be set at the item level or on each validator to enable finer granularity validation in response to user interaction. 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.- Returns:
- Current validateOnChange value. Default value is false
- See Also:
-
setValidateOnExit
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.Note that this property can also be set at the item level to enable finer granularity validation in response to user interaction - if true at either level, validation will occur on editorExit.
- Parameters:
validateOnExit
- New validateOnExit value. Default value is false- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
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.Note that this property can also be set at the item level to enable finer granularity validation in response to user interaction - if true at either level, validation will occur on editorExit.
- Returns:
- Current validateOnExit value. Default value is false
- See Also:
-
setValidationURL
validationURL can be set to do server-side validation against a different URL from where the form will ultimately save, as part of an incremental upgrade strategy for Struts-like applications.If set, calling
submit()
causes an RPC to be sent to this URL to perform server-side validation of the form values. If the validation fails, the validation errors returned by the server are rendered in the form. If the validation succeeds, the form is submitted to the URL specified byaction
.The form values are available on the server as request parameters (just like a normal form submit) and also as the values of a DSRequest sent as an RPC alongside the normal submit.
The expected response to this request is a DSResponse sent via the RPC mechanism. If validation is successful, an empty response with the STATUS_SUCCESS status code is sufficient. If there are validation errors, the DSResponse should have the status set to STATUS_VALIDATION_ERROR and the errors should be set on the response via the addError()/setErrorReport() API on DSResponse. See the javadoc for DSResponse for details.
- Parameters:
validationURL
- New validationURL value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getValidationURL
validationURL can be set to do server-side validation against a different URL from where the form will ultimately save, as part of an incremental upgrade strategy for Struts-like applications.If set, calling
submit()
causes an RPC to be sent to this URL to perform server-side validation of the form values. If the validation fails, the validation errors returned by the server are rendered in the form. If the validation succeeds, the form is submitted to the URL specified byaction
.The form values are available on the server as request parameters (just like a normal form submit) and also as the values of a DSRequest sent as an RPC alongside the normal submit.
The expected response to this request is a DSResponse sent via the RPC mechanism. If validation is successful, an empty response with the STATUS_SUCCESS status code is sufficient. If there are validation errors, the DSResponse should have the status set to STATUS_VALIDATION_ERROR and the errors should be set on the response via the addError()/setErrorReport() API on DSResponse. See the javadoc for DSResponse for details.
- Returns:
- Current validationURL value. Default value is null
- See Also:
-
setValues
An Object containing the initial values of the form as properties, where each propertyName is the name of aform item
in the form, and each property value is the value held by that form item.The form's values may contain values that are not managed by any FormItem, and these values will be preserved and available when the form values are subsequently retrieved via
getValues()
.Providing values on initialization is equivalent to calling
setValues()
.As the user manipulates form items to change values, change events fire
on the items
andon the form as a whole
.Note that form values are logical values, for example, the value of a
DateItem
is a JavaScript Date object, not a String, even if the user enters the date via a text input. Likewise the value of aTextItem
orCheckboxItem
that started out null remains null until the user changes it; the value will not be automatically converted to the null string ("") or false respectively, as happens with native HTML elements.
If this method is called after the component has been drawn/initialized: Replaces the current values of the entire form with the values passed in.Note: when working with a form that is saving to a DataSource, you would typically call either
editRecord()
for an existing record, oreditNewRecord()
for a new record. In addition to setting the current values of the form, these APIs establish theDSRequest.operationType
used to save ("update" vs "add").Values should be provided as an Object containing the new values as properties, where each propertyName is the name of a
form item
in the form, and each property value is the value to apply to that form item viaFormItem.setValue()
.Values with no corresponding form item may also be passed, will be tracked by the form and returned by subsequent calls to
getValues()
.Any
FormItem
for which a value is not provided will revert to itsdefaultValue
. To cause all FormItems to revert to default values, pass null.This method also calls
rememberValues()
so that a subsequent later call toresetValues()
will revert to the passed values.- Parameters:
values
- values for the form, or null to reset all items to default values. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls
-
getValues
An Object containing the initial values of the form as properties, where each propertyName is the name of aform item
in the form, and each property value is the value held by that form item.The form's values may contain values that are not managed by any FormItem, and these values will be preserved and available when the form values are subsequently retrieved via
getValues()
.Providing values on initialization is equivalent to calling
setValues()
.As the user manipulates form items to change values, change events fire
on the items
andon the form as a whole
.Note that form values are logical values, for example, the value of a
DateItem
is a JavaScript Date object, not a String, even if the user enters the date via a text input. Likewise the value of aTextItem
orCheckboxItem
that started out null remains null until the user changes it; the value will not be automatically converted to the null string ("") or false respectively, as happens with native HTML elements.- Returns:
- An Object containing the values of the form as properties, where each propertyName is the name of a
form item
in the form, and each property value is the value held by that form item.Note that modifying the returned object is not a supported way of adding or modifying values. Instead use
setValue()
orsetValues()
. Default value is null
-
setWrapHintText
Should items within this form that are showing aFormItem.hint
have the hint text wrap? May be overridden at the item level viaFormItem.wrapHintText
. IfwrapHintText
is unset on both the form and item, then the default behavior is not wrapping the hint.This setting does not apply to hints that are
shown in field
.- Parameters:
wrapHintText
- New wrapHintText value. Default value is true- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getWrapHintText
Should items within this form that are showing aFormItem.hint
have the hint text wrap? May be overridden at the item level viaFormItem.wrapHintText
. IfwrapHintText
is unset on both the form and item, then the default behavior is not wrapping the hint.This setting does not apply to hints that are
shown in field
.- Returns:
- Current wrapHintText value. Default value is true
- See Also:
-
setWrapItemTitles
Whether titles for form items should wrap. If not specified, titles will wrap by default. Can be overridden for individual items viaFormItem.wrapTitle
- Parameters:
wrapItemTitles
- New wrapItemTitles value. Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- See Also:
-
getWrapItemTitles
Whether titles for form items should wrap. If not specified, titles will wrap by default. Can be overridden for individual items viaFormItem.wrapTitle
- Returns:
- Current wrapItemTitles value. Default value is null
- See Also:
-
assignItemsTabPositions
public void assignItemsTabPositions()This method is called automatically by the DynamicForm when the set of items changes and ensures that items show up in the correct tab order positions.Makes use of
sortItemsIntoTabOrder()
to order the items and ensures the items are ordered in theTabIndexManager
correctly. -
cancel
Deprecated.As of Smartclient version 13.0, due to the removal of Apache Struts.This method exists for clean integration with existing server frameworks that have a 'cancel' feature which typically clears session state associated with the form. When this method is called, an RPC is sent to the server. You must pass the appropriate params property in the request properties as required by your server framework.For example:
DSRequest requestProperties = new DSRequest(); Map params = new HashMap(); params.put("CANCEL", "cancel"); requestProperties.setParams(params);
Note that no other form data is sent. By default the current top-level page is replaced with the reply. If you wish to ignore the server reply instead, include the following request properties:DSRequest requestProperties = new DSRequest(); // other request property settings ... requestProperties.setIgnoreTimeout(true); requestProperties.setAttribute("target", null);
- Parameters:
requestProperties
- additional properties to set on the RPCRequest that will be issued- See Also:
-
cancelEditing
public void cancelEditing()If the form or valuesManager has associated userTask workflow task than notify it about cancelling the changes. -
checkForValidationErrors
Performs silent validation of the current form values, likevaluesAreValid()
. In contrast tovaluesAreValid()
, this method allows checking for server-side errors, and finding out what the errors are.The callback must be passed unless server-side validation is being skipped, and If passed, it always fires, errors or not, firing synchronously if server validation is skipped.
- Parameters:
callback
- callback to invoke after validation is complete- Returns:
- null if server-side validation is required, or no errors are present; otherwise, a Map of field names to the associated errors, for those fields that failed validation.
- See Also:
-
checkForValidationErrors
public Map checkForValidationErrors(ValidationStatusCallback callback, boolean validateHiddenFields) -
checkForValidationErrors
public Map checkForValidationErrors(ValidationStatusCallback callback, boolean validateHiddenFields, boolean skipServerValidation) Performs silent validation of the current form values, likevaluesAreValid()
. In contrast tovaluesAreValid()
, this method allows checking for server-side errors, and finding out what the errors are.The callback must be passed unless server-side validation is being skipped, and If passed, it always fires, errors or not, firing synchronously if server validation is skipped.
- Parameters:
callback
- callback to invoke after validation is completevalidateHiddenFields
- should validators be processed for non-visible fields such as dataSource fields with no associated item or fields with visibility set to"hidden"
skipServerValidation
- whether to skip doing server-side validation- Returns:
- null if server-side validation is required, or no errors are present; otherwise, a Map of field names to the associated errors, for those fields that failed validation.
- See Also:
-
clearErrors
public void clearErrors(boolean show) Clears all errors for this DynamicForm.- Parameters:
show
- If true, redraw the form to clear any visible error messages.- See Also:
-
clearFieldErrors
Clear any validation errors on the field passed in.- Parameters:
fieldName
- field to clear errors fromshow
- If true this method will fall through toshowFieldErrors()
to update the display- See Also:
-
clearValue
Clears the value for some field via a call toFormItem.clearValue()
if appropriate. If there is no item associated with the field name, the field will just be cleared within our stored set of values.- Parameters:
fieldName
- Name of the field being cleared. ADataPath
may be used for clearing details of nested data structures.
-
clearValues
public void clearValues()Reset to default form values and clear errors -
completeEditing
public void completeEditing()Finish editing and store edited values inprocess state
. -
editNewRecord
public void editNewRecord()Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified).
This method will also callsetSaveOperationType()
to ensure subsequent calls tosaveData()
will use anadd
rather than anupdate
operation.- See Also:
-
editNewRecord
Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified).
This method will also callsetSaveOperationType()
to ensure subsequent calls tosaveData()
will use anadd
rather than anupdate
operation.- Parameters:
initialValues
- initial set of values for the editor as a map of field names to their corresponding values- See Also:
-
editNewRecord
Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified).
This method will also callsetSaveOperationType()
to ensure subsequent calls tosaveData()
will use anadd
rather than anupdate
operation.- Parameters:
initialValues
- initial set of values for the editor as a map of field names to their corresponding values- See Also:
-
editRecord
Edit an existing record. Updates this editors values to match the values of the record passed in, viasetValues()
.This method will also call
setSaveOperationType()
to ensure subsequent calls tosaveData()
will use anupdate
rather than anadd
operation.- Parameters:
record
- the record to be edited as a map of field names to their corresponding values- See Also:
-
fetchRelatedData
Based on the relationship between the DataSource this component is bound to and the DataSource specified as the "schema" argument, call fetchData() to retrieve records in this data set that are related to the passed-in record.Relationships between DataSources are declared via
DataSourceField.foreignKey
.For example, given two related DataSources "orders" and "orderItems", where we want to fetch the "orderItems" that belong to a given "order". "orderItems" should declare a field that is a
foreignKey
to the "orders" table (for example, it might be named "orderId" with foreignKey="orders.id"). Then, to load the records related to a given "order", call fetchRelatedData() on the component bound to "orderItems", pass the "orders" DataSource as the "schema" and pass a record from the "orders" DataSource as the "record" argument.- Parameters:
record
- DataSource recordschema
- schema of the DataSource record, or DataBoundComponent already bound to that schema- See Also:
-
fetchRelatedData
-
fetchRelatedData
public void fetchRelatedData(ListGridRecord record, Canvas schema, DSCallback callback, DSRequest requestProperties) Based on the relationship between the DataSource this component is bound to and the DataSource specified as the "schema" argument, call fetchData() to retrieve records in this data set that are related to the passed-in record.Relationships between DataSources are declared via
DataSourceField.foreignKey
.For example, given two related DataSources "orders" and "orderItems", where we want to fetch the "orderItems" that belong to a given "order". "orderItems" should declare a field that is a
foreignKey
to the "orders" table (for example, it might be named "orderId" with foreignKey="orders.id"). Then, to load the records related to a given "order", call fetchRelatedData() on the component bound to "orderItems", pass the "orders" DataSource as the "schema" and pass a record from the "orders" DataSource as the "record" argument.- Parameters:
record
- DataSource recordschema
- schema of the DataSource record, or DataBoundComponent already bound to that schemacallback
- callback to invoke on completionrequestProperties
- additional properties to set on the DSRequest that will be issued- See Also:
-
fieldIsEditable
Can the field be edited? This method looks atcanEdit
for the grid as well as theFormItem.canEdit
value, to determine whether editing is actually allowed. For a detailed discussion, see the documentation atcanEdit
.- Parameters:
field
- field object or identifier- Returns:
- whether field can be edited
- See Also:
-
fieldIsEditable
public boolean fieldIsEditable(int field) Can the field be edited? This method looks atcanEdit
for the grid as well as theFormItem.canEdit
value, to determine whether editing is actually allowed. For a detailed discussion, see the documentation atcanEdit
.- Parameters:
field
- field object or identifier- Returns:
- whether field can be edited
- See Also:
-
fieldIsEditable
Can the field be edited? This method looks atcanEdit
for the grid as well as theFormItem.canEdit
value, to determine whether editing is actually allowed. For a detailed discussion, see the documentation atcanEdit
.- Parameters:
field
- field object or identifier- Returns:
- whether field can be edited
- See Also:
-
focus
public void focus()Give keyboard focus to this form. If this form has had focus before, focus will be passed to the item which last had focus (seegetFocusItem()
) - otherwise focus will be passed to the first focusable item in the form.To put focus in a specific item, use
focusInItem()
instead. -
addFormSubmitFailedHandler
Add a formSubmitFailed handler.Method called when an attempt to
natively submit
a form is unable to submit to the server. Default behavior is to display theDynamicForm.formSubmitFailedWarning
in a warning dialog. The most common cause for this failure is that the user has typed an invalid file-path into an upload type field.Note: This is very unlikely to occur with modern versions of IE, which don't allow the path of a file to be edited by hand (only selected via file navigation). It was last seen in IE6-7 under Windows XP.
Rather than throwing an exception on the client during submit(), normally all failures in native form submission are handled by the server. For further information, see
File Uploading
.- Specified by:
addFormSubmitFailedHandler
in interfaceHasFormSubmitFailedHandlers
- Parameters:
handler
- the formSubmitFailed handler- Returns:
HandlerRegistration
used to remove this handler
-
getEventItem
If the current mouse event occurred over an item in this dynamicForm, returns that item.- Returns:
- the current event target item
-
getFocusItem
Return the current focus item for this form.This is the item which either currently has focus, or if focus is not currently within this form, would be given focus on a call to
focus()
. May return null if this form has never had focus, in which case a call toform.focus()
would put focus into the first focusable item within the the form.Note that if focus is currently in a sub-item of a
DateItem
orRadioGroupItem
, this method will return the parent item, not the sub-item.- Returns:
- Current focus item within this form. May be null.
- See Also:
-
getValuesAsAdvancedCriteria
Return an AdvancedCriteria object based on the current set of values within this form.Similar to
getValuesAsCriteria()
, except the returned criteria object is guaranteed to be an AdvancedCriteria object, even if none of the form's fields has a specifiedFormItem.operator
- Returns:
- a
AdvancedCriteria
based on the form's current values - See Also:
-
getValuesAsAdvancedCriteria
Return an AdvancedCriteria object based on the current set of values within this form.Similar to
getValuesAsCriteria()
, except the returned criteria object is guaranteed to be an AdvancedCriteria object, even if none of the form's fields has a specifiedFormItem.operator
- Parameters:
textMatchStyle
- If specified the text match style will be used to generate the appropriateoperator
for per field criteria.- Returns:
- a
AdvancedCriteria
based on the form's current values - See Also:
-
addAsyncValidationReplyHandler
Add a asyncValidationReply handler.Notification fired when an asynchronous validation completes.
- Specified by:
addAsyncValidationReplyHandler
in interfaceHasAsyncValidationReplyHandlers
- Parameters:
handler
- the asyncValidationReply handler- Returns:
HandlerRegistration
used to remove this handler
-
addHiddenValidationErrorsHandler
Add a hiddenValidationErrors handler.Method to display validation error messages for fields that are not currently visible in this form.
This will be called when validation fails for
- a hidden field in this form
- if this form is databound, a datasource field with specified validators, for which we have no specified form item.
Implement this to provide custom validation error handling for these fields.
By default hidden validation errors will be logged as warnings in the developerConsole. CallHiddenValidationErrorsEvent.cancel()
from withinHiddenValidationErrorsHandler.onHiddenValidationErrors(com.smartgwt.client.widgets.form.events.HiddenValidationErrorsEvent)
from this method to suppress that behavior.- Specified by:
addHiddenValidationErrorsHandler
in interfaceHasHiddenValidationErrorsHandlers
- Parameters:
handler
- the hiddenValidationErrors handler- Returns:
HandlerRegistration
used to remove this handler
-
hasErrors
Returns whether there are currently any errors visible to the user for this form, without performing validation.Note that validation errors are set up automatically by validation (see
validate()
), or may be explicitly set viasetErrors()
orsetFieldErrors()
.- Returns:
- true if the form currently has validation errors.
- See Also:
-
hasFieldErrors
Returns whether there are currently any errors visible to the user for the specified field in this form, without performing any validation.Note that validation errors are set up automatically by validation (see
validate()
), or may be explicitly set viasetErrors()
orsetFieldErrors()
.- Parameters:
fieldName
- field to test for validation errors- Returns:
- true if the form has outstanding errors for the field in question.
- See Also:
-
hideItem
Hide a form item viaFormItem.hide()
- Parameters:
itemName
- Name of the item to show
-
isFocused
Returns true if this DynamicForm has the keyboard focus.Unlike standard canvases, for a DynamicForm this method will return true when keyboard focus is currently on one of the form's
items
.Note that in some cases the items of a form may be written directly into a different
canvas
. In this case the dynamicForm containing the items may not have been drawn on the page itself, but this method can still return true if one of the items has focus. -
isNewRecord
Returns true ifsaveOperationType
is currently "add". SeesaveOperationType
.- Returns:
- whether this form will use an "add" operation when saving
-
isPendingAsyncValidation
Is this component waiting for an asynchronous validation to complete? This method will return true aftervalidate()
is called on a component with server-side validators for some field(s), until the server responds.Note that the notification method
DynamicForm.asyncValidationReply()
will be fired when validation completes.- Returns:
- true if this widget has pending asynchronous validations in process
-
addItemChangeHandler
Add a itemChange handler.Handler fired when there is a change() event fired on a FormItem within this form.
Fires after the change() handler on the FormItem itself, and only if the item did not cancel the change event and chooses to allow it to propagate to the form as a whole.
- Specified by:
addItemChangeHandler
in interfaceHasItemChangeHandlers
- Parameters:
handler
- the itemChange handler- Returns:
HandlerRegistration
used to remove this handler
-
addItemChangedHandler
Add a itemChanged handler.Handler fired when there is a changed() event fired on a FormItem within this form.
Fires after the change() handler on the FormItem itself, and only if the item did not cancel the change event and chooses to allow it to propagate to the form as a whole.
- Specified by:
addItemChangedHandler
in interfaceHasItemChangedHandlers
- Parameters:
handler
- the itemChanged handler- Returns:
HandlerRegistration
used to remove this handler
-
addItemKeyPressHandler
Add a itemKeyPress handler.Handler fired when a FormItem within this form receives a keypress event.
Fires after the keyPress handler on the FormItem itself, and only if the item did not cancel the event and chooses to allow it to propagate to the form as a whole.
- Specified by:
addItemKeyPressHandler
in interfaceHasItemKeyPressHandlers
- Parameters:
handler
- the itemKeyPress handler- Returns:
HandlerRegistration
used to remove this handler
-
reset
public void reset()Resets values to the state it was the last timesetValues()
orrememberValues()
was called. If neither of those methods has been called, values will be set back to their initial values at init time. -
resetValues
public void resetValues()Same asreset()
. -
saveData
public void saveData()Validate and then save the form's current values to theDataSource
this form is bound to.If client-side validators are defined, they are executed first, and if any errors are found the save is aborted and the form will show the errors.
If client-side validation passes, a
DSRequest
will be sent, exactly as thoughDataSource.addData()
orDataSource.updateData()
had been called withthe form's values
as data. TheDSRequest.operationType
will be either "update" or "add", depending on the currentsaveOperationType
.On either a client-side or server-side validation failure, validation errors will be displayed in the form. Visible items within a DynamicForm will be redrawn to display errors. Validation failure occurring on hidden items, or DataSource fields with no associated form items may be handled via
DynamicForm.hiddenValidationErrors()
orValuesManager.hiddenValidationErrors()
.In the case of a validation error, the callback will not be called by default since the form has already handled the failed save by displaying the validation errors to the user. If you need to do something additional in this case, you can set
RPCRequest.willHandleError
via therequestProperties
parameter to force your callback to be invoked. However, first consider:- if you are trying to customize display of validation errors, there are several
built-in modes
andshowErrors()
may be a better place to put customizations. -
for unrecoverable general errors (eg server is down),
central error handling
in invoked, so consider placing customizations there unless an unrecoverable error should be handled specially by this specific form.
upload field
, have a chance to upload the file to the server.- See Also:
- if you are trying to customize display of validation errors, there are several
-
saveData
- See Also:
-
saveData
Validate and then save the form's current values to theDataSource
this form is bound to.If client-side validators are defined, they are executed first, and if any errors are found the save is aborted and the form will show the errors.
If client-side validation passes, a
DSRequest
will be sent, exactly as thoughDataSource.addData()
orDataSource.updateData()
had been called withthe form's values
as data. TheDSRequest.operationType
will be either "update" or "add", depending on the currentsaveOperationType
.On either a client-side or server-side validation failure, validation errors will be displayed in the form. Visible items within a DynamicForm will be redrawn to display errors. Validation failure occurring on hidden items, or DataSource fields with no associated form items may be handled via
DynamicForm.hiddenValidationErrors()
orValuesManager.hiddenValidationErrors()
.In the case of a validation error, the callback will not be called by default since the form has already handled the failed save by displaying the validation errors to the user. If you need to do something additional in this case, you can set
RPCRequest.willHandleError
via therequestProperties
parameter to force your callback to be invoked. However, first consider:- if you are trying to customize display of validation errors, there are several
built-in modes
andshowErrors()
may be a better place to put customizations. -
for unrecoverable general errors (eg server is down),
central error handling
in invoked, so consider placing customizations there unless an unrecoverable error should be handled specially by this specific form.
upload field
, have a chance to upload the file to the server.- Parameters:
callback
- callback to invoke on completionrequestProperties
- additional properties to set on the DSRequest that will be issued- See Also:
- if you are trying to customize display of validation errors, there are several
-
setValue
Sets the value for some field- Parameters:
fieldName
- Name of the field being updated. ADataPath
may be passed to set nested valuesvalue
- New value.
-
setValuesAsCriteria
This method will display the specified criteria in this form for editing. The criteria parameter may be a simpleCriterion
object or anAdvancedCriteria
object.For simple criteria, the specified fieldName will be used to apply criteria to form items, as with a standard setValues() call.
For AdvancedCriteria, behavior is as follows:
- If the top level operator doesn't match the
operator
for this form, the entire criteria will be nested in an outer advanced criteria object with the appropriate operator. - Each criterion within AdvancedCriteria will
be applied to a form item if
FormItem.shouldSaveValue
is true for the item andFormItem.canEditCriterion()
returns true for the criterion in question. By default this method checks for a match with both thefieldName
andoperator
of the criterion. The criterion is actually passed to the item for editing via theFormItemCriterionSetter
'ssetCriterion()
method. Note that these methods may be overridden for custom handling. Also note that the defaultFormItemCriterionSetter.setCriterion()
implementation used byCanvasItem
handles editing nested criteria via embedded dynamicForms. - Criteria which don't map to any form item will be stored directly on the form and recombined
with the edited values from each item when
getValuesAsCriteria()
is called.
- Parameters:
criteria
- criteria to edit.- See Also:
- If the top level operator doesn't match the
-
showFieldErrors
If this form has any outstanding validation errors for the field passed in, show them now. Called when field errors are set directly viasetFieldErrors()
/addFieldErrors()
/clearFieldErrors()
.
Default implementation simply falls through toshowErrors()
.- Parameters:
fieldName
- field to show errors for- See Also:
-
showItem
Show a form item viaFormItem.show()
- Parameters:
itemName
- Name of the item to show
-
showItemContextMenu
Called when the mouse is right-clicked in some formItem. If the implementation returns false, default browser behavior is cancelled.Note that it can be bad practice to cancel this method if the mouse is over the data element of an item, because doing so would replace the builtin browser-default menus that users may expect. You can use
getEventItemInfo()
to return an info object that can be used to determine which part of the item is under the mouse.- Parameters:
item
- the form item showing its context menu- Returns:
- return false to cancel default behavior
-
sortItemsIntoTabOrder
Helper method to take our specified items and sort them into their desired tab sequenceDefault behavior will respect explicitly specified tab index as a local tab index, otherwise just use specified order within the items array
- Returns:
- Returns an array containing our items in the desired tab sequence.
-
submit
public void submit()submit()
is automatically called when aSubmitItem
included in the form is clicked, or, ifsaveOnEnter
is set, when the "Enter" key is pressed in a text input. Submit can also be manually called.If this form is part of a
ValuesManager
, this method will simply fall through to the submit method on the valuesManager. If not, andform.submitValues()
exists, it will be called, and no further action will be taken.Otherwise, default behavior varies based on
form.canSubmit
: ifcanSubmit
is false,saveData()
will be called to handle saving via Smart GWT databinding.If
canSubmit
is true, the form will be submitted like an ordinary HTML form viasubmitForm()
.The parameters to
submit()
apply only ifsubmit()
will be callingsaveData()
. If you overridesubmit()
, you can safely ignore the parameters as Smart GWT framework code does not pass them.- See Also:
-
submit
- See Also:
-
submit
submit()
is automatically called when aSubmitItem
included in the form is clicked, or, ifsaveOnEnter
is set, when the "Enter" key is pressed in a text input. Submit can also be manually called.If this form is part of a
ValuesManager
, this method will simply fall through to the submit method on the valuesManager. If not, andform.submitValues()
exists, it will be called, and no further action will be taken.Otherwise, default behavior varies based on
form.canSubmit
: ifcanSubmit
is false,saveData()
will be called to handle saving via Smart GWT databinding.If
canSubmit
is true, the form will be submitted like an ordinary HTML form viasubmitForm()
.The parameters to
submit()
apply only ifsubmit()
will be callingsaveData()
. If you overridesubmit()
, you can safely ignore the parameters as Smart GWT framework code does not pass them.- Parameters:
callback
- callback to invoke on completion. [Ignored if this.canSubmit is true]requestProperties
- additional properties to set on the DSRequest that will be issued [Ignored if this.canSubmit is true]- See Also:
-
submitForm
public void submitForm()Submits the form to the URL defined byaction
, identically to how a plain HTML <form> element would submit data, as either an HTTP GET or POST as specified bymethod
.Notes:
- this is used only in
the very rare case that a form is used to submit data directly to a URL. Normal server contact is through
DataBound Component Methods
. - For this method to reliably
include values for every field in the grid,
canSubmit
must be set totrue
- To submit values for fields that do not have an editor, use
HiddenItem
with aFormItem.defaultValue
set. This is analogous to <input type="hidden"> in HTML forms.
- See Also:
- this is used only in
the very rare case that a form is used to submit data directly to a URL. Normal server contact is through
-
addSubmitValuesHandler
Add a submitValues handler.Triggered when a SubmitItem is included in the form is submitted and gets pressed.
- Specified by:
addSubmitValuesHandler
in interfaceHasSubmitValuesHandlers
- Parameters:
handler
- the submitValues handler- Returns:
HandlerRegistration
used to remove this handler
-
titleClipped
Is the title for the given form item clipped? The form item must have title clipping enabled.- Parameters:
item
- the form item.- Returns:
- true if the title is clipped; false otherwise.
- See Also:
-
validate
public boolean validate()Validates the form without submitting it, and redraws the form to display error messages if there are any validation errors. Returns true if validation succeeds, or false if validation fails.For databound forms, any
DataSource
field validators will be run even if there is no associated item in the form. Validators will also be run on hidden form items. In both these cases, validation failure can be handled viaDynamicForm.hiddenValidationErrors()
.If this form has any fields which require server-side validation (see
Validator.serverCondition
) this will also be initialized. Such validation will occur asynchronously. Developers can useisPendingAsyncValidation()
andDynamicForm.asyncValidationReply()
to detect and respond to asynchronous validation.Note that for silent validation,
valuesAreValid()
(client-side) andcheckForValidationErrors()
(client and server-side) can be used instead.- Returns:
- true if validation succeeds, or false if validation fails.
- See Also:
-
validate
public boolean validate(boolean validateHiddenFields) Validates the form without submitting it, and redraws the form to display error messages if there are any validation errors. Returns true if validation succeeds, or false if validation fails.For databound forms, any
DataSource
field validators will be run even if there is no associated item in the form. Validators will also be run on hidden form items. In both these cases, validation failure can be handled viaDynamicForm.hiddenValidationErrors()
.If this form has any fields which require server-side validation (see
Validator.serverCondition
) this will also be initialized. Such validation will occur asynchronously. Developers can useisPendingAsyncValidation()
andDynamicForm.asyncValidationReply()
to detect and respond to asynchronous validation.Note that for silent validation,
valuesAreValid()
(client-side) andcheckForValidationErrors()
(client and server-side) can be used instead.- Parameters:
validateHiddenFields
- Should validators be processed for non-visible fields such as dataSource fields with no associated item or fields with visibility set to"hidden"
?- Returns:
- true if validation succeeds, or false if validation fails.
- See Also:
-
validateData
-
validateData
validateData()
can be used to check for errors in server-side validators without showing such errors to the user. Errors, if any, can be discovered by looking at theDSResponse
object returned in the callback.validateData()
will first callvalidate()
to check for client-side errors, and will returnfalse
without contacting the server if errors are present. In this case, any errors detected client-side will be displayed; to avoid this and purely perform silent, server-side validation, you can useDataSource.validateData()
with the form'scurrent values
.valuesAreValid()
can be used in lieu of a call tovalidate()
if silent checking of client-side errors is also desired.- Parameters:
callback
- callback to invoke on completionrequestProperties
- additional properties to set on the DSRequest that will be issued- Returns:
- true if the server will be contacted, false otherwise
- See Also:
-
valuesAreValid
public boolean valuesAreValid(boolean validateHiddenFields) Method to determine whether the current form values would pass validation. This method operates client-side, without contacting the server, running validators on the form's values and returning a value indicating whether validation was successful.Unlike
validate()
this method will not store the errors on the DynamicForm or display them to the user.Note that
checkForValidationErrors()
allows for checking for server-side errors, and finding out what those errors are via a callback.- Parameters:
validateHiddenFields
- Should validators be processed for non-visible fields such as dataSource fields with no associated item or fields with visibility set to"hidden"
?- Returns:
- Boolean value indicating validation success, or if
returnErrors
was specified, a map of field names to the associated errors, for those fields that failed validation, or null if validation succeeded. - See Also:
-
addValuesChangedHandler
Add a valuesChanged handler.Handler fired when the entire set of values is replaced, as by a call to
DynamicForm.setValues()
,DynamicForm.resetValues()
orDynamicForm.editRecord()
.Note that it is invalid to call such methods from this handler because doing so would result in an infinite loop.
- Specified by:
addValuesChangedHandler
in interfaceHasValuesChangedHandlers
- Parameters:
handler
- the valuesChanged handler- Returns:
HandlerRegistration
used to remove this handler
-
valuesHaveChanged
Compares the current set of values with the values stored by the call to therememberValues()
method.rememberValues()
runs when the form is initialized and on every call tosetValues()
. Returns true if the values have changed, and false otherwise.- Returns:
- true if current values do not match remembered values
- See Also:
-
viewSelectedData
Displays the currently selected record(s) of the selectionComponent widget (typically a listGrid) in this component.For a DynamicForm the first record of the selection is shown after the form is placed into
read-only mode
. A subsequent call toeditRecord()
or similar will return the form to editability.Note that since field-level
canEdit:true
settings override the form-level canEdit setting the automatic change to read-only may not change every field. -
viewSelectedData
Displays the currently selected record(s) of the selectionComponent widget (typically a listGrid) in this component.For a DynamicForm the first record of the selection is shown after the form is placed into
read-only mode
. A subsequent call toeditRecord()
or similar will return the form to editability.Note that since field-level
canEdit:true
settings override the form-level canEdit setting the automatic change to read-only may not change every field. -
viewSelectedData
Displays the currently selected record(s) of the selectionComponent widget (typically a listGrid) in this component.For a DynamicForm the first record of the selection is shown after the form is placed into
read-only mode
. A subsequent call toeditRecord()
or similar will return the form to editability.Note that since field-level
canEdit:true
settings override the form-level canEdit setting the automatic change to read-only may not change every field. -
setDefaultProperties
Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties set on the SmartGWT class instance passed to this function before its underlying SmartClient JS object was created. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.
- Parameters:
dynamicFormProperties
- properties that should be used as new defaults when instances of this class are created- See Also:
-
onInit
protected void onInit() -
onInit_DynamicForm
protected void onInit_DynamicForm() -
showErrors
public void showErrors()If this form has any outstanding validation errors, show them now.

 This method is called when the set of errors are changed bysetErrors(java.util.Map, boolean)
or
validate()
.

 Default implementation will redraw the form to display error messages and call
com.smartgwt.client.widgets.form.DynamicForm#handleHiddenValidationErrors
to
 display errors with no visible field.
Note: This is an override point.
 This method may be overridden to perform custom display of validation errors.
-
setValuesManager
Adds this DynamicForm as a member of the specified valuesManager. After init, this method is functionally equivalent tovaluesManager.addMember(form)
andvaluesManager.removeMember(form)
Note : This is an advanced setting
- Overrides:
setValuesManager
in classCanvas
- Parameters:
valuesManager
- valuesManager Default value is null- Returns:
DynamicForm
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getValuesManager
Return the ValuesManager for this form.- Overrides:
getValuesManager
in classCanvas
- Returns:
- the ValuesManager
-
setCellSpacing
Deprecated.usesetCellPadding(int)
insteadSet the cellSpacing.- Parameters:
cellSpacing
- the cellSpacing- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getCellSpacing
public int getCellSpacing()Deprecated.usegetCellPadding()
insteadReturn the cellSpacing.- Returns:
- the cellSpacing
-
setUseAllDataSourceFields
public void setUseAllDataSourceFields(boolean useAllDataSourceFields) If true, the set of fields given by the "default binding" (see DataBoundComponent.fields) is used, with any fields specified in component.fields acting as overrides that can suppress or modify the display of individual fields, without having to list the entire set of fields that should be shown. If component.fields contains fields that are not found in the DataSource, they will be shown after the most recently referred to DataSource field. If the new fields appear first, they will be shown first.- Parameters:
useAllDataSourceFields
- useAllDataSourceFields
-
getChangedValues
Returns all values within this DynamicForm that have changed sinceDynamicForm.rememberValues
last ran. Note thatDynamicForm.rememberValues
runs on dynamicForm initialization, and with every call toDynamicForm.setValues
so this will typically contain all values the user has explicitly edited since then.- Returns:
- the values
-
getOldValues
Returns the set of values last stored byDynamicForm.rememberValues
. Note thatrememberValues()
is called automatically byDynamicForm.setValues
, and on form initialization, so this typically contains all values as they were before the user edited them.- Returns:
- the values
-
setValue
Set the value for some field.- Parameters:
fieldName
- Name of the field being updatedvalue
- New value.
-
setValue
Set the value for some field.- Parameters:
fieldName
- Name of the field being updatedvalue
- New value.
-
setValue
Set the value for some field.- Parameters:
fieldName
- Name of the field being updatedvalue
- New value.
-
setValue
Set the value for some field.- Parameters:
fieldName
- Name of the field being updatedvalue
- New value.
-
setValue
Set the value for some field.- Parameters:
fieldName
- Name of the field being updatedvalue
- New value.
-
setValue
Set the value for some field.- Parameters:
fieldName
- Name of the field being updatedvalue
- New value.
-
setValue
Set the value for some field.- Parameters:
fieldName
- Name of the field being updatedvalue
- New value.
-
setValue
Set the value for some field.- Parameters:
fieldName
- Name of the field being updatedvalue
- New value.
-
setValue
Set the value for some field.- Parameters:
fieldName
- Name of the field being updatedvalue
- New value.
-
setValue
Set the value for some field.- Parameters:
fieldName
- Name of the field being updatedvalue
- New value.
-
setValue
Set the value for some field.- Parameters:
fieldName
- Name of the field being updatedvalue
- New value.
-
setValue
Set the value for some field.- Parameters:
fieldName
- Name of the field being updatedvalue
- New value.
-
setItems
- Parameters:
items
- the items
-
setFields
An array of field objects, specifying the order, layout, and types of each field in the DynamicForm. When bothfields
anddataSource
are set,fields
acts as a set of overrides as explained in DataBoundComponent fields. See Form Layout for information about how flags specified on the FormItems control how the form is laid out.- Parameters:
fields
- form item fields
-
getFields
Return the form fields.If the DynamicForm has not been
created in JavaScript
, this method will force it to be created. This is required to ensure that if the form has a specifieddataSource
, fields from the datasource are combined with fields specified explicitly on the component. It also ensures that if fields were specified explicitly as JavaScriptObjects usingsetFields()
, the returned FormItems will be of the correct subclass.To retrieve the form fields as specified without forcing creation in JavaScript, use
getFields(false)
- Returns:
- the form fields
-
getFields
Return the form fields. Passing a forceCreation parameter offalse
to this method will avoidcreating
the DynamicForm in in JavaScript if this has not yet happened.If you've installed the fields as JavaScriptObjects using
setFields()
, it's not recommended to call this method or otherwise try to access the fields asFormItem
s before the DynamicForm has beencreated
, as this may result in the incorrect subclass of FormItem being built. Instead, usegetFieldsAsJavaScriptObjects()
.If the situation is unavoidable, you can set the "editorType" attribute of the JavaScriptObject field to the desired subclass to ensure it will be used.
Also, prior to creation any fields derived from a
dataSource
will not be returned from this method.- Parameters:
forceCreation
- controls whether the DynamicForm should be created if this has not already happened- Returns:
- the form fields
-
getItem
Retrieve a FormItem in this form byname
ordataPath
. This method will always create its parent form in JavaScript.- Parameters:
name
-- Returns:
-
getField
Retrieve a field from this form byname
.If the DynamicForm has not been
created in JavaScript
, this method will force it to be created. This is required to ensure that if the form has a specifieddataSource
, fields from the datasource are combined with fields specified explicitly on the component. It also ensures that if fields were specified explicitly as JavaScriptObjects usingsetFields()
, the returned FormItem will be of the correct subclass.To retrieve a form field as specified without forcing creation in JavaScript, use
getField(fieldName, false)
- Parameters:
name
- name of the field to return- Returns:
- FormItem with the appropriate name
-
getField
Retrieve a field from this form byname
.Passing a forceCreation parameter of
false
to this method will avoidcreating
the DynamicForm in in JavaScript if this has not yet happened.See
getFields(Boolean)
for considerations about retrieving fields before a DynamicForm has been created in JavaScript- Parameters:
name
- name of the field to returnforceCreation
- controls whether the DynamicForm should be created if this has not already happened- Returns:
- FormItem with the appropriate name
-
getValueAsString
-
getValue
-
getEventItemInfo
If the current mouse event occurred over an item, or the title of an item in this dynamicForm, return details about where the event occurred.- Parameters:
fieldName
- the field name- Returns:
- the form item event info
-
editSelectedData
Edit the record selected in the specified ListGrid.
Updates the values of this editor to match the selected record's values.
If this form has a dataSource, then saving viasaveData()
will use the "update" operation type.- Parameters:
selectionComponent
- the List Grid whose currently selected record(s) is/are to be edited- See Also:
-
editSelectedData
Edit the record selected in the specified ListGrid.
Updates the values of this editor to match the selected record's values.
If this form has a dataSource, then saving viasaveData()
will use the "update" operation type.- Parameters:
listGridID
- the List Grid ID whose currently selected record(s) is/are to be edited- See Also:
-
getValuesAsCriteria
Return search criteria based on the current set of values within this form. For simple criteria, each form item simply maps its value to it's fieldName.
See FormItem.getCriterion() for details on how form items generate advanced criteria. Note that any values or criteria specified via DynamicForm.setValues() or DynamicForm.setValuesAsCriteria() which do not correspond to an item within the form will be combined with the live item values when criteria are generated.
The returned criteria object can be used to filter data via methods such as ListGrid.fetchData(), DataSource.fetchData(), or, for more advanced usage, ResultSet.setCriteria().
Note that any form field which the user has left blank is omitted as criteria, that is, a blank field is assumed to mean "allow any value for this field" and not "this field must be blank". Examples of empty values include a blank text field or SelectItem with an empty selection.- Returns:
- the criteria
-
getValuesAsRecord
Return the current set of values within this form as a Record.- Returns:
- a Record object containing the form's current values
-
setColWidths
An array of widths for the columns of items in this form's layout grid.If specified, these widths should sum to the total width of the form (form.width). If not specified, we assume every other column will contain form item titles, and so should have
form.titleWidth
, and all other columns should share the remaining space.Acceptable values for each element in the array are:
- A number (e.g. 100) representing the number of pixel widths to allocate to a column.
- A percent (e.g. 20%) representing the percentage of the total form.width to allocate to a column.
- "*" (all) to allocate remaining width (form.width minus all specified column widths). Multiple columns can use "*", in which case remaining width is divided between all columns marked
- Parameters:
colWidths
- the column widths
-
getSaveOperationType
DefaultDSOperationType
to be performed whenDynamicForm.saveData
is called. This property is automatically set on a call toDynamicForm.editRecord
orDynamicForm.editNewRecord
, or may be set directly viaDynamicForm.setSaveOperationType
.If
saveOperationType
is unset, the form will heuristically determine whether an "add" or "update" operation is intended based on whether the primaryKey field is present and editable.- Parameters:
requestProperties
- Optional DSRequest config properties for the save operation- Returns:
- Returns the
DSOperationType
to be performed whenDynamicForm.saveData
is called. Valid options are"add"
or"update"
.If a
DSRequest
configuration object is passed in containing an explicit operationType this will be returned. OtherwisesaveOperationType
will be returned.
-
setTitleWidth
public void setTitleWidth(int titleWidth) The width in pixels allocated to the title of every item in this form. If you don't specify explicitcolWidths
, you can set this value to the string "*" to divide the usable space evenly between titles and fields.- Parameters:
titleWidth
- the title width
-
setTitleWidth
The width in pixels allocated to the title of every item in this form. If you don't specify explicitcolWidths
, you can set this value to the string "*" to divide the usable space evenly between titles and fields.- Parameters:
titleWidth
- the title width
-
setErrorOrientation
If DynamicForm.showInlineErrors is true, where should the error icon and text appear relative to form items? Valid options are "top", "bottom", "left" or "right".May be overridden at the item level via
FormItem.setErrorOrientation(com.smartgwt.client.types.FormErrorOrientation)
.- Parameters:
errorOrientation
- the error orientation
-
focusInItem
public void focusInItem(int itemNumber) Move the keyboard focus into a particular item.- Parameters:
itemNumber
- the item number
-
focusInItem
Move the keyboard focus into a particular item.- Parameters:
itemName
- the item name
-
focusInItem
Move the keyboard focus into a particular item.- Parameters:
formItem
- the form item
-
setErrors
Setter for validation errors on this form. Errors passed in should be a Map in the format {fieldName1:errors, fieldName2:errors} Where the errors value may be either a string (single error message) or an array of strings (if multiple errors should be applied to the field in question).- Parameters:
errors
- list of errors as a map with the field names as keysshowErrors
- If true redraw form to display errors now. Otherwise errors can be displayed by callingshowErrors()
Note: When the errors are shown, handleHiddenValidationErrors() will be fired for errors on hidden fields, or with no associated formItem.
-
getErrors
Returns the set of errors.- Returns:
- errors. key is field name, value is error. Returns null if no errors are present
-
setFieldErrors
Set field validation error for some field. The showErrors parameter allows the errors to be displayed immediately. Alternatively, an explicit call toshowFieldErrors(java.lang.String)
will display the errors for this field.- Parameters:
fieldName
- field to apply the new errors toerror
- error to apply to the field in questionshowErrors
- If true this method will fall through to DynamicForm.showFieldErrors() to update the display
-
setFieldErrors
Set field validation errors for some field. The showErrors parameter allows the errors to be displayed immediately. Alternatively, an explicit call toshowFieldErrors(java.lang.String)
will display the errors for this field.- Parameters:
fieldName
- field to apply the new errors toerrors
- errors to apply to the field in questionshowErrors
- If true this method will fall through to DynamicForm.showFieldErrors() to update the display
-
getFieldErrors
Returns any validation errors for some field in this valuesManager. If no errors are present, will return null.- Parameters:
fieldName
- the field name- Returns:
- error messages for the field.
-
rememberValues
Make a snapshot of the current set of values, so we can reset to them later. Creates a new object, then adds all non-method properties of values to the new object. Use resetValues() to revert to these values. Note that this method is automatically called when the values for this form are set programmatically via a call to DynamicForm.setValues().- Returns:
- copy of current form values
-
setItemHoverFormatter
The FormItemHoverFormatter should return the HTML to display in a hover canvas when the user holds the mousepointer over this item. Return null to suppress the hover canvas altogether.- Parameters:
hoverFormatter
- the hover formatter
-
setItemTitleHoverFormatter
TheFormItemHoverFormatter
should return the HTML to display in a hover canvas when the user holds the mousepointer over an item's title and the title is clipped. Return null to suppress the hover canvas altogether.- Parameters:
hoverFormatter
- the hover formatter- See Also:
-
setItemValueHoverFormatter
TheFormItemHoverFormatter
should return the HTML to display in a hover canvas when the user holds the mousepointer over an item's value and the value is clipped. Return null to suppress the hover canvas altogether.- Parameters:
hoverFormatter
- the hover formatter- See Also:
-
setDataSource
Bind to a DataSource.Binding to a DataSource means that the component will use the DataSource to provide default data for its fields.
When binding to a new DataSource, if the component has any existing "fields" or has a dataset, these will be discarded by default, since it is assumed the new DataSource may represent a completely unrelated set of objects. If the old "fields" are still relevant, pass them to setDataSource().
- Parameters:
dataSource
-fields
-
-
setSkipConversionOnMapping
Call this method passing true to skip conversion of the Javascript object to a Java Map when calling the mapDisplayToValue() API. By default, we do convert the value, and your methods will be returned a Java Map of native Java types. Passing true to this method switches off conversion, and your methods will be passed a JavaScriptObject- Parameters:
convert
- Whether the mapDisplayTovalue() method should skip conversion of its return value to a native Java Map
-
getSkipConversionOnMapping
Returns true if the system is set to skip conversion of the Javascript object to a Java Map when calling the mapDisplayToValue() API. SeesetSkipConversionOnMapping(java.lang.Boolean)
- Returns:
- Boolean indicating whether the mapDisplayTovalue() method will skip conversion of its return value to a native Java Map
-
setDataPageSize
Description copied from interface:DataBoundComponent
When usingdata paging
, how many records to fetch at a time. If set to a positive integer,dataPageSize
will override the defaultresultSize
for ResultSets automatically created when you callfetchData()
(and similarly for theresultSize
of ResultTrees). The default of 0 means to just use the default page size of the data container.Note that regardless of the
dataPageSize
setting, a component will always fetch all of data that it needs to draw. Settings such asshowAllRecords:true
,drawAllMaxCells
anddrawAheadRatio
can cause more rows than the configureddataPageSize
to be fetched.- Specified by:
setDataPageSize
in interfaceDataBoundComponent
- Parameters:
dataPageSize
- dataPageSize Default value is 0- Returns:
DataBoundComponent
instance, for chaining setter calls- See Also:
-
getDataPageSize
public int getDataPageSize()Description copied from interface:DataBoundComponent
When usingdata paging
, how many records to fetch at a time. If set to a positive integer,dataPageSize
will override the defaultresultSize
for ResultSets automatically created when you callfetchData()
(and similarly for theresultSize
of ResultTrees). The default of 0 means to just use the default page size of the data container.Note that regardless of the
dataPageSize
setting, a component will always fetch all of data that it needs to draw. Settings such asshowAllRecords:true
,drawAllMaxCells
anddrawAheadRatio
can cause more rows than the configureddataPageSize
to be fetched.- Specified by:
getDataPageSize
in interfaceDataBoundComponent
- Returns:
- int
- See Also:
-
setUseAllDataSourceFields
Description copied from interface:DataBoundComponent
If true, the set of fields given by the "default binding" (see 
fields
) is used, with any fields specified in
component.fields
acting as overrides that can suppress or modify the
 display of individual fields, without having to list the entire set of fields that
 should be shown.

 If
component.fields
contains fields that are not found in the DataSource,
 they will be shown after the most recently referred to DataSource field. If the new
 fields appear first, they will be shown first.- Specified by:
setUseAllDataSourceFields
in interfaceDataBoundComponent
- Parameters:
useAllDataSourceFields
- useAllDataSourceFields Default value is false- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getUseAllDataSourceFields
Description copied from interface:DataBoundComponent
If true, the set of fields given by the "default binding" (see 
fields
) is used, with any fields specified in
component.fields
acting as overrides that can suppress or modify the
 display of individual fields, without having to list the entire set of fields that
 should be shown.

 If
component.fields
contains fields that are not found in the DataSource,
 they will be shown after the most recently referred to DataSource field. If the new
 fields appear first, they will be shown first.- Specified by:
getUseAllDataSourceFields
in interfaceDataBoundComponent
- Returns:
- Boolean
-
setSparseFieldState
Description copied from interface:DataBoundComponent
If true,ListGrid.getFieldState()
andListGrid.setFieldState(java.lang.String)
will omit state information for hidden fields by default.- Specified by:
setSparseFieldState
in interfaceDataBoundComponent
- Parameters:
sparseFieldState
- sparseFieldState Default value is false- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getSparseFieldState
Description copied from interface:DataBoundComponent
If true,ListGrid.getFieldState()
andListGrid.setFieldState(java.lang.String)
will omit state information for hidden fields by default.- Specified by:
getSparseFieldState
in interfaceDataBoundComponent
- Returns:
- Boolean
-
setShowHiddenFields
Description copied from interface:DataBoundComponent
Whether to show fields markedhidden:true
when a DataBoundComponent is given a
 DataSource but nocomponent.fields
.

 The
hidden
property is used on DataSource fields to mark fields that are
 never of meaning to an end user.- Specified by:
setShowHiddenFields
in interfaceDataBoundComponent
- Parameters:
showHiddenFields
- showHiddenFields Default value is false- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getShowHiddenFields
Description copied from interface:DataBoundComponent
Whether to show fields markedhidden:true
when a DataBoundComponent is given a
 DataSource but nocomponent.fields
.

 The
hidden
property is used on DataSource fields to mark fields that are
 never of meaning to an end user.- Specified by:
getShowHiddenFields
in interfaceDataBoundComponent
- Returns:
- Boolean
-
setShowComplexFields
Description copied from interface:DataBoundComponent
Whether to show fields of non-atomic types when a DataBoundComponent is given a
 DataSource but nocomponent.fields
.

 If true, the component will show fields that declare a complex type, for example, a
 field 'shippingAddress' that declares type 'Address', where 'Address' is the ID of a
 DataSource that declares the fields of a shipping address (city, street name, etc).


 Such fields may need custom formatters or editors in order to create a usable interface,
 for example, an Address field in a ListGrid might use a custom formatter to combine the
 relevant fields of an address into one column, and might use a pop-up dialog for
 editing.
Note : This is an advanced setting
- Specified by:
setShowComplexFields
in interfaceDataBoundComponent
- Parameters:
showComplexFields
- showComplexFields Default value is true- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getShowComplexFields
Description copied from interface:DataBoundComponent
Whether to show fields of non-atomic types when a DataBoundComponent is given a
 DataSource but nocomponent.fields
.

 If true, the component will show fields that declare a complex type, for example, a
 field 'shippingAddress' that declares type 'Address', where 'Address' is the ID of a
 DataSource that declares the fields of a shipping address (city, street name, etc).


 Such fields may need custom formatters or editors in order to create a usable interface,
 for example, an Address field in a ListGrid might use a custom formatter to combine the
 relevant fields of an address into one column, and might use a pop-up dialog for
 editing.
- Specified by:
getShowComplexFields
in interfaceDataBoundComponent
- Returns:
- Boolean
-
setFetchOperation
Description copied from interface:DataBoundComponent
Operation ID this component should use when performing fetch operations.- Specified by:
setFetchOperation
in interfaceDataBoundComponent
- Parameters:
fetchOperation
- fetchOperation Default value is null- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getFetchOperation
Description copied from interface:DataBoundComponent
Operation ID this component should use when performing fetch operations.- Specified by:
getFetchOperation
in interfaceDataBoundComponent
- Returns:
- String
-
setUpdateOperation
Description copied from interface:DataBoundComponent
operationId
this component should use when performing update operations.- Specified by:
setUpdateOperation
in interfaceDataBoundComponent
- Parameters:
updateOperation
- Default value is null- Returns:
DataBoundComponent
instance, for chaining setter calls- See Also:
-
getUpdateOperation
Description copied from interface:DataBoundComponent
operationId
this component should use when performing update operations.- Specified by:
getUpdateOperation
in interfaceDataBoundComponent
- Returns:
- String
- See Also:
-
setAddOperation
Description copied from interface:DataBoundComponent
operationId
this component should use when performing add operations.- Specified by:
setAddOperation
in interfaceDataBoundComponent
- Parameters:
addOperation
- Default value is null- Returns:
DataBoundComponent
instance, for chaining setter calls- See Also:
-
getAddOperation
Description copied from interface:DataBoundComponent
operationId
this component should use when performing add operations.- Specified by:
getAddOperation
in interfaceDataBoundComponent
- Returns:
- String
- See Also:
-
setRemoveOperation
Description copied from interface:DataBoundComponent
operationId
this component should use when performing remove operations.- Specified by:
setRemoveOperation
in interfaceDataBoundComponent
- Parameters:
removeOperation
- Default value is null- Returns:
DataBoundComponent
instance, for chaining setter calls- See Also:
-
getRemoveOperation
Description copied from interface:DataBoundComponent
operationId
this component should use when performing remove operations.- Specified by:
getRemoveOperation
in interfaceDataBoundComponent
- Returns:
- String
- See Also:
-
setExportFields
Description copied from interface:DataBoundComponent
The list of field-names to export. If provided, the field-list in the exported output is 
 limited and sorted as per the list.

 If exportFields is not provided, the exported output includes all visible fields 
 from this component, sorted as they appear.
- Specified by:
setExportFields
in interfaceDataBoundComponent
- Parameters:
exportFields
- exportFields Default value is null- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getExportFields
Description copied from interface:DataBoundComponent
The list of field-names to export. If provided, the field-list in the exported output is 
 limited and sorted as per the list.

 If exportFields is not provided, the exported output includes all visible fields 
 from this component, sorted as they appear.
- Specified by:
getExportFields
in interfaceDataBoundComponent
- Returns:
- the list of field-names to export.
-
setExportAll
Description copied from interface:DataBoundComponent
Setting exportAll to true prevents the component from passing its list of fields to the 
 export call. The result is the export of all visible fields fromfields
.

 If exportAll is false, an export operation will first consider 

exportFields
, if it's set, and fall back on all visible fields from
fields
otherwise.- Specified by:
setExportAll
in interfaceDataBoundComponent
- Parameters:
exportAll
- exportAll Default value is false- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getExportAll
Description copied from interface:DataBoundComponent
Setting exportAll to true prevents the component from passing its list of fields to the 
 export call. The result is the export of all visible fields fromfields
.

 If exportAll is false, an export operation will first consider 

exportFields
, if it's set, and fall back on all visible fields from
fields
otherwise.- Specified by:
getExportAll
in interfaceDataBoundComponent
- Returns:
- Boolean
-
setExportIncludeSummaries
Description copied from interface:DataBoundComponent
If Summary rows exist for this component, whether to include them when exporting client data. Defaults to true if not set- Specified by:
setExportIncludeSummaries
in interfaceDataBoundComponent
- Parameters:
exportIncludeSummaries
- exportIncludeSummaries Default value is true- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getExportIncludeSummaries
Description copied from interface:DataBoundComponent
If Summary rows exist for this component, whether to include them when exporting client data. Defaults to true if not set- Specified by:
getExportIncludeSummaries
in interfaceDataBoundComponent
- Returns:
- Boolean
-
setPreventDuplicates
Description copied from interface:DataBoundComponent
If set, detect and prevent duplicate records from being transferred to this component, either via
 drag and drop or viaDataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent)
. When a duplicate transfer is detected,
 a dialog will appear showing theduplicateDragMessage
.

 If the component either does not have a
DataSource
or has a DataSource with no
primaryKey
declared, duplicate checking is off by
 default. If duplicate checking is enabled, it looks for an existing record in the dataset
 that has all of the properties of the dragged record, and considers that a duplicate.

 For
DragDataAction
:"copy" where the target DataSource is related to the source
 DataSource by foreignKey, a duplicate means that the target list, as filtered by the current
 criteria, already has a record whose value for the foreignKey field matches the
 primaryKey of the record being transferred.

 For example, consider dragging "employees" to "teams", where "teams" has a field
 "teams.employeeId" which is a foreignKey pointing to "employees.id", and the target
 grid has search criteria causing it to show all the members of one team. A duplicate -
 adding an employee to the same team twice - is when the target grid's dataset contains an
 record with "employeeId" matching the "id" field of the dropped employee.
- Specified by:
setPreventDuplicates
in interfaceDataBoundComponent
- Parameters:
preventDuplicates
- preventDuplicates Default value is null- Returns:
DataBoundComponent
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getPreventDuplicates
Description copied from interface:DataBoundComponent
If set, detect and prevent duplicate records from being transferred to this component, either via
 drag and drop or viaDataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent)
. When a duplicate transfer is detected,
 a dialog will appear showing theduplicateDragMessage
.

 If the component either does not have a
DataSource
or has a DataSource with no
primaryKey
declared, duplicate checking is off by
 default. If duplicate checking is enabled, it looks for an existing record in the dataset
 that has all of the properties of the dragged record, and considers that a duplicate.

 For
DragDataAction
:"copy" where the target DataSource is related to the source
 DataSource by foreignKey, a duplicate means that the target list, as filtered by the current
 criteria, already has a record whose value for the foreignKey field matches the
 primaryKey of the record being transferred.

 For example, consider dragging "employees" to "teams", where "teams" has a field
 "teams.employeeId" which is a foreignKey pointing to "employees.id", and the target
 grid has search criteria causing it to show all the members of one team. A duplicate -
 adding an employee to the same team twice - is when the target grid's dataset contains an
 record with "employeeId" matching the "id" field of the dropped employee.
- Specified by:
getPreventDuplicates
in interfaceDataBoundComponent
- Returns:
- Boolean
-
setDuplicateDragMessage
public DynamicForm setDuplicateDragMessage(String duplicateDragMessage) throws IllegalStateException Description copied from interface:DataBoundComponent
Message to show when a user attempts to transfer duplicate records into this component, and
preventDuplicates
is enabled. If set to null, duplicates will not be reported and the dragged duplicates will not be saved.- Specified by:
setDuplicateDragMessage
in interfaceDataBoundComponent
- Parameters:
duplicateDragMessage
- duplicateDragMessage Default value is "Duplicates not allowed"- Returns:
DataBoundComponent
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getDuplicateDragMessage
Description copied from interface:DataBoundComponent
Message to show when a user attempts to transfer duplicate records into this component, and
preventDuplicates
is enabled. If set to null, duplicates will not be reported and the dragged duplicates will not be saved.- Specified by:
getDuplicateDragMessage
in interfaceDataBoundComponent
- Returns:
- String
-
setAddDropValues
Description copied from interface:DataBoundComponent
Indicates whether to add "drop values" to items dropped on this component, if both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key. "Drop values" are properties of the dropped item that you wish to change (and persist) as a result of the item being dropped on this grid.If this value is true and this component is databound,
DataBoundComponent.getDropValues()
will be called for every databound item dropped on this grid, and an update performed on the item- Specified by:
setAddDropValues
in interfaceDataBoundComponent
- Parameters:
addDropValues
- addDropValues Default value is true- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getAddDropValues
Description copied from interface:DataBoundComponent
Indicates whether to add "drop values" to items dropped on this component, if both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key. "Drop values" are properties of the dropped item that you wish to change (and persist) as a result of the item being dropped on this grid.If this value is true and this component is databound,
DataBoundComponent.getDropValues()
will be called for every databound item dropped on this grid, and an update performed on the item- Specified by:
getAddDropValues
in interfaceDataBoundComponent
- Returns:
- Boolean
-
setDropValues
Description copied from interface:DataBoundComponent
When an item is dropped on this component, andaddDropValues
is true and both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key, this object provides the "drop values" that Smart GWT will apply to the dropped object before updating it.If this property is not defined, Smart GWT defaults to returning the selection criteria currently in place for this component. Thus, any databound items (for example, rows from other grids bound to the same DataSource) dropped on the grid will, by default, be subjected to an update that makes them conform to the grid's current filter criteria.
Note : This is an advanced setting
- Specified by:
setDropValues
in interfaceDataBoundComponent
- Parameters:
dropValues
- dropValues Default value is null- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getDropValues
Description copied from interface:DataBoundComponent
When an item is dropped on this component, andaddDropValues
is true and both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key, this object provides the "drop values" that Smart GWT will apply to the dropped object before updating it.If this property is not defined, Smart GWT defaults to returning the selection criteria currently in place for this component. Thus, any databound items (for example, rows from other grids bound to the same DataSource) dropped on the grid will, by default, be subjected to an update that makes them conform to the grid's current filter criteria.
Note : This is an advanced setting
- Specified by:
getDropValues
in interfaceDataBoundComponent
- Returns:
- Returns the "drop values" to apply to a record dropped on this component prior to update. Only
 applicable to databound components - see
dropValues
for more details. If multiple records 
 are being dropped, this method is called for each of them in turn.

 This method returns the following:

- 

- Nothing, if
addDropValues
is false 
 - dropValues, if that property is set. If the component's criteria object is applicable (as explained
 in the next item), it is merged into dropValues, with properties in dropValues taking precedence. 

- The component's criteria object, if the most recent textMatchStyle for the component was "exact" 
 and it is simple criteria (ie, not an AdvancedCriteria object) 

- Otherwise nothing 


 You can override this method if you need more complex setting of drop values than can be 
 provided by simply supplying a dropValues object.
 

- Nothing, if
-
setProgressiveLoading
Indicates whether or not this component will load its dataprogressively
- Parameters:
progressiveLoading
-- Returns:
DataBoundComponent
instance, for chaining setter calls- See Also:
-
getProgressiveLoading
Indicates whether or not this component will load its dataprogressively
- Returns:
- See Also:
-
setUseFlatFields
Description copied from interface:DataBoundComponent
TheuseFlatFields
flag causes all simple type fields anywhere in a nested
 set of DataSources to be exposed as a flat list for form binding. 


useFlatFields
is typically used with imported metadata, such as 
XMLTools.loadXMLSchema(java.lang.String, com.smartgwt.client.data.XSDLoadCallback)
from a 
XMLTools.loadWSDL(java.lang.String, com.smartgwt.client.data.WSDLLoadCallback)
, as a means of eliminating levels of XML
 nesting that aren't meaningful in a user interface, without the cumbersome and fragile
 process of mapping form fields to XML structures.

 For example, having called
WebService.getInputDS(java.lang.String)
to retrieve the input message
 schema for a web service operation whose input message looks like this:

 <FindServices>
 <searchFor>search text</searchFor>
 <Options>
 <caseSensitive>false</caseSensitive>
 </Options>
 <IncludeInSearch>
 <serviceName>true</serviceName>
 <documentation>true</documentation>
 <keywords>true</keywords>
 </IncludeInSearch>
 </FindServices>


 SettinguseFlatFields
on aDynamicForm
that is bound to this input
 message schema would result in 5FormItem
reflecting the 5 simple type
 fields in the message.

 For this form, the result of
getValues()
might look
 like:


{
 searchFor: "search text",
 caseSensitive: false,
 serviceName: true,
 documentation : true,
 keywords : true
 }

 When contacting aWebService
, these values can be automatically
 mapped to the structure of the input message for a web service operation by setting
 {@link com.smartgwt.client..WSRequest#getUseFlatFields useFlatFields} (for use withWebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback)
) or by setting
useFlatFields
(for use with aDataSource
that is
'bound to a WSDL web service'
via
wsOperation
). 

 Using these two facilities in conjunction (component.useFlatFields and
 request.useFlatFields) allows gratuitous nesting to be consistently bypassed in both the user
 presentation and when providing the data for XML messages.


 You can also set
useFlatFields
to automatically enable 
 "flattened" XML serialization (request.useFlatFields) for all DataSource requests of a
 particular operationType.

 Note that
useFlatFields
is not generally recommended for use with structures
 where multiple simple type fields exist with the same name, however if used with such a
 structure, the first field to use a given name wins. "first" means the first field
 encountered in a depth first search. "wins" means only the first field will be present as a
 field when data binding.- Specified by:
setUseFlatFields
in interfaceDataBoundComponent
- Parameters:
useFlatFields
- useFlatFields Default value is null- Returns:
DataBoundComponent
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getUseFlatFields
Description copied from interface:DataBoundComponent
TheuseFlatFields
flag causes all simple type fields anywhere in a nested
 set of DataSources to be exposed as a flat list for form binding. 


useFlatFields
is typically used with imported metadata, such as 
XMLTools.loadXMLSchema(java.lang.String, com.smartgwt.client.data.XSDLoadCallback)
from a 
XMLTools.loadWSDL(java.lang.String, com.smartgwt.client.data.WSDLLoadCallback)
, as a means of eliminating levels of XML
 nesting that aren't meaningful in a user interface, without the cumbersome and fragile
 process of mapping form fields to XML structures.

 For example, having called
WebService.getInputDS(java.lang.String)
to retrieve the input message
 schema for a web service operation whose input message looks like this:

 <FindServices>
 <searchFor>search text</searchFor>
 <Options>
 <caseSensitive>false</caseSensitive>
 </Options>
 <IncludeInSearch>
 <serviceName>true</serviceName>
 <documentation>true</documentation>
 <keywords>true</keywords>
 </IncludeInSearch>
 </FindServices>


 SettinguseFlatFields
on aDynamicForm
that is bound to this input
 message schema would result in 5FormItem
reflecting the 5 simple type
 fields in the message.

 For this form, the result of
getValues()
might look
 like:


{
 searchFor: "search text",
 caseSensitive: false,
 serviceName: true,
 documentation : true,
 keywords : true
 }

 When contacting aWebService
, these values can be automatically
 mapped to the structure of the input message for a web service operation by setting
 {@link com.smartgwt.client..WSRequest#getUseFlatFields useFlatFields} (for use withWebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback)
) or by setting
useFlatFields
(for use with aDataSource
that is
'bound to a WSDL web service'
via
wsOperation
). 

 Using these two facilities in conjunction (component.useFlatFields and
 request.useFlatFields) allows gratuitous nesting to be consistently bypassed in both the user
 presentation and when providing the data for XML messages.


 You can also set
useFlatFields
to automatically enable 
 "flattened" XML serialization (request.useFlatFields) for all DataSource requests of a
 particular operationType.

 Note that
useFlatFields
is not generally recommended for use with structures
 where multiple simple type fields exist with the same name, however if used with such a
 structure, the first field to use a given name wins. "first" means the first field
 encountered in a depth first search. "wins" means only the first field will be present as a
 field when data binding.- Specified by:
getUseFlatFields
in interfaceDataBoundComponent
- Returns:
- Boolean
-
setHiliteProperty
Description copied from interface:DataBoundComponent
Marker that can be set on a record to flag that record as hilited. Should be set to a value
 that matches {@link com.smartgwt.client..Hilite#getId id} for a hilite defined on this component.- Specified by:
setHiliteProperty
in interfaceDataBoundComponent
- Parameters:
hiliteProperty
- hiliteProperty Default value is "_hilite"- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getHiliteProperty
Description copied from interface:DataBoundComponent
Marker that can be set on a record to flag that record as hilited. Should be set to a value
 that matches {@link com.smartgwt.client..Hilite#getId id} for a hilite defined on this component.- Specified by:
getHiliteProperty
in interfaceDataBoundComponent
- Returns:
- String
-
editFields
public void editFields()Shows a FieldPicker interface allowing end-users to rearrange the order and visibiility of the fields in the associated DataBoundComponent. -
editHilites
public void editHilites()Description copied from interface:DataBoundComponent
Shows a HiliteEditor interface allowing end-users to edit the data-hilites currently in use by this DataBoundComponent.- Specified by:
editHilites
in interfaceDataBoundComponent
-
getHiliteState
Description copied from interface:DataBoundComponent
Get the current hilites encoded as a String, for saving.- Specified by:
getHiliteState
in interfaceDataBoundComponent
- Returns:
- the hilite state
-
setHiliteState
Description copied from interface:DataBoundComponent
Set the current hilites based on a hiliteState String previously returned from getHilitesState.- Specified by:
setHiliteState
in interfaceDataBoundComponent
- Parameters:
hiliteState
- hilites state encoded as a String- Returns:
DataBoundComponent
instance, for chaining setter calls
-
setHilites
Description copied from interface:DataBoundComponent
Accepts an array of hilite objects and applies them to this DataBoundComponent. See alsogetHilites
for a method of retrieving the hilite array for storage, including hilites manually added by the user.NOTE: This is only supported on
ListGrid
for now.- Specified by:
setHilites
in interfaceDataBoundComponent
- Parameters:
hilites
- array of hilite objects- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getHilites
Description copied from interface:DataBoundComponent
Return the set of hilite-objects currently applied to this DataBoundComponent. These can be saved for storage and then restored to a component later via setHilites().- Specified by:
getHilites
in interfaceDataBoundComponent
- Returns:
- array of hilite objects
-
setDragDataAction
Description copied from interface:DataBoundComponent
Indicates what to do with data dragged into another DataBoundComponent. See
 DragDataAction type for details.- Specified by:
setDragDataAction
in interfaceDataBoundComponent
- Parameters:
dragDataAction
- dragDataAction Default value is Canvas.MOVE- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getDragDataAction
Description copied from interface:DataBoundComponent
Indicates what to do with data dragged into another DataBoundComponent. See
 DragDataAction type for details.- Specified by:
getDragDataAction
in interfaceDataBoundComponent
- Returns:
- DragDataAction
-
setDragTrackerStyle
Description copied from interface:DataBoundComponent
CSS Style to apply to the drag tracker when dragging occurs on this component.- Specified by:
setDragTrackerStyle
in interfaceDataBoundComponent
- Parameters:
dragTrackerStyle
- dragTrackerStyle Default value is "gridDragTracker"- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getDragTrackerStyle
Description copied from interface:DataBoundComponent
CSS Style to apply to the drag tracker when dragging occurs on this component.- Specified by:
getDragTrackerStyle
in interfaceDataBoundComponent
- Returns:
- String
-
setCanAddFormulaFields
Description copied from interface:DataBoundComponent
Adds an item to the header context menu allowing users to launch a dialog to define a new
 field based on values present in other fields, using the {@link com.smartgwt.client..FormulaBuilder}.

 User-added formula fields can be persisted via
ListGrid.getFieldState()
and 
ListGrid.setFieldState(java.lang.String)
.- Specified by:
setCanAddFormulaFields
in interfaceDataBoundComponent
- Parameters:
canAddFormulaFields
- canAddFormulaFields Default value is false- Returns:
DataBoundComponent
instance, for chaining setter calls
-
addSummaryField
public void addSummaryField()Description copied from interface:DataBoundComponent
Convenience method to display a {@link com.smartgwt.client..SummaryBuilder} to create a new Summary Field. This 
 is equivalent to callingDataBoundComponentGen#editSummaryField
with 
 no parameter.

- Specified by:
addSummaryField
in interfaceDataBoundComponent
-
addFormulaField
public void addFormulaField()Description copied from interface:DataBoundComponent
Convenience method to display a {@link com.smartgwt.client..FormulaBuilder} to create a new Formula Field. This 
 is equivalent to callingDataBoundComponentGen#editFormulaField
with 
 no parameter.

- Specified by:
addFormulaField
in interfaceDataBoundComponent
-
getCanAddFormulaFields
Description copied from interface:DataBoundComponent
Adds an item to the header context menu allowing users to launch a dialog to define a new
 field based on values present in other fields, using the {@link com.smartgwt.client..FormulaBuilder}.

 User-added formula fields can be persisted via
ListGrid.getFieldState()
and 
ListGrid.setFieldState(java.lang.String)
.- Specified by:
getCanAddFormulaFields
in interfaceDataBoundComponent
- Returns:
- Boolean
-
setAddFormulaFieldText
Description copied from interface:DataBoundComponent
Text for a menu item allowing users to add a formula field- Specified by:
setAddFormulaFieldText
in interfaceDataBoundComponent
- Parameters:
addFormulaFieldText
- addFormulaFieldText Default value is "Add formula column..."- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getAddFormulaFieldText
Description copied from interface:DataBoundComponent
Text for a menu item allowing users to add a formula field- Specified by:
getAddFormulaFieldText
in interfaceDataBoundComponent
- Returns:
- String
-
setEditFormulaFieldText
Description copied from interface:DataBoundComponent
Text for a menu item allowing users to edit a formula field- Specified by:
setEditFormulaFieldText
in interfaceDataBoundComponent
- Parameters:
editFormulaFieldText
- editFormulaFieldText Default value is "Edit formula..."- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getEditFormulaFieldText
Description copied from interface:DataBoundComponent
Text for a menu item allowing users to edit a formula field- Specified by:
getEditFormulaFieldText
in interfaceDataBoundComponent
- Returns:
- String
-
setCanAddSummaryFields
Description copied from interface:DataBoundComponent
Adds an item to the header context menu allowing users to launch a dialog to define a new
 text field that can contain both user-defined text and the formatted values present in other 
 fields, using the {@link com.smartgwt.client..SummaryBuilder}.

 User-added summary fields can be persisted via
ListGrid.getFieldState()
and 
ListGrid.setFieldState(java.lang.String)
.- Specified by:
setCanAddSummaryFields
in interfaceDataBoundComponent
- Parameters:
canAddSummaryFields
- canAddSummaryFields Default value is false- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getCanAddSummaryFields
Description copied from interface:DataBoundComponent
Adds an item to the header context menu allowing users to launch a dialog to define a new
 text field that can contain both user-defined text and the formatted values present in other 
 fields, using the {@link com.smartgwt.client..SummaryBuilder}.

 User-added summary fields can be persisted via
ListGrid.getFieldState()
and 
ListGrid.setFieldState(java.lang.String)
.- Specified by:
getCanAddSummaryFields
in interfaceDataBoundComponent
- Returns:
- Boolean
-
setAddSummaryFieldText
Description copied from interface:DataBoundComponent
Text for a menu item allowing users to add a formula field- Specified by:
setAddSummaryFieldText
in interfaceDataBoundComponent
- Parameters:
addSummaryFieldText
- addSummaryFieldText Default value is "Add summary column..."- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getAddSummaryFieldText
Description copied from interface:DataBoundComponent
Text for a menu item allowing users to add a formula field- Specified by:
getAddSummaryFieldText
in interfaceDataBoundComponent
- Returns:
- String
-
setEditSummaryFieldText
Description copied from interface:DataBoundComponent
Text for a menu item allowing users to edit the formatter for a field- Specified by:
setEditSummaryFieldText
in interfaceDataBoundComponent
- Parameters:
editSummaryFieldText
- editSummaryFieldText Default value is "Edit summary format..."- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getEditSummaryFieldText
Description copied from interface:DataBoundComponent
Text for a menu item allowing users to edit the formatter for a field- Specified by:
getEditSummaryFieldText
in interfaceDataBoundComponent
- Returns:
- String
-
setSavedSearchId
Description copied from interface:DataBoundComponent
Optional identifier for saved searches that should be applied to this component.By default
SavedSearches
are associated with a component via itslocal ID
andDataSource ID
. This property allows developers to override this behavior and explicitly associate a component with a set of saved searches. This can provide a couple of benefits:
Firstly this ensures that saved searches will be unambiguously associated with the particular component even if the page changes such that a stored minimal locator would no longer applied to the component, without requiring an explicitCanvas.ID
.
Secondly this allows the same set of saved searches to be applied to more than one component on a page. This may be valueable for cases where the same information from the same dataSource is presented to users in multiple places.Note: This is an advanced setting.
- Specified by:
setSavedSearchId
in interfaceDataBoundComponent
- Parameters:
savedSearchId
- New savedSearchId value. Default value is null- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getSavedSearchId
Description copied from interface:DataBoundComponent
Optional identifier for saved searches that should be applied to this component.By default
SavedSearches
are associated with a component via itslocal ID
andDataSource ID
. This property allows developers to override this behavior and explicitly associate a component with a set of saved searches. This can provide a couple of benefits:
Firstly this ensures that saved searches will be unambiguously associated with the particular component even if the page changes such that a stored minimal locator would no longer applied to the component, without requiring an explicitCanvas.ID
.
Secondly this allows the same set of saved searches to be applied to more than one component on a page. This may be valueable for cases where the same information from the same dataSource is presented to users in multiple places.- Specified by:
getSavedSearchId
in interfaceDataBoundComponent
- Returns:
- Current savedSearchId value. Default value is null
-
setShowSavedSearchesByDS
public DynamicForm setShowSavedSearchesByDS(boolean showSavedSearchesByDS) throws IllegalStateException Description copied from interface:DataBoundComponent
Whether to associate saved searches by default with the currentDataSource
of a component when asavedSearchId
is not provided. If this property is true, then when the DataSource is changed, existing saved searches will disappear and only be available if the DataSource is set back to its original value.If this property is false, saved searches will persist across DataSource changes so that searches that aren't applicable to the current DataSource might still be shown.
Note: This is an advanced setting
- Specified by:
setShowSavedSearchesByDS
in interfaceDataBoundComponent
- Parameters:
showSavedSearchesByDS
- New showSavedSearchesByDS value. Default value is true- Returns:
DataBoundComponent
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getShowSavedSearchesByDS
public boolean getShowSavedSearchesByDS()Description copied from interface:DataBoundComponent
Whether to associate saved searches by default with the currentDataSource
of a component when asavedSearchId
is not provided. If this property is true, then when the DataSource is changed, existing saved searches will disappear and only be available if the DataSource is set back to its original value.If this property is false, saved searches will persist across DataSource changes so that searches that aren't applicable to the current DataSource might still be shown.
- Specified by:
getShowSavedSearchesByDS
in interfaceDataBoundComponent
- Returns:
- Current showSavedSearchesByDS value. Default value is true
-
findAll
Filters all objects according to the AdvancedCriteria passed- Parameters:
adCriteria
- AdvancedCriteria to use to filter results- Returns:
- all matching Objects or null if none found
-
find
Filters all objects according to the AdvancedCriteria passed and returns the first matching object or null if not found- Parameters:
adCriteria
- AdvancedCriteria to use to filter results- Returns:
- first matching object or null if not found
-
findIndex
Finds the index of the first Record that matches with the AdvacendCriteria passed.- Parameters:
adCriteria
- AdvancedCriteria to use to filter results- Returns:
- index of the first matching Record or -1 if not found
-
findNextIndex
LikeRecordList.findIndex(java.util.Map)
, but considering the startIndex and endIndex parameters.- Parameters:
startIndex
- first index to consideradCriteria
- AdvancedCriteria to use to filter resultsendIndex
- last index to consider- Returns:
- index of the first matching Record or -1 if not found
-
findNextIndex
LikeRecordList.findIndex(java.util.Map)
, but considering the startIndex parameter.- Parameters:
startIndex
- first index to consideradCriteria
- AdvancedCriteria to use to filter results- Returns:
- index of the first matching Record or -1 if not found
-
selectRecord
Description copied from interface:DataBoundComponent
Select/deselect aRecord
passed in explicitly, or by index.- Specified by:
selectRecord
in interfaceDataBoundComponent
- Parameters:
record
- record (or row number) to select
-
selectRecord
public void selectRecord(int record) Description copied from interface:DataBoundComponent
Select/deselect aRecord
passed in explicitly, or by index.- Specified by:
selectRecord
in interfaceDataBoundComponent
- Parameters:
record
- record (or row number) to select
-
selectRecord
public void selectRecord(int record, boolean newState) Description copied from interface:DataBoundComponent
Select/deselect aRecord
passed in explicitly, or by index.- Specified by:
selectRecord
in interfaceDataBoundComponent
- Parameters:
record
- record (or row number) to selectnewState
- new selection state (if null, defaults to true)
-
selectRecord
Description copied from interface:DataBoundComponent
Select/deselect aRecord
passed in explicitly, or by index.- Specified by:
selectRecord
in interfaceDataBoundComponent
- Parameters:
record
- record (or row number) to selectnewState
- new selection state (if null, defaults to true)
-
selectRecords
public void selectRecords(int[] records) Description copied from interface:DataBoundComponent
Select/deselect a list ofRecord
s passed in explicitly, or by index.- Specified by:
selectRecords
in interfaceDataBoundComponent
- Parameters:
records
- records (or row numbers) to select
-
selectRecords
public void selectRecords(int[] records, boolean newState) Description copied from interface:DataBoundComponent
Select/deselect a list ofRecord
s passed in explicitly, or by index.- Specified by:
selectRecords
in interfaceDataBoundComponent
- Parameters:
records
- records (or row numbers) to selectnewState
- new selection state
-
selectRecords
Description copied from interface:DataBoundComponent
Select/deselect a list ofRecord
s passed in explicitly, or by index.- Specified by:
selectRecords
in interfaceDataBoundComponent
- Parameters:
records
- records (or row numbers) to select
-
selectRecords
Description copied from interface:DataBoundComponent
Select/deselect a list ofRecord
s passed in explicitly, or by index.- Specified by:
selectRecords
in interfaceDataBoundComponent
- Parameters:
records
- records (or row numbers) to selectnewState
- new selection state (if null, defaults to true)
-
deselectRecord
Description copied from interface:DataBoundComponent
Deselect aRecord
passed in explicitly, or by index.Synonym for
selectRecord(record, false)
- Specified by:
deselectRecord
in interfaceDataBoundComponent
- Parameters:
record
- record (or row number) to deselect
-
deselectRecord
public void deselectRecord(int record) Description copied from interface:DataBoundComponent
Deselect aRecord
passed in explicitly, or by index.Synonym for
selectRecord(record, false)
- Specified by:
deselectRecord
in interfaceDataBoundComponent
- Parameters:
record
- record (or row number) to deselect
-
deselectRecords
public void deselectRecords(int[] records) Description copied from interface:DataBoundComponent
Deselect a list ofRecord
s passed in explicitly, or by index.Synonym for
selectRecords(records, false)
- Specified by:
deselectRecords
in interfaceDataBoundComponent
- Parameters:
records
- records (or row numbers) to deselect
-
deselectRecords
Description copied from interface:DataBoundComponent
Deselect a list ofRecord
s passed in explicitly, or by index.Synonym for
selectRecords(records, false)
- Specified by:
deselectRecords
in interfaceDataBoundComponent
- Parameters:
records
- records (or row numbers) to deselect
-
selectAllRecords
public void selectAllRecords()Description copied from interface:DataBoundComponent
Select all records

- Specified by:
selectAllRecords
in interfaceDataBoundComponent
-
deselectAllRecords
public void deselectAllRecords()Description copied from interface:DataBoundComponent

 Deselect all records

- Specified by:
deselectAllRecords
in interfaceDataBoundComponent
-
anySelected
Description copied from interface:DataBoundComponent
Whether at least one item is selected
- Specified by:
anySelected
in interfaceDataBoundComponent
- Returns:
- true == at least one item is selected false == nothing at all is selected
-
enableHilite
Description copied from interface:DataBoundComponent
Enable / disable ahilites


- Specified by:
enableHilite
in interfaceDataBoundComponent
- Parameters:
hiliteID
- ID of hilite to enable
-
enableHilite
Description copied from interface:DataBoundComponent
Enable / disable ahilites


- Specified by:
enableHilite
in interfaceDataBoundComponent
- Parameters:
hiliteID
- ID of hilite to enableenable
- new enabled state to apply - if null, defaults to true
-
disableHilite
Description copied from interface:DataBoundComponent
Disable a hilite

- Specified by:
disableHilite
in interfaceDataBoundComponent
- Parameters:
hiliteID
- ID of hilite to disable
-
enableHiliting
public void enableHiliting()Description copied from interface:DataBoundComponent
Enable all hilites.

- Specified by:
enableHiliting
in interfaceDataBoundComponent
-
enableHiliting
public void enableHiliting(boolean enable) Description copied from interface:DataBoundComponent
Enable all hilites.

- Specified by:
enableHiliting
in interfaceDataBoundComponent
- Parameters:
enable
- new enabled state to apply - if null, defaults to true
-
disableHiliting
public void disableHiliting()Description copied from interface:DataBoundComponent
Disable all hilites.

- Specified by:
disableHiliting
in interfaceDataBoundComponent
-
getDragData
Description copied from interface:DataBoundComponent
During a drag-and-drop interaction, this method returns the set of records being dragged out of the component. In the default implementation, this is the list of currently selected records.This method is consulted by

ListGrid.willAcceptDrop()
.- Specified by:
getDragData
in interfaceDataBoundComponent
- Returns:
- Array of
Record
s that are currently selected.
-
transferSelectedData
Description copied from interface:DataBoundComponent
Simulates a drag / drop type transfer of the selected records in some other component to this component, without requiring any user interaction. This method acts on the dropped records exactly as if they had been dropped in an actual drag / drop interaction, including any special databound behavior invoked by callingDataBoundComponent.getDropValues()
for each dropped record.To transfer all data in, for example, a
ListGrid
, call grid.selection.selectAll() first.Note that drag/drop type transfers of records between components are asynchronous operations: Smart GWT may need to perform server turnarounds to establish whether dropped records already exist in the target component. Therefore, it is possible to issue a call to
transferSelectedData()
and/or thedrop()
method of a databound component whilst a transfer is still active. When this happens, Smart GWT adds the second and subsequent transfer requests to a queue and runs them one after the other. If you want to be notified when a transfer process has actually completed, useHasDropCompleteHandlers.addDropCompleteHandler(com.smartgwt.client.widgets.events.DropCompleteHandler)
. See theDragging
documentation for an overview of list grid drag/drop data transfer.- Specified by:
transferSelectedData
in interfaceDataBoundComponent
- Parameters:
source
- source component from which the records will be tranferred
-
transferSelectedData
Description copied from interface:DataBoundComponent
Simulates a drag / drop type transfer of the selected records in some other component to this component, without requiring any user interaction. This method acts on the dropped records exactly as if they had been dropped in an actual drag / drop interaction, including any special databound behavior invoked by callingDataBoundComponent.getDropValues()
for each dropped record.To transfer all data in, for example, a
ListGrid
, call grid.selection.selectAll() first.Note that drag/drop type transfers of records between components are asynchronous operations: Smart GWT may need to perform server turnarounds to establish whether dropped records already exist in the target component. Therefore, it is possible to issue a call to
transferSelectedData()
and/or thedrop()
method of a databound component whilst a transfer is still active. When this happens, Smart GWT adds the second and subsequent transfer requests to a queue and runs them one after the other. If you want to be notified when a transfer process has actually completed, useHasDropCompleteHandlers.addDropCompleteHandler(com.smartgwt.client.widgets.events.DropCompleteHandler)
. See theDragging
documentation for an overview of list grid drag/drop data transfer.- Specified by:
transferSelectedData
in interfaceDataBoundComponent
- Parameters:
source
- source component from which the records will be transferredindex
- target index (drop position) of the rows within this grid.
-
getRecordIndex
Description copied from interface:DataBoundComponent
Get the index of the provided record.

 Override in subclasses to provide more specific behaviour, for instance, when data holds a
 large number of records


- Specified by:
getRecordIndex
in interfaceDataBoundComponent
- Parameters:
record
- the record whose index is to be retrieved- Returns:
- indexindex of the record, or -1 if not found
-
getTitleFieldValue
Description copied from interface:DataBoundComponent
Get the value of the titleField for the passed record

 Override in subclasses 


- Specified by:
getTitleFieldValue
in interfaceDataBoundComponent
- Parameters:
record
- the record whose index is to be retrieved- Returns:
- valuethe value of the titleField for the passed record
-
setTitleField
Description copied from interface:DataBoundComponent
Sets the best field to use for a user-visible title for an individual record from this component.- Specified by:
setTitleField
in interfaceDataBoundComponent
- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getTitleField
Description copied from interface:DataBoundComponent
Method to return the fieldName which represents the "title" for records in this
 Component.

 If this.titleField is explicitly specified it will always be used.
 Otherwise, default implementation will checktitleField
for databound
 components.

 For non databound components returns the first defined field name of"title"
, 
"name"
, or"id"
. If we dont find any field-names that match these
 titles, the first field in the component will be used instead.
- Specified by:
getTitleField
in interfaceDataBoundComponent
- Returns:
- fieldName the title field for this component.
-
getDataSource
Description copied from interface:DataBoundComponent
The DataSource that this component should bind to for default fields and for performingDataSource requests
.- Specified by:
getDataSource
in interfaceDataBoundComponent
- Returns:
- DataSource
-
setAutoFetchData
Description copied from interface:DataBoundComponent
If true, when this component is first drawn, automatically callDataBoundComponent.fetchData()
orDataBoundComponent.filterData()
depending onDataBoundComponent.getAutoFetchAsFilter()
. Criteria for this fetch may be picked up frominitialCriteria
and textMatchStyle may be specified viaDataBoundComponent.getAutoFetchTextMatchStyle()
.NOTE: If autoFetchData is set, calling ListGrid.fetchData() before draw will cause two requests to be issued, one from the manual call to fetchData() and one from the autoFetchData setting. The second request will use only
initialCriteria
and not any other criteria or settings from the first request. Generally, turn off autoFetchData if you are going to manually call fetchData() at any time.- Specified by:
setAutoFetchData
in interfaceDataBoundComponent
- Parameters:
autoFetchData
- autoFetchData- Returns:
DataBoundComponent
instance, for chaining setter calls- Throws:
IllegalStateException
-
getAutoFetchData
Description copied from interface:DataBoundComponent
If true, when this component is first drawn, automatically callDataBoundComponent.fetchData()
orDataBoundComponent.filterData()
depending onDataBoundComponent.getAutoFetchAsFilter()
. Criteria for this fetch may be picked up frominitialCriteria
and textMatchStyle may be specified viaDataBoundComponent.getAutoFetchTextMatchStyle()
.NOTE: If autoFetchData is set, calling ListGrid.fetchData() before draw will cause two requests to be issued, one from the manual call to fetchData() and one from the autoFetchData setting. The second request will use only
initialCriteria
and not any other criteria or settings from the first request. Generally, turn off autoFetchData if you are going to manually call fetchData() at any time.- Specified by:
getAutoFetchData
in interfaceDataBoundComponent
- Returns:
- autoFetchData autoFetchData
-
setAutoFetchTextMatchStyle
public DynamicForm setAutoFetchTextMatchStyle(TextMatchStyle autoFetchTextMatchStyle) throws IllegalStateException Description copied from interface:DataBoundComponent
IfautoFetchData
istrue
, this attribute allows the developer to specify a textMatchStyle for the initialDataBoundComponent.fetchData()
call.- Specified by:
setAutoFetchTextMatchStyle
in interfaceDataBoundComponent
- Returns:
DataBoundComponent
instance, for chaining setter calls- Throws:
IllegalStateException
-
getAutoFetchTextMatchStyle
Description copied from interface:DataBoundComponent
IfautoFetchData
istrue
, this attribute allows the developer to specify a textMatchStyle for the initialDataBoundComponent.fetchData()
call.- Specified by:
getAutoFetchTextMatchStyle
in interfaceDataBoundComponent
- Returns:
- autoFetchTextMatchStyle autoFetchTextMatchStyle
-
setAutoFetchAsFilter
Description copied from interface:DataBoundComponent
IfDataBoundComponent.setAutoFetchData(Boolean)
is true, this attribute determines whether the initial fetch operation should be performed viaDataBoundComponent.fetchData()
orDataBoundComponent.filterData()
- Specified by:
setAutoFetchAsFilter
in interfaceDataBoundComponent
- Parameters:
autoFetchAsFilter
- autoFetchAsFilter- Returns:
DataBoundComponent
instance, for chaining setter calls- Throws:
IllegalStateException
-
getAutoFetchAsFilter
Description copied from interface:DataBoundComponent
IfDataBoundComponent.setAutoFetchData(Boolean)
is true, this attribute determines whether the initial fetch operation should be performed viaDataBoundComponent.fetchData()
orDataBoundComponent.filterData()
- Specified by:
getAutoFetchAsFilter
in interfaceDataBoundComponent
- Returns:
- auto fetch as filter
-
setInitialCriteria
Description copied from interface:DataBoundComponent
Criteria to use whenDataBoundComponent.setAutoFetchData(Boolean)
is used.- Specified by:
setInitialCriteria
in interfaceDataBoundComponent
- Parameters:
initialCriteria
- the initial criteria- Returns:
DataBoundComponent
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getInitialCriteria
Description copied from interface:DataBoundComponent
Criteria to use whenDataBoundComponent.setAutoFetchData(Boolean)
is used.- Specified by:
getInitialCriteria
in interfaceDataBoundComponent
- Returns:
- the criteria
-
setImplicitCriteria
Description copied from interface:DataBoundComponent
Criteria that are never shown to or edited by the user and are cumulative with any criteria provided viaDataBoundComponent.initialCriteria
,DataBoundComponent.setCriteria()
etc.- Specified by:
setImplicitCriteria
in interfaceDataBoundComponent
- Parameters:
implicitCriteria
- New implicitCriteria value. Default value is null- Returns:
DataBoundComponent
instance, for chaining setter calls
-
setImplicitCriteria
-
setImplicitCriteria
-
getImplicitCriteria
Description copied from interface:DataBoundComponent
Criteria that are never shown to or edited by the user and are cumulative with any criteria provided viaDataBoundComponent.initialCriteria
,DataBoundComponent.setCriteria()
etc.- Specified by:
getImplicitCriteria
in interfaceDataBoundComponent
- Returns:
- Current implicitCriteria value. Default value is null
-
fetchData
public void fetchData()Description copied from interface:DataBoundComponent
Retrieves data from the DataSource that matches the specified criteria.When
fetchData()
is first called, if data has not already been provided viasetData()
, this method will create aResultSet
, which will be configured based on component settings such asfetchOperation
anddataPageSize
, as well as the general purposedataProperties
. The created ResultSet will automatically send a DSRequest to retrieve data from the dataSource, and from then on will automatically manage paging through large datasets, as well as performing filtering and sorting operations inside the browser when possible - see the ResultSet docs for details.NOTE: do not use both
autoFetchData
and a call tofetchData()
- this may result in two DSRequests to fetch data. Use eitherautoFetchData
andsetAutoFetchCriteria()
or a manual call to fetchData() passing criteria.Whether a ResultSet was automatically created or provided via
setData()
, subsequent calls to fetchData() will simply callresultSet.setCriteria()
.Changes to criteria may or may not result in a DSRequest to the server due to client-side filtering. You can call
willFetchData(criteria)
to determine if new criteria will result in a server fetch.If you need to force data to be re-fetched, you can call
invalidateCache()
and new data will automatically be fetched from the server using the current criteria and sort direction. NOTE: when usinginvalidateCache()
there is no need to also callfetchData()
and in fact this could produce unexpected results.This method takes an optional callback parameter (set to a
DSCallback
) to fire when the fetch completes. Note that this callback will not fire if no server fetch is performed. In this case the data is updated synchronously, so as soon as this method completes you can interact with the new data. If necessary, you can useresultSet.willFetchData()
to determine whether or not a server fetch will occur whenfetchData()
is called with new criteria.In addition to the callback parameter for this method, developers can use
resultSet.addDataArrivedHandler
to be notified every time data is loaded.- Specified by:
fetchData
in interfaceDataBoundComponent
-
fetchData
Description copied from interface:DataBoundComponent
Retrieves data from the DataSource that matches the specified criteria.When
fetchData()
is first called, if data has not already been provided viasetData()
, this method will create aResultSet
, which will be configured based on component settings such asfetchOperation
anddataPageSize
, as well as the general purposedataProperties
. The created ResultSet will automatically send a DSRequest to retrieve data from the dataSource, and from then on will automatically manage paging through large datasets, as well as performing filtering and sorting operations inside the browser when possible - see the ResultSet docs for details.NOTE: do not use both
autoFetchData
and a call tofetchData()
- this may result in two DSRequests to fetch data. Use eitherautoFetchData
andsetAutoFetchCriteria()
or a manual call to fetchData() passing criteria.Whether a ResultSet was automatically created or provided via
setData()
, subsequent calls to fetchData() will simply callresultSet.setCriteria()
.Changes to criteria may or may not result in a DSRequest to the server due to client-side filtering. You can call
willFetchData(criteria)
to determine if new criteria will result in a server fetch.If you need to force data to be re-fetched, you can call
invalidateCache()
and new data will automatically be fetched from the server using the current criteria and sort direction. NOTE: when usinginvalidateCache()
there is no need to also callfetchData()
and in fact this could produce unexpected results.This method takes an optional callback parameter (set to a
DSCallback
) to fire when the fetch completes. Note that this callback will not fire if no server fetch is performed. In this case the data is updated synchronously, so as soon as this method completes you can interact with the new data. If necessary, you can useresultSet.willFetchData()
to determine whether or not a server fetch will occur whenfetchData()
is called with new criteria.In addition to the callback parameter for this method, developers can use
resultSet.addDataArrivedHandler
to be notified every time data is loaded.- Specified by:
fetchData
in interfaceDataBoundComponent
- Parameters:
criteria
- Search criteria. If aDynamicForm
is passed in as this argument instead of a raw criteria object, will be derived by callinggetValuesAsCriteria()
-
fetchData
Description copied from interface:DataBoundComponent
Retrieves data from the DataSource that matches the specified criteria.When
fetchData()
is first called, if data has not already been provided viasetData()
, this method will create aResultSet
, which will be configured based on component settings such asfetchOperation
anddataPageSize
, as well as the general purposedataProperties
. The created ResultSet will automatically send a DSRequest to retrieve data from the dataSource, and from then on will automatically manage paging through large datasets, as well as performing filtering and sorting operations inside the browser when possible - see the ResultSet docs for details.NOTE: do not use both
autoFetchData
and a call tofetchData()
- this may result in two DSRequests to fetch data. Use eitherautoFetchData
andsetAutoFetchCriteria()
or a manual call to fetchData() passing criteria.Whether a ResultSet was automatically created or provided via
setData()
, subsequent calls to fetchData() will simply callresultSet.setCriteria()
.Changes to criteria may or may not result in a DSRequest to the server due to client-side filtering. You can call
willFetchData(criteria)
to determine if new criteria will result in a server fetch.If you need to force data to be re-fetched, you can call
invalidateCache()
and new data will automatically be fetched from the server using the current criteria and sort direction. NOTE: when usinginvalidateCache()
there is no need to also callfetchData()
and in fact this could produce unexpected results.This method takes an optional callback parameter (set to a
DSCallback
) to fire when the fetch completes. Note that this callback will not fire if no server fetch is performed. In this case the data is updated synchronously, so as soon as this method completes you can interact with the new data. If necessary, you can useresultSet.willFetchData()
to determine whether or not a server fetch will occur whenfetchData()
is called with new criteria.In addition to the callback parameter for this method, developers can use
resultSet.addDataArrivedHandler
to be notified every time data is loaded.- Specified by:
fetchData
in interfaceDataBoundComponent
- Parameters:
criteria
- Search criteria. If aDynamicForm
is passed in as this argument instead of a raw criteria object, will be derived by callinggetValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires only if server contact was required
-
fetchData
Description copied from interface:DataBoundComponent
Retrieves data from the DataSource that matches the specified criteria.When
fetchData()
is first called, if data has not already been provided viasetData()
, this method will create aResultSet
, which will be configured based on component settings such asfetchOperation
anddataPageSize
, as well as the general purposedataProperties
. The created ResultSet will automatically send a DSRequest to retrieve data from the dataSource, and from then on will automatically manage paging through large datasets, as well as performing filtering and sorting operations inside the browser when possible - see the ResultSet docs for details.NOTE: do not use both
autoFetchData
and a call tofetchData()
- this may result in two DSRequests to fetch data. Use eitherautoFetchData
andsetAutoFetchCriteria()
or a manual call to fetchData() passing criteria.Whether a ResultSet was automatically created or provided via
setData()
, subsequent calls to fetchData() will simply callresultSet.setCriteria()
.Changes to criteria may or may not result in a DSRequest to the server due to client-side filtering. You can call
willFetchData(criteria)
to determine if new criteria will result in a server fetch.If you need to force data to be re-fetched, you can call
invalidateCache()
and new data will automatically be fetched from the server using the current criteria and sort direction. NOTE: when usinginvalidateCache()
there is no need to also callfetchData()
and in fact this could produce unexpected results.This method takes an optional callback parameter (set to a
DSCallback
) to fire when the fetch completes. Note that this callback will not fire if no server fetch is performed. In this case the data is updated synchronously, so as soon as this method completes you can interact with the new data. If necessary, you can useresultSet.willFetchData()
to determine whether or not a server fetch will occur whenfetchData()
is called with new criteria.In addition to the callback parameter for this method, developers can use
resultSet.addDataArrivedHandler
to be notified every time data is loaded.- Specified by:
fetchData
in interfaceDataBoundComponent
- Parameters:
criteria
- Search criteria. If aDynamicForm
is passed in as this argument instead of a raw criteria object, will be derived by callinggetValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires only if server contact was requiredrequestProperties
- additional properties to set on the DSRequest that will be issued
-
filterData
public void filterData()Description copied from interface:DataBoundComponent
Retrieves data that matches the provided criteria and displays the matching data in this component.This method behaves exactly like
ListGrid.fetchData()
except thattextMatchStyle
is automatically set to "substring" so that String-valued fields are matched by case-insensitive substring comparison.- Specified by:
filterData
in interfaceDataBoundComponent
-
filterData
Description copied from interface:DataBoundComponent
Retrieves data that matches the provided criteria and displays the matching data in this component.This method behaves exactly like
ListGrid.fetchData()
except thattextMatchStyle
is automatically set to "substring" so that String-valued fields are matched by case-insensitive substring comparison.- Specified by:
filterData
in interfaceDataBoundComponent
- Parameters:
criteria
- Search criteria. If aDynamicForm
is passed in as this argument instead of a raw criteria object, will be derived by callinggetValuesAsCriteria()
-
filterData
Description copied from interface:DataBoundComponent
Retrieves data that matches the provided criteria and displays the matching data in this component.This method behaves exactly like
ListGrid.fetchData()
except thattextMatchStyle
is automatically set to "substring" so that String-valued fields are matched by case-insensitive substring comparison.- Specified by:
filterData
in interfaceDataBoundComponent
- Parameters:
criteria
- Search criteria. If aDynamicForm
is passed in as this argument instead of a raw criteria object, will be derived by callinggetValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires only if server contact was required; seeDataBoundComponent.fetchData()
for details
-
filterData
Description copied from interface:DataBoundComponent
Retrieves data that matches the provided criteria and displays the matching data in this component.This method behaves exactly like
ListGrid.fetchData()
except thattextMatchStyle
is automatically set to "substring" so that String-valued fields are matched by case-insensitive substring comparison.- Specified by:
filterData
in interfaceDataBoundComponent
- Parameters:
criteria
- Search criteria. If aDynamicForm
is passed in as this argument instead of a raw criteria object, will be derived by callinggetValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires only if server contact was required; seeDataBoundComponent.fetchData()
for detailsrequestProperties
- for databound components only - optional additional properties to set on the DSRequest that will be issued
-
invalidateCache
public void invalidateCache()Description copied from interface:DataBoundComponent
Invalidate the current data cache for this databound component via a call to the dataset'sinvalidateCache()
method, for example,ResultSet.invalidateCache()
.NOTE: there is no need to call
invalidateCache()
when a save operation is performed on a DataSource. Automatic cache synchronization features will automatically update caches - seeResultSet
for details. If automatic cache synchronization isn't working, troubleshoot the problem using the steps suggested in the FAQ rather than just calling invalidateCache(). CallinginvalidateCache()
unnecessarily causes extra server load and added code complexity.Calling
invalidateCache()
will automatically cause a new fetch to be performed with the current set of criteria if data had been previously fetched and the component is currently drawn with data visible - there is no need to manually call fetchData() after invalidateCache() and this could result in duplicate fetches.While data is being re-loaded after a call to
invalidateCache()
, the widget is in a state similar to initial data load - it doesn't know the total length of the dataset and any APIs that act on records or row indices will necessarily fail and should not be called. To detect that the widget is in this state, callResultSet.lengthIsKnown()
.invalidateCache()
only has an effect if this component's dataset is a data manager class that manages a cache (eg ResultSet or ResultTree). If data was provided as a simple Array or List, invalidateCache() does nothing.- Specified by:
invalidateCache
in interfaceDataBoundComponent
- See Also:
-
getResultSet
Description copied from interface:DataBoundComponent
Return the underlying data of this DataBoundComponent as aResultSet
.Note that this method should only be called after initial data has been fetched by this DataBoundComponent.
- Specified by:
getResultSet
in interfaceDataBoundComponent
- Returns:
- ResultSet, or null if the underlying data is not a ResultSet
- See Also:
-
getRecordList
Description copied from interface:DataBoundComponent
Return the underlying data of this DataBoundComponent as aRecordList
.Depending on the component configuration, the actual JavaScript instance of the returned RecordList may be one of several types:
- If the component is not bound to a
DataSource
, the instance is generally an Array ofRecord
. - If the component is bound to a DataSource, the instance is a
ResultSet
. - If the component is a grouped ListGrid, the instance is a
Tree
. To access the ungrouped record list regardless of grouping status, useisGrouped() ? getOriginalRecordList() : getRecordList()
- If the component is a
TreeGrid
, the instance is a ResultTree.
- Specified by:
getRecordList
in interfaceDataBoundComponent
- Returns:
- the RecordList
- If the component is not bound to a
-
getDataAsJSList
- Specified by:
getDataAsJSList
in interfaceDataBoundComponent
-
exportData
public void exportData()Description copied from interface:DataBoundComponent
- Specified by:
exportData
in interfaceDataBoundComponent
-
exportData
Description copied from interface:DataBoundComponent
- Specified by:
exportData
in interfaceDataBoundComponent
-
exportData
Description copied from interface:DataBoundComponent
Uses a "fetch" operation on the currentDataSource
to retrieve data that matches the current filter and sort criteria for this component, then exports the resulting data to a file or window in the requested format.A variety of DSRequest settings, such as
exportAs
andexportFilename
, affect the exporting process: seeexportResults
for further detail.Note that data exported via this method does not include any client-side formatting and relies on both the Smart GWT server and server-side DataSources. To export client-data with formatters applied, see
exportClientData
, which still requires the Smart GWT server but does not rely on server-side DataSources.For more information on exporting data, see
DataSource.exportData
.- Specified by:
exportData
in interfaceDataBoundComponent
- Parameters:
requestProperties
- additional properties to set on DSRequest that will be issuedcallback
- Optional callback. Note that this parameter only applies if you specifyexportToClient
: false in the request properties, because file downloads don't provide ordinary framework callbacks- See Also:
-
addFetchDataHandler
Add a fetchData handler.Notification function fired on fetchData() or filterData()
- Specified by:
addFetchDataHandler
in interfaceHasFetchDataHandlers
- Parameters:
handler
- the filterData handler- Returns:
HandlerRegistration
used to remove this handler
-
addDropCompleteHandler
Add acom.smartgwt.client.widgets.DropCompleteHandler
. See that class's documentation for a definition of "drop complete", and how it differs from "drag complete" (com.smartgwt.client.widgets.DragCompleteHandler
).- Specified by:
addDropCompleteHandler
in interfaceHasDropCompleteHandlers
- Parameters:
handler
- the DropCompleteHandler- Returns:
HandlerRegistration
used to remove this handler
-
addDragCompleteHandler
Add acom.smartgwt.client.widgets.DragCompleteHandler
. See that class's documentation for a definition of "drag complete", and how it differs from "drop complete" (com.smartgwt.client.widgets.DropCompleteHandler
).- Specified by:
addDragCompleteHandler
in interfaceHasDragCompleteHandlers
- Parameters:
handler
- the DropCompleteHandler- Returns:
HandlerRegistration
used to remove this handler
-
getFieldAlignments
Description copied from interface:DataBoundComponent
Returna an array of field alignments for this grid- Specified by:
getFieldAlignments
in interfaceDataBoundComponent
- Returns:
- array of Alignments
-
getDeepCloneOnEdit
Description copied from interface:DataBoundComponent
Before we start editing values in this DataBoundComponent, should we perform a deep clone of the underlying values. SeeDataSource.getDeepCloneOnEdit()
for details of what this means.If this value is not explicitly set, it defaults to the DataSource
deepCloneOnEdit
value. This value can also be overridden per-field withDataSourceField.setDeepCloneOnEdit(java.lang.Boolean)
.Like the other
deepCloneOnEdit
settings, this flag only has an effect if you are editing a values object that contains nested objects or arrays, usingCanvas.setDataPath(java.lang.String)
- Specified by:
getDeepCloneOnEdit
in interfaceDataBoundComponent
-
setDeepCloneOnEdit
Description copied from interface:DataBoundComponent
Before we start editing values in this DataBoundComponent, should we perform a deep clone of the underlying values. SeeDataSource.getDeepCloneOnEdit()
for details of what this means.If this value is not explicitly set, it defaults to the DataSource
deepCloneOnEdit
value. This value can also be overridden per-field withDataSourceField.setDeepCloneOnEdit(java.lang.Boolean)
.Like the other
deepCloneOnEdit
settings, this flag only has an effect if you are editing a values object that contains nested objects or arrays, usingCanvas.setDataPath(java.lang.String)
- Specified by:
setDeepCloneOnEdit
in interfaceDataBoundComponent
- Returns:
DataBoundComponent
instance, for chaining setter calls
-
setFields
Description copied from interface:DataBoundComponent
Field setter variant (alternative tosetFields(FormItem...)
,setFields(ListGridField...)
, etc.) that will accept an array of JavaScriptObject, rather than an array of SmartGWT Java wrappers of the field class type (e.g.FormItem
,ListGridField
, etc.) This is an advanced method and only for cases where you have the JavaScriptObject for each field but want to avoid having to create each associated SmartGWT Java wrapper.Note: use
toArray()
to create a Java array of JavaScriptObject if you only have the array itself as a single JavaScriptObject.- Specified by:
setFields
in interfaceDataBoundComponent
- Parameters:
fields
- the component fields- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getFieldsAsJavaScriptObjects
Description copied from interface:DataBoundComponent
Return the fields as JavaScriptObjects rather than as SmartGWT Java wrappers of the field class type (e.g.FormItem
,ListGridField
, etc.) This avoids building the SmartGWT Java wrappers for the fields in situations where they aren't needed - and for FormItems in particular - where there may not be enough information to determine the correct subclass, such as before the SmartClient instance underlying theDynamicForm
has been created.- Specified by:
getFieldsAsJavaScriptObjects
in interfaceDataBoundComponent
- Returns:
- the component fields
-
getFieldCount
public int getFieldCount()Description copied from interface:DataBoundComponent
Return the number of fields.- Specified by:
getFieldCount
in interfaceDataBoundComponent
- Returns:
- the number of fields
-
transferRecords
public void transferRecords(Record[] records, Record targetRecord, Integer index, Canvas sourceWidget, TransferRecordsCallback callback) Description copied from interface:DataBoundComponent
Transfer a list ofRecord
s from another component (does not have to be a databound component) into this component. This method is only applicable to list-type components, such asListGrid
orcom.smartgwt.client.widgets.tile.TileGridTileGrid
. Notably, it does not apply toTreeGrid
; the equivalent for treeGrids istransferNodes
.This method implements the automatic drag-copy and drag-move behaviors of components like
ListGrid
, and calling it is equivalent to completing a drag and drop of thedropRecords
(the default record drop behavior is simply to calltransferRecords()
, passing in the dropped nodes)Note that this method is asynchronous - it may need to perform server turnarounds to prevent duplicates in the target component's data. If you wish to be notified when the transfer process has completed, you can either pass a non-null callback to this method or add a
DropCompleteHandler
to this component.See also
transferSelectedData()
- Specified by:
transferRecords
in interfaceDataBoundComponent
- Parameters:
records
- Recordss to transfer to this componenttargetRecord
- The target record (eg, of a drop interaction), for contextindex
- Insert point relative to the target record for the transferred recordssourceWidget
- The databound or non-databound component from which the records are to be transferred.callback
- optional TransferRecordsCallback to be fired when the transfer process has completed (pass null if your code does not need to be called back). The callback will be passed the list of records actually transferred to this component
-
setDragDataCustomizer
During a drag-and-drop interaction, this method returns the set of records being dragged out of the component. In the default implementation, this is the list of currently selected records.This method is consulted by
willAcceptDrop()
.- Parameters:
DragDataCustomizer
- customizer- Returns:
DataBoundComponent
instance, for chaining setter calls
-
getSort
Description copied from interface:DataBoundComponent
Returns the currentSortSpecifiers
for this component. Will return null if this component has never been sorted, or the underlying SmartClient widget does not exist.- Specified by:
getSort
in interfaceDataBoundComponent
- Returns:
- current sort specifiers for this component (null if unsorted or no SC widget)
-
setSort
Description copied from interface:DataBoundComponent
Sort the component on one or more fields.Pass in an array of
SortSpecifier
s to have the component's data sorted by the fields in eachspecifier.property
and in the directions specified. The component can be sorted by any combination of fields, including fields specified in the fields array andunused fields from the underlying dataSource
, if there is one.If setSort() is called on a component which doesn't yet have a SmartClient widget, the widget will be created. If
autoFetchData
is set and aDataSource
has been set, this will result in data being fetched.- Specified by:
setSort
in interfaceDataBoundComponent
- Parameters:
sortSpecifiers
- Array ofSortSpecifier
objects
-
setLogicalStructure
Setter implementing theLogicalStructure
interface, which supports Eclipse's logical structure debugging facility. -
getLogicalStructure
Getter implementing theLogicalStructure
interface, which supports Eclipse's logical structure debugging facility.- Specified by:
getLogicalStructure
in interfaceLogicalStructure
- Overrides:
getLogicalStructure
in classCanvas
-