public class DynamicForm extends Canvas implements DataBoundComponent, HasFormSubmitFailedHandlers, HasAsyncValidationReplyHandlers, HasHiddenValidationErrorsHandlers, HasItemChangeHandlers, HasItemChangedHandlers, HasItemKeyPressHandlers, HasSubmitValuesHandlers, HasValuesChangedHandlers
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:
form.getValues()
form.getValue()
)
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.
config, configOnly, factoryCreated, factoryProperties, id, nativeObject, scClassName
Constructor and Description |
---|
DynamicForm() |
DynamicForm(com.google.gwt.core.client.JavaScriptObject jsObj) |
Modifier and Type | Method and Description |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addAsyncValidationReplyHandler(AsyncValidationReplyHandler handler)
Add a asyncValidationReply handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addDragCompleteHandler(DragCompleteHandler handler)
Add a
com.smartgwt.client.widgets.DragCompleteHandler . |
com.google.gwt.event.shared.HandlerRegistration |
addDropCompleteHandler(DropCompleteHandler handler)
Add a
com.smartgwt.client.widgets.DropCompleteHandler . |
com.google.gwt.event.shared.HandlerRegistration |
addFetchDataHandler(FetchDataHandler handler)
Add a fetchData handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addFormSubmitFailedHandler(FormSubmitFailedHandler handler)
Add a formSubmitFailed handler.
|
void |
addFormulaField()
Convenience method to display a
com.smartgwt.client..FormulaBuilder to create a new Formula Field. |
com.google.gwt.event.shared.HandlerRegistration |
addHiddenValidationErrorsHandler(HiddenValidationErrorsHandler handler)
Add a hiddenValidationErrors handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addItemChangedHandler(ItemChangedHandler handler)
Add a itemChanged handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addItemChangeHandler(ItemChangeHandler handler)
Add a itemChange handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addItemKeyPressHandler(ItemKeyPressHandler handler)
Add a itemKeyPress handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addSubmitValuesHandler(SubmitValuesHandler handler)
Add a submitValues handler.
|
void |
addSummaryField()
Convenience method to display a
com.smartgwt.client..SummaryBuilder to create a new Summary Field. |
com.google.gwt.event.shared.HandlerRegistration |
addValuesChangedHandler(ValuesChangedHandler handler)
Add a valuesChanged handler.
|
java.lang.Boolean |
anySelected()
Whether at least one item is selected
|
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.
|
void |
cancel(DSRequest requestProperties)
Deprecated.
As of Smartclient version 13.0, due to the removal of Apache Struts.
|
void |
cancelEditing()
If the form or valuesManager has associated userTask workflow task than notify it about cancelling the changes.
|
static void |
changeAutoChildDefaults(java.lang.String autoChildName,
Canvas defaults)
Changes the defaults for Canvas AutoChildren named
autoChildName . |
static void |
changeAutoChildDefaults(java.lang.String autoChildName,
FormItem defaults)
Changes the defaults for FormItem AutoChildren named
autoChildName . |
java.util.Map |
checkForValidationErrors(ValidationStatusCallback callback)
Performs silent validation of the current form values, like
valuesAreValid() . |
java.util.Map |
checkForValidationErrors(ValidationStatusCallback callback,
boolean validateHiddenFields) |
java.util.Map |
checkForValidationErrors(ValidationStatusCallback callback,
boolean validateHiddenFields,
boolean skipServerValidation)
Performs silent validation of the current form values, like
valuesAreValid() . |
void |
clearErrors(boolean show)
Clears all errors for this DynamicForm.
|
void |
clearFieldErrors(java.lang.String fieldName,
boolean show)
Clear any validation errors on the field passed in.
|
void |
clearValue(java.lang.String fieldName)
Clears the value for some field via a call to
FormItem.clearValue() if appropriate. |
void |
clearValues()
Reset to default form values and clear errors
|
void |
completeEditing()
Finish editing and store edited values in
process state . |
protected com.google.gwt.core.client.JavaScriptObject |
create() |
void |
deselectAllRecords()
Deselect all records
|
void |
deselectRecord(int record)
Deselect a
Record passed in explicitly, or by index. |
void |
deselectRecord(Record record)
Deselect a
Record passed in explicitly, or by index. |
void |
deselectRecords(int[] records)
Deselect a list of
Record s passed in explicitly, or by index. |
void |
deselectRecords(Record[] records)
Deselect a list of
Record s passed in explicitly, or by index. |
void |
disableHilite(java.lang.String hiliteID)
Disable a hilite
|
void |
disableHiliting()
Disable all hilites.
|
void |
editFields()
Shows a FieldPicker interface allowing end-users to rearrange the order and visibiility
of the fields in the associated DataBoundComponent.
|
void |
editHilites()
Shows a HiliteEditor interface allowing end-users to edit the data-hilites currently in use by this DataBoundComponent.
|
void |
editNewRecord()
Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified).
|
void |
editNewRecord(java.util.Map initialValues)
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 |
editRecord(Record record)
Edit an existing record.
|
void |
editSelectedData(ListGrid selectionComponent)
Edit the record selected in the specified ListGrid.
|
void |
editSelectedData(java.lang.String listGridID)
Edit the record selected in the specified ListGrid.
|
void |
enableHilite(java.lang.String hiliteID)
Enable / disable a
hilites
|
void |
enableHilite(java.lang.String hiliteID,
boolean enable)
Enable / disable a
hilites
|
void |
enableHiliting()
Enable all hilites.
|
void |
enableHiliting(boolean enable)
Enable all hilites.
|
void |
exportData()
|
void |
exportData(DSRequest requestProperties)
|
void |
exportData(DSRequest requestProperties,
RPCCallback callback)
Uses a "fetch" operation on the current
DataSource
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 |
fetchData()
Retrieves data from the DataSource that matches the specified criteria.
|
void |
fetchData(Criteria criteria)
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(FormItem field)
Can the field be edited? This method looks at
canEdit
for the grid as well as the FormItem.canEdit value,
to determine whether editing is actually allowed. |
boolean |
fieldIsEditable(int field)
Can the field be edited? This method looks at
canEdit
for the grid as well as the FormItem.canEdit value,
to determine whether editing is actually allowed. |
boolean |
fieldIsEditable(java.lang.String field)
Can the field be edited? This method looks at
canEdit
for the grid as well as the FormItem.canEdit value,
to determine whether editing is actually allowed. |
void |
filterData()
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.
|
Record |
find(AdvancedCriteria adCriteria)
Filters all objects according to the AdvancedCriteria passed and returns the first matching object or null if not found
|
Record[] |
findAll(AdvancedCriteria adCriteria)
Filters all objects according to the AdvancedCriteria passed
|
int |
findIndex(AdvancedCriteria adCriteria)
Finds the index of the first Record that matches with the AdvacendCriteria passed.
|
int |
findNextIndex(int startIndex,
AdvancedCriteria adCriteria)
Like
RecordList.findIndex(java.util.Map) , but considering the startIndex parameter. |
int |
findNextIndex(int startIndex,
AdvancedCriteria adCriteria,
int endIndex)
Like
RecordList.findIndex(java.util.Map) , but considering the startIndex and endIndex parameters. |
void |
focus()
Give keyboard focus to this form.
|
void |
focusInItem(FormItem formItem)
Move the keyboard focus into a particular item.
|
void |
focusInItem(int itemNumber)
Move the keyboard focus into a particular item.
|
void |
focusInItem(java.lang.String itemName)
Move the keyboard focus into a particular item.
|
java.lang.String |
getAction()
The URL to which the form will submit its values.
|
java.lang.Boolean |
getAddDropValues()
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.
|
java.lang.String |
getAddFormulaFieldText()
Text for a menu item allowing users to add a formula field
|
java.lang.String |
getAddOperation()
operationId this component
should use when performing add operations. |
java.lang.String |
getAddSummaryFieldText()
Text for a menu item allowing users to add a formula field
|
java.lang.Boolean |
getAllowExpressions()
For a form that produces filter criteria (see
form.getValuesAsCriteria() ), allows the user to enter simple expressions in any field in this form that takes text
input. |
AutoComplete |
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. |
java.lang.Boolean |
getAutoFetchAsFilter()
If
DataBoundComponent.setAutoFetchData(Boolean) is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData() or DataBoundComponent.filterData() |
java.lang.Boolean |
getAutoFetchData()
If true, when this component is first drawn, automatically call
DataBoundComponent.fetchData() or DataBoundComponent.filterData() depending on
DataBoundComponent.getAutoFetchAsFilter() . |
TextMatchStyle |
getAutoFetchTextMatchStyle()
If
autoFetchData is true , this attribute allows the developer to specify a textMatchStyle
for the initial DataBoundComponent.fetchData() call. |
java.lang.Boolean |
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 call dynamicForm.focusInItem(itemName) |
java.lang.Boolean |
getAutoFocusOnError()
If true, when
validation fails focus will automatically be
put into the first focusable field which failed validation. |
java.lang.Boolean |
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 via
FormItem.browserSpellCheck |
java.lang.Boolean |
getCanAddFormulaFields()
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
com.smartgwt.client..FormulaBuilder .
|
java.lang.Boolean |
getCanAddSummaryFields()
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
com.smartgwt.client..SummaryBuilder .
|
java.lang.Boolean |
getCanEdit()
If set to
false , the form will be marked read-only. |
java.lang.String |
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.
|
java.lang.Boolean |
getCanFocus()
DynamicForms are considered to have focus if any of their form items have focus.
|
java.lang.Boolean |
getCanSubmit()
Governs whether this form will be used to perform a standard HTML form submission.
|
java.lang.Boolean |
getCanTabToIcons()
Should users be able to tab into the
icons and picker icon for items within this form by default? |
java.lang.Boolean |
getCanTabToSectionHeaders()
If true, the headers for any
SectionItems will
be included in the page's tab order for accessibility. |
int |
getCellBorder()
Width of border for the table that form is drawn in.
|
int |
getCellPadding()
The amount of empty space, in pixels, surrounding each form item within its cell in the layout grid.
|
int |
getCellSpacing()
Deprecated.
use
getCellPadding() instead |
java.util.Map |
getChangedValues()
Returns all values within this DynamicForm that have changed since
DynamicForm.rememberValues last ran. |
boolean |
getCheckFileAccessOnSubmit()
For dynamicForms containing a
FileItem for uploading files, should the
browser verify that the file is accessible before submitting the uploaded file to the server? |
boolean |
getClipItemTitles()
Should the titles for form items be clipped if they are too large for the available space?
|
java.lang.Boolean |
getClipStaticValue()
Default
FormItem.clipStaticValue setting for
items in this form. |
java.lang.String |
getDataArity()
A DynamicForm is a
dataArity :single component. |
com.google.gwt.core.client.JavaScriptObject |
getDataAsJSList() |
FetchMode |
getDataFetchMode()
How to fetch and manage records retrieve from the server.
|
int |
getDataPageSize()
When using
data
paging , how many records to fetch at a time. |
DataSource |
getDataSource()
The DataSource that this component should bind to for default fields and for performing
DataSource requests . |
DateDisplayFormat |
getDateFormatter()
Default
DateDisplayFormat for Date type values displayed in this form. |
DateDisplayFormat |
getDatetimeFormatter()
Default
DateDisplayFormat for Date type values displayed in this form in fields of
type datetime . |
java.lang.Boolean |
getDeepCloneOnEdit()
Before we start editing values in this DataBoundComponent, should we perform a deep clone
of the underlying values.
|
OperatorId |
getDefaultSearchOperator()
Default
search operator to use for fields in a form that produces AdvancedCriteria . |
java.lang.Boolean |
getDisableValidation()
If set to true, client-side validators will not run on the form when validate() is called.
|
Record[] |
getDragData()
During a drag-and-drop interaction, this method returns the set of records being dragged out of the component.
|
DragDataAction |
getDragDataAction()
Indicates what to do with data dragged into another DataBoundComponent.
|
java.lang.String |
getDragTrackerStyle()
CSS Style to apply to the drag tracker when dragging occurs on this component.
|
java.util.Map |
getDropValues()
When an item is dropped on this component, and
addDropValues 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. |
java.lang.String |
getDuplicateDragMessage()
Message to show when a user attempts to transfer duplicate records into this component, and
preventDuplicates
is enabled. |
java.lang.String |
getEditFormulaFieldText()
Text for a menu item allowing users to edit a formula field
|
java.lang.String |
getEditProxyConstructor()
Default class used to construct the
EditProxy for this component when the component is
first placed into edit mode . |
java.lang.String |
getEditSummaryFieldText()
Text for a menu item allowing users to edit the formatter for a field
|
Encoding |
getEncoding()
encoding for the form, use MULTIPART_ENCODING for file upload forms
|
java.lang.String |
getErrorItemCellStyle()
If
showInlineErrors 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. |
java.util.Map |
getErrors()
Returns the set of errors.
|
java.lang.String |
getErrorsPreamble()
If
showInlineErrors is false , all
errors for the items in the form are rendered as a single item at the top of the form. |
FormItem |
getEventItem()
If the current mouse event occurred over an item in this dynamicForm, returns that item.
|
FormItemEventInfo |
getEventItemInfo(java.lang.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.
|
java.lang.Boolean |
getExportAll()
Setting exportAll to true prevents the component from passing its list of fields to the
export call.
|
java.lang.String[] |
getExportFields()
The list of field-names to export.
|
java.lang.Boolean |
getExportIncludeSummaries()
If Summary rows exist for this component, whether to include them when exporting client data.
|
java.lang.String |
getFetchOperation()
Operation ID this component should use when performing fetch operations.
|
DSRequest |
getFetchRequestProperties()
If
autoFetchData is true , this
attribute allows the developer to declaratively specify DSRequest properties for the
initial fetchData() call. |
FormItem |
getField(java.lang.String name)
Retrieve a field from this form by
name . |
FormItem |
getField(java.lang.String name,
java.lang.Boolean forceCreation)
Retrieve a field from this form by
name . |
Alignment[] |
getFieldAlignments()
Returna an array of field alignments for this grid
|
int |
getFieldCount()
Return the number of fields.
|
java.lang.String[] |
getFieldErrors(java.lang.String fieldName)
Returns any validation errors for some field in this valuesManager.
|
FormItem[] |
getFields()
Return the form fields.
|
FormItem[] |
getFields(java.lang.Boolean forceCreation)
Return the form fields.
|
com.google.gwt.core.client.JavaScriptObject[] |
getFieldsAsJavaScriptObjects()
Return the fields as JavaScriptObjects rather than as SmartGWT Java wrappers of the field
class type
(e.g.
|
java.lang.String |
getFileAccessFailedWarning()
Warning to display to the user if a selected file in an UploadItem cannot be accessed.
|
java.lang.Boolean |
getFixedColWidths()
If true, we ensure that column widths are at least as large as you specify them.
|
FormItem |
getFocusItem()
Return the current focus item for this form.
|
java.lang.String |
getFormSubmitFailedWarning()
Deprecated.
|
java.lang.String |
getHiliteProperty()
Marker that can be set on a record to flag that record as hilited.
|
java.lang.Boolean |
getHiliteRequiredFields()
Indicates whether the titles of required items in this form should use the special prefix and suffix specified by the
requiredTitlePrefix and requiredTitleSuffix attributes, instead of the
standard prefix and suffix. |
Hilite[] |
getHilites()
Return the set of hilite-objects currently applied to this DataBoundComponent.
|
java.lang.String |
getHiliteState()
Get the current hilites encoded as a String, for saving.
|
Criteria |
getImplicitCriteria()
Criteria that are never shown to or edited by the user and are cumulative with any
criteria provided via
DataBoundComponent.initialCriteria ,
DataBoundComponent.setCriteria() etc. |
java.lang.Boolean |
getImplicitSave()
When true, indicates that changes to items in this form will be automatically saved on a
delay , as well as when the entire form is submitted. |
int |
getImplicitSaveDelay()
When
implicitSave is true, this attribute dictates
the millisecond delay after which form items are automatically saved during editing. |
java.lang.Boolean |
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.
|
Criteria |
getInitialCriteria()
Criteria to use when
DataBoundComponent.setAutoFetchData(Boolean) is used. |
SortSpecifier[] |
getInitialSort()
An array of
SortSpecifier objects used to set up the initial sort configuration for
this form. |
FormItem |
getItem(java.lang.String name)
Retrieve a FormItem in this form by
name
or dataPath . |
Alignment |
getItemHoverAlign()
Text alignment for hovers shown for items
|
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?
|
java.lang.Integer |
getItemHoverHeight()
A default height for hovers shown for items
|
java.lang.String |
getItemHoverHeightAsString()
A default height for hovers shown for items
|
java.lang.Integer |
getItemHoverOpacity()
Opacity for hovers shown for items
|
java.lang.String |
getItemHoverStyle()
CSS Style for hovers shown for items
|
java.lang.Integer |
getItemHoverVAlign()
Vertical text alignment for hovers shown for items
|
java.lang.String |
getItemHoverVAlignAsString()
Vertical text alignment for hovers shown for items
|
java.lang.Integer |
getItemHoverWidth()
A default width for hovers shown for items
|
java.lang.String |
getItemHoverWidthAsString()
A default width for hovers shown for items
|
FormLayoutType |
getItemLayout()
Layout style to use with this form.
|
java.lang.Boolean |
getLinearAutoSpanItems()
When a form is rendered in
linearMode , should each
item appear on its own row, spanning the full set of rendered columns by default? |
java.lang.Boolean |
getLinearMode()
Switches the entire form to render in a style that is typical for form on a mobile device with one
FormItem per row. |
java.lang.Integer |
getLinearNumCols()
Specifies the
number of columns when the form is being
rendered in linearMode , overriding any automatically
derived value in that mode. |
boolean |
getLinearOnMobile()
Switches the entire form to render in a style that is typical for form on a
handset device with one FormItem per row by automatically defaulting linearMode to true on handsets. |
com.smartgwt.logicalstructure.core.LogicalStructureObject |
getLogicalStructure()
Getter implementing the
LogicalStructure interface,
which supports Eclipse's logical structure debugging facility. |
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 type
this.longTextEditorType (a TextAreaItem by default), rather than a simple
text item. |
java.lang.String |
getLongTextEditorType()
Name of the Form Item class to use for text fields which exceed the longTextEditorThreshold for this form.
|
FormMethod |
getMethod()
The mechanism by which form data is sent to the action URL.
|
int |
getMinColWidth()
Minimum width of a form column.
|
java.lang.Integer |
getMinHintWidth()
Minimum horizontal space made available for
FormItem.hint text. |
java.lang.String |
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
|
int |
getNumCols()
The number of columns of titles and items in this form's layout grid.
|
java.util.Map |
getOldValues()
Returns the set of values last stored by
DynamicForm.rememberValues . |
OperatorId |
getOperator()
When
FormItem.operator has been set for any FormItem in this form, what logical operator should be applied across the
criteria produced by the form items? Only applicable to forms that have a
dataSource . |
static DynamicForm |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
java.lang.String |
getOriginalValueMessage()
Default template HTML string when an item does not set its own
FormItem.originalValueMessage . |
java.lang.Boolean |
getPreventDuplicates()
If set, detect and prevent duplicate records from being transferred to this component, either via
drag and drop or via
DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent) . |
java.lang.Boolean |
getProgressiveLoading()
Indicates whether or not this component will load its data
progressively |
ReadOnlyDisplayAppearance |
getReadOnlyDisplay()
If
canEdit is set to false , how should the
items in this form be displayed to the user? |
java.lang.String |
getReadOnlyTextBoxStyle()
Default
FormItem.readOnlyTextBoxStyle
setting for items in this form. |
int |
getRecordIndex(Record record)
Get the index of the provided record.
|
RecordList |
getRecordList()
Return the underlying data of this DataBoundComponent as a
RecordList . |
java.lang.Boolean |
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.
|
java.lang.String |
getRemoveOperation()
operationId this component
should use when performing remove operations. |
java.lang.String |
getRequiredMessage()
The required message for required field errors.
|
java.lang.String |
getRequiredRightTitlePrefix()
The string pre-pended to the title of every required item in this form if
hiliteRequiredFields is true and the TitleOrientation property is set to "right". |
java.lang.String |
getRequiredRightTitleSuffix()
The string appended to the title of every required item in this form if
hiliteRequiredFields is true and the TitleOrientation property is set to "right". |
java.lang.String |
getRequiredTitlePrefix()
The string pre-pended to the title of every required item in this form if
hiliteRequiredFields is true. |
java.lang.String |
getRequiredTitleSuffix()
The string appended to the title of every required item in this form if
hiliteRequiredFields is true. |
ResultSet |
getResultSet()
Return the underlying data of this DataBoundComponent as a
ResultSet . |
KeyIdentifier |
getRevertValueKey()
Keyboard shortcut that causes the value of the currently focused form item to be reverted to whatever value would be
shown if
resetValues() were called. |
java.lang.String |
getRightTitlePrefix()
The string pre-pended to the title of an item in this form if its titleOrientation property is set to "right".
|
java.lang.String |
getRightTitleSuffix()
The string appended to the title of an item in this form if its titleOrientation property is set to "right".
|
java.lang.String |
getSavedSearchId()
Optional identifier for saved searches that should be applied to this component.
|
java.lang.Boolean |
getSaveOnEnter()
If
true , 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 the submit() method. |
DSOperationType |
getSaveOperationType()
Default
DSOperationType to be performed when saveData() is called. |
DSOperationType |
getSaveOperationType(DSRequest requestProperties)
Default
DSOperationType to be performed when DynamicForm.saveData is called. |
VisibilityMode |
getSectionVisibilityMode()
If the form has sections, [implemented as
SectionItem s], this attribute
controls whether multiple sections can be expanded at once. |
java.lang.Boolean |
getSelectOnClick()
If this property is set to true, whenever a text-based field in this form (
TextItem , TextAreaItem ) is
given focus - whether programmatically (see focusInItem() ), or via a mouse click, all text within the item will be selected. |
java.lang.Boolean |
getSelectOnFocus()
If this property is set to true, whenever a text-based field in this form (
TextItem , TextAreaItem ) is
given focus programmatically (see focusInItem() ), all
text within the item will be selected. |
java.lang.Boolean |
getShowComplexFields()
Whether to show fields of non-atomic types when a DataBoundComponent is given a
DataSource but no
component.fields .
|
java.lang.Boolean |
getShowComplexFieldsRecursively()
If set, this
DynamicForm will set both showComplexFields and
showComplexFieldsRecursively on any nested component used for showing/editing a complex field. |
java.lang.Boolean |
getShowDeletions()
Default
FormItem.showDeletions setting for
items in this form. |
java.lang.Boolean |
getShowDetailFields()
For databound forms, whether to show fields marked as detail fields.
|
java.lang.Boolean |
getShowErrorIcons()
showErrorIcons , showErrorText , errorOrientation , and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
java.lang.Boolean |
getShowErrorStyle()
showErrorIcons , showErrorText , errorOrientation , and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
java.lang.Boolean |
getShowErrorText()
showErrorIcons , showErrorText , errorOrientation , and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
java.lang.Boolean |
getShowHiddenFields()
Whether to show fields marked
hidden:true when a DataBoundComponent is given a
DataSource but no component.fields .
|
boolean |
getShowImageAsURL()
For fields of
type:"image" , if the field is non editable, and being
displayed with readOnlyDisplay:"static" ,
should the value (URL) be displayed as text, or should an image be rendered? |
java.lang.Boolean |
getShowInlineErrors()
If true, field errors are written into the form next to the item(s) where the errors occurred.
|
java.lang.Boolean |
getShowOldValueInHover()
Default setting for the form items'
FormItem.showOldValueInHover setting. |
java.lang.Boolean |
getShowPending()
This property applies to all of the items that a form has, and works according to
FormItem.showPending . |
boolean |
getShowSavedSearchesByDS()
Whether to associate saved searches by default with the current
DataSource
of a component when a
savedSearchId is
not provided. |
java.lang.Boolean |
getShowTitlesWithErrorMessages()
Indicates whether on validation failure, the error message displayed to the user should be pre-pended with the
title for the item.
|
static java.lang.Boolean |
getSkipConversionOnMapping()
Returns true if the system is set to skip conversion of the Javascript object to a Java Map when
calling the mapDisplayToValue() API.
|
SortSpecifier[] |
getSort()
Returns the current
SortSpecifiers for
this component. |
java.lang.Boolean |
getSparseFieldState()
If true,
ListGrid.getFieldState() and
ListGrid.setFieldState(java.lang.String) will omit state
information for hidden fields by default. |
java.lang.Boolean |
getStopOnError()
Indicates that if validation fails, the user should not be allowed to exit the field - focus will be forced back into
the field until the error is corrected.
|
java.lang.Boolean |
getStoreDisplayValues()
For editable fields with a specified
FormItem.displayField and FormItem.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 using local display field values - typically
foreignKey fields where the display field is included from another dataSource. |
boolean |
getSuppressBrowserClearIcons()
Default
TextItem.suppressBrowserClearIcon value for TextItems within this form. |
java.lang.Boolean |
getSuppressValidationErrorCallback()
When calling
saveData() on a form or valuesManager, by
default if the server returns an error code, any callback passed into saveData() will not be fired. |
java.lang.Boolean |
getSynchronousValidation()
If enabled, whenever validation is triggered and a request to the server is required, user interactivity will be blocked
until the request returns.
|
java.lang.String |
getTarget()
The name of a window or frame that will receive the results returned by the form's action.
|
TimeDisplayFormat |
getTimeFormatter()
Default
TimeDisplayFormat for type:"time" field values displayed in this form. |
Alignment |
getTitleAlign()
Default alignment for item titles.
|
java.lang.String |
getTitleField()
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 check titleField for databound
components.For non databound components returns the first defined field name of "title" ,
"name" , or "id" . |
java.lang.String |
getTitleFieldValue(Record record)
Get the value of the titleField for the passed record
|
TitleOrientation |
getTitleOrientation()
Default orientation for titles for items in this form.
|
java.lang.String |
getTitlePrefix()
The string pre-pended to the title of every item in this form.
|
java.lang.String |
getTitleSuffix()
The string appended to the title of every item in this form.
|
java.lang.String |
getUnknownErrorMessage()
The error message for a failed validator that does not specify its own errorMessage.
|
java.lang.String |
getUpdateOperation()
operationId this component
should use when performing update operations. |
java.lang.Boolean |
getUseAllDataSourceFields()
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.
|
java.lang.Boolean |
getUseFlatFields()
The
useFlatFields flag causes all simple type fields anywhere in a nested
set of DataSources to be exposed as a flat list for form binding. |
UserTask |
getUserTask()
Associated userTask if current dynamic form used along with workflow.
|
java.lang.Boolean |
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.
|
java.lang.Boolean |
getValidateOnExit()
If true, form items will be validated when each item's "editorExit" handler is fired as well as when the entire form is
submitted or validated.
|
java.lang.String |
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.
|
java.lang.Object |
getValue(java.lang.String fieldName) |
java.lang.String |
getValueAsString(java.lang.String fieldName) |
java.util.Map |
getValues()
An Object containing the initial 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. |
AdvancedCriteria |
getValuesAsAdvancedCriteria()
Return an AdvancedCriteria object based on the current set of values within this form.
|
AdvancedCriteria |
getValuesAsAdvancedCriteria(TextMatchStyle textMatchStyle)
Return an AdvancedCriteria object based on the current set of values within this form.
|
Criteria |
getValuesAsCriteria()
Return search criteria based on the current set of values within this form.
|
Record |
getValuesAsRecord()
Return the current set of values within this form as a Record.
|
ValuesManager |
getValuesManager()
Return the ValuesManager for this form.
|
java.lang.Boolean |
getWrapHintText()
Should items within this form that are showing a
FormItem.hint have the hint text wrap? May be overridden at the item level via FormItem.wrapHintText . |
java.lang.Boolean |
getWrapItemTitles()
Whether titles for form items should wrap.
|
java.lang.Boolean |
hasErrors()
Returns whether there are currently any errors visible to the user for this form, without performing validation.
|
java.lang.Boolean |
hasFieldErrors(java.lang.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 |
hideItem(java.lang.String itemName)
Hide a form item via
FormItem.hide() |
void |
invalidateCache()
Invalidate the current data cache for this databound component via a call to the dataset's
invalidateCache() method, for example,
ResultSet.invalidateCache() . |
java.lang.Boolean |
isFocused()
Returns true if this DynamicForm has the keyboard focus.
|
java.lang.Boolean |
isNewRecord()
Returns true if
saveOperationType is currently
"add". |
java.lang.Boolean |
isPendingAsyncValidation()
Is this component waiting for an asynchronous validation to complete? This method will return true after
validate() is called on a component with server-side validators
for some field(s), until the server responds. |
protected void |
onInit_DynamicForm() |
protected void |
onInit() |
com.google.gwt.core.client.JavaScriptObject |
rememberValues()
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 time
setValues() or rememberValues() was called. |
void |
resetValues()
Same as
reset() . |
void |
saveData()
Validate and then save the form's current values to the
DataSource 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 the
DataSource this form is bound
to. |
void |
selectAllRecords()
Select all records
|
void |
selectRecord(int record)
Select/deselect a
Record passed in explicitly, or by index. |
void |
selectRecord(int record,
boolean newState)
Select/deselect a
Record passed in explicitly, or by index. |
void |
selectRecord(Record record)
Select/deselect a
Record passed in explicitly, or by index. |
void |
selectRecord(Record record,
boolean newState)
Select/deselect a
Record passed in explicitly, or by index. |
void |
selectRecords(int[] records)
Select/deselect a list of
Record s passed in explicitly, or by index. |
void |
selectRecords(int[] records,
boolean newState)
Select/deselect a list of
Record s passed in explicitly, or by index. |
void |
selectRecords(Record[] records)
Select/deselect a list of
Record s passed in explicitly, or by index. |
void |
selectRecords(Record[] records,
boolean newState)
Select/deselect a list of
Record s passed in explicitly, or by index. |
DynamicForm |
setAction(java.lang.String action)
The URL to which the form will submit its values.
|
DynamicForm |
setAddDropValues(java.lang.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.
|
DynamicForm |
setAddFormulaFieldText(java.lang.String addFormulaFieldText)
Text for a menu item allowing users to add a formula field
|
DynamicForm |
setAddOperation(java.lang.String addOperation)
operationId this component
should use when performing add operations. |
DynamicForm |
setAddSummaryFieldText(java.lang.String addSummaryFieldText)
Text for a menu item allowing users to add a formula field
|
DynamicForm |
setAllowExpressions(java.lang.Boolean allowExpressions)
For a form that produces filter criteria (see
form.getValuesAsCriteria() ), allows the user to enter simple expressions in any field in this form that takes text
input. |
DynamicForm |
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. |
DynamicForm |
setAutoFetchAsFilter(java.lang.Boolean autoFetchAsFilter)
If
DataBoundComponent.setAutoFetchData(Boolean) is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData() or DataBoundComponent.filterData() |
DynamicForm |
setAutoFetchData(java.lang.Boolean autoFetchData)
If true, when this component is first drawn, automatically call
DataBoundComponent.fetchData() or DataBoundComponent.filterData() depending on
DataBoundComponent.getAutoFetchAsFilter() . |
DynamicForm |
setAutoFetchTextMatchStyle(TextMatchStyle autoFetchTextMatchStyle)
If
autoFetchData is true , this attribute allows the developer to specify a textMatchStyle
for the initial DataBoundComponent.fetchData() call. |
DynamicForm |
setAutoFocus(java.lang.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 call dynamicForm.focusInItem(itemName) |
DynamicForm |
setAutoFocusOnError(java.lang.Boolean autoFocusOnError)
If true, when
validation fails focus will automatically be
put into the first focusable field which failed validation. |
DynamicForm |
setBrowserSpellCheck(java.lang.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 via
FormItem.browserSpellCheck |
DynamicForm |
setCanAddFormulaFields(java.lang.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
com.smartgwt.client..FormulaBuilder .
|
DynamicForm |
setCanAddSummaryFields(java.lang.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
com.smartgwt.client..SummaryBuilder .
|
DynamicForm |
setCanEdit(java.lang.Boolean canEdit)
If set to
false , the form will be marked read-only. |
DynamicForm |
setCanEditFieldAttribute(java.lang.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.
|
DynamicForm |
setCanFocus(java.lang.Boolean canFocus)
DynamicForms are considered to have focus if any of their form items have focus.
|
DynamicForm |
setCanSubmit(java.lang.Boolean canSubmit)
Governs whether this form will be used to perform a standard HTML form submission.
|
DynamicForm |
setCanTabToIcons(java.lang.Boolean canTabToIcons)
Should users be able to tab into the
icons and picker icon for items within this form by default? |
DynamicForm |
setCanTabToSectionHeaders(java.lang.Boolean canTabToSectionHeaders)
If true, the headers for any
SectionItems will
be included in the page's tab order for accessibility. |
DynamicForm |
setCellBorder(int cellBorder)
Width of border for the table that form is drawn in.
|
DynamicForm |
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.
use
setCellPadding(int) instead |
DynamicForm |
setCheckFileAccessOnSubmit(boolean checkFileAccessOnSubmit)
For dynamicForms containing a
FileItem for uploading files, should the
browser verify that the file is accessible before submitting the uploaded file to the server? |
DynamicForm |
setClipItemTitles(boolean clipItemTitles)
Should the titles for form items be clipped if they are too large for the available space?
|
DynamicForm |
setClipStaticValue(java.lang.Boolean clipStaticValue)
Default
FormItem.clipStaticValue setting for
items in this form. |
void |
setColWidths(java.lang.Object... colWidths)
An array of widths for the columns of items in this form's layout grid.
|
DynamicForm |
setDataArity(java.lang.String dataArity)
A DynamicForm is a
dataArity :single component. |
DynamicForm |
setDataFetchMode(FetchMode dataFetchMode)
How to fetch and manage records retrieve from the server.
|
DynamicForm |
setDataPageSize(int dataPageSize)
When using
data
paging , how many records to fetch at a time. |
DynamicForm |
setDataSource(DataSource dataSource)
The DataSource that this component should bind to for default fields and for performing
DataSource requests . |
void |
setDataSource(DataSource dataSource,
FormItem... fields)
Bind to a DataSource.
|
DynamicForm |
setDataSource(java.lang.String dataSource)
The DataSource that this component should bind to for default fields and for performing
DataSource requests . |
DynamicForm |
setDateFormatter(DateDisplayFormat dateFormatter)
Default
DateDisplayFormat for Date type values displayed in this form. |
DynamicForm |
setDatetimeFormatter(DateDisplayFormat datetimeFormatter)
Default
DateDisplayFormat for Date type values displayed in this form in fields of
type datetime . |
DynamicForm |
setDeepCloneOnEdit(java.lang.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.
|
DynamicForm |
setDefaultSearchOperator(OperatorId defaultSearchOperator)
Default
search operator to use for fields in a form that produces AdvancedCriteria . |
DynamicForm |
setDisableValidation(java.lang.Boolean disableValidation)
If set to true, client-side validators will not run on the form when validate() is called.
|
DynamicForm |
setDragDataAction(DragDataAction dragDataAction)
Indicates what to do with data dragged into another DataBoundComponent.
|
DynamicForm |
setDragDataCustomizer(DragDataCustomizer customizer)
During a drag-and-drop interaction, this method returns the set of records being dragged
out of the component.
|
DynamicForm |
setDragTrackerStyle(java.lang.String dragTrackerStyle)
CSS Style to apply to the drag tracker when dragging occurs on this component.
|
DynamicForm |
setDropValues(java.util.Map dropValues)
When an item is dropped on this component, and
addDropValues 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. |
DynamicForm |
setDuplicateDragMessage(java.lang.String duplicateDragMessage)
Message to show when a user attempts to transfer duplicate records into this component, and
preventDuplicates
is enabled. |
DynamicForm |
setEditFormulaFieldText(java.lang.String editFormulaFieldText)
Text for a menu item allowing users to edit a formula field
|
DynamicForm |
setEditProxyConstructor(java.lang.String editProxyConstructor)
Default class used to construct the
EditProxy for this component when the component is
first placed into edit mode . |
DynamicForm |
setEditSummaryFieldText(java.lang.String editSummaryFieldText)
Text for a menu item allowing users to edit the formatter for a field
|
DynamicForm |
setEncoding(Encoding encoding)
encoding for the form, use MULTIPART_ENCODING for file upload forms
|
DynamicForm |
setErrorItemCellStyle(java.lang.String errorItemCellStyle)
If
showInlineErrors 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 |
setErrors(java.util.Map errors,
boolean showErrors)
Setter for validation errors on this form.
|
DynamicForm |
setErrorsPreamble(java.lang.String errorsPreamble)
If
showInlineErrors is false , all
errors for the items in the form are rendered as a single item at the top of the form. |
DynamicForm |
setExportAll(java.lang.Boolean exportAll)
Setting exportAll to true prevents the component from passing its list of fields to the
export call.
|
DynamicForm |
setExportFields(java.lang.String[] exportFields)
The list of field-names to export.
|
DynamicForm |
setExportIncludeSummaries(java.lang.Boolean exportIncludeSummaries)
If Summary rows exist for this component, whether to include them when exporting client data.
|
DynamicForm |
setFetchOperation(java.lang.String fetchOperation)
Operation ID this component should use when performing fetch operations.
|
DynamicForm |
setFetchRequestProperties(DSRequest fetchRequestProperties)
If
autoFetchData is true , this
attribute allows the developer to declaratively specify DSRequest properties for the
initial fetchData() call. |
void |
setFieldErrors(java.lang.String fieldName,
java.lang.String[] errors,
boolean showErrors)
Set field validation errors for some field.
|
void |
setFieldErrors(java.lang.String fieldName,
java.lang.String error,
boolean showErrors)
Set field validation error for some field.
|
void |
setFields(FormItem... fields)
An array of field objects, specifying the order, layout, and types of each field in the
DynamicForm.
|
DynamicForm |
setFields(com.google.gwt.core.client.JavaScriptObject... fields)
Field setter variant (alternative to
setFields(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. |
DynamicForm |
setFileAccessFailedWarning(java.lang.String fileAccessFailedWarning)
Warning to display to the user if a selected file in an UploadItem cannot be accessed.
|
DynamicForm |
setFixedColWidths(java.lang.Boolean fixedColWidths)
If true, we ensure that column widths are at least as large as you specify them.
|
DynamicForm |
setFormSubmitFailedWarning(java.lang.String formSubmitFailedWarning)
Deprecated.
|
DynamicForm |
setHiliteProperty(java.lang.String hiliteProperty)
Marker that can be set on a record to flag that record as hilited.
|
DynamicForm |
setHiliteRequiredFields(java.lang.Boolean hiliteRequiredFields)
Indicates whether the titles of required items in this form should use the special prefix and suffix specified by the
requiredTitlePrefix and requiredTitleSuffix attributes, instead of the
standard prefix and suffix. |
DynamicForm |
setHilites(Hilite[] hilites)
Accepts an array of hilite objects and applies them to this DataBoundComponent.
|
DynamicForm |
setHiliteState(java.lang.String hiliteState)
Set the current hilites based on a hiliteState String previously returned from getHilitesState.
|
DynamicForm |
setImplicitCriteria(Criteria implicitCriteria)
Criteria that are never shown to or edited by the user and are cumulative with any
criteria provided via
DataBoundComponent.initialCriteria ,
DataBoundComponent.setCriteria() etc. |
java.lang.Boolean |
setImplicitCriteria(Criteria implicitCriteria,
DSCallback callback) |
java.lang.Boolean |
setImplicitCriteria(Criteria criteria,
DSCallback callback,
java.lang.Boolean initialFetch) |
DynamicForm |
setImplicitSave(java.lang.Boolean implicitSave)
When true, indicates that changes to items in this form will be automatically saved on a
delay , as well as when the entire form is submitted. |
DynamicForm |
setImplicitSaveDelay(int implicitSaveDelay)
When
implicitSave is true, this attribute dictates
the millisecond delay after which form items are automatically saved during editing. |
DynamicForm |
setImplicitSaveOnBlur(java.lang.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.
|
DynamicForm |
setInitialCriteria(Criteria initialCriteria)
Criteria to use when
DataBoundComponent.setAutoFetchData(Boolean) is used. |
DynamicForm |
setInitialSort(SortSpecifier... initialSort)
An array of
SortSpecifier objects used to set up the initial sort configuration for
this form. |
DynamicForm |
setItemHoverAlign(Alignment itemHoverAlign)
Text alignment for hovers shown for items
|
DynamicForm |
setItemHoverDelay(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.
|
DynamicForm |
setItemHoverHeight(java.lang.Integer itemHoverHeight)
A default height for hovers shown for items
|
DynamicForm |
setItemHoverHeight(java.lang.String itemHoverHeight)
A default height for hovers shown for items
|
DynamicForm |
setItemHoverOpacity(java.lang.Integer itemHoverOpacity)
Opacity for hovers shown for items
|
DynamicForm |
setItemHoverStyle(java.lang.String itemHoverStyle)
CSS Style for hovers shown for items
|
DynamicForm |
setItemHoverVAlign(java.lang.Integer itemHoverVAlign)
Vertical text alignment for hovers shown for items
|
DynamicForm |
setItemHoverVAlign(java.lang.String itemHoverVAlign)
Vertical text alignment for hovers shown for items
|
DynamicForm |
setItemHoverWidth(java.lang.Integer itemHoverWidth)
A default width for hovers shown for items
|
DynamicForm |
setItemHoverWidth(java.lang.String itemHoverWidth)
A default width for hovers shown for items
|
DynamicForm |
setItemLayout(FormLayoutType itemLayout)
Layout style to use with this form.
|
void |
setItems(FormItem... items)
|
void |
setItemTitleHoverFormatter(FormItemHoverFormatter hoverFormatter)
The
FormItemHoverFormatter 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)
The
FormItemHoverFormatter 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. |
DynamicForm |
setLinearAutoSpanItems(java.lang.Boolean linearAutoSpanItems)
When a form is rendered in
linearMode , should each
item appear on its own row, spanning the full set of rendered columns by default? |
DynamicForm |
setLinearMode(java.lang.Boolean linearMode)
Switches the entire form to render in a style that is typical for form on a mobile device with one
FormItem per row. |
DynamicForm |
setLinearNumCols(java.lang.Integer linearNumCols)
Specifies the
number of columns when the form is being
rendered in linearMode , overriding any automatically
derived value in that mode. |
DynamicForm |
setLinearOnMobile(boolean linearOnMobile)
Switches the entire form to render in a style that is typical for form on a
handset device with one FormItem per row by automatically defaulting linearMode to true on handsets. |
com.smartgwt.logicalstructure.core.LogicalStructureObject |
setLogicalStructure(com.smartgwt.logicalstructure.widgets.form.DynamicFormLogicalStructure s)
Setter implementing the
LogicalStructure interface,
which supports Eclipse's logical structure debugging facility. |
DynamicForm |
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 type
this.longTextEditorType (a TextAreaItem by default), rather than a simple
text item. |
DynamicForm |
setLongTextEditorType(java.lang.String longTextEditorType)
Name of the Form Item class to use for text fields which exceed the longTextEditorThreshold for this form.
|
DynamicForm |
setMethod(FormMethod method)
The mechanism by which form data is sent to the action URL.
|
DynamicForm |
setMinColWidth(int minColWidth)
Minimum width of a form column.
|
DynamicForm |
setMinHintWidth(java.lang.Integer minHintWidth)
Minimum horizontal space made available for
FormItem.hint text. |
DynamicForm |
setNoErrorDetailsMessage(java.lang.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
message
|
DynamicForm |
setNumCols(int numCols)
The number of columns of titles and items in this form's layout grid.
|
DynamicForm |
setOperator(OperatorId operator)
When
FormItem.operator has been set for any FormItem in this form, what logical operator should be applied across the
criteria produced by the form items? Only applicable to forms that have a
dataSource . |
DynamicForm |
setOriginalValueMessage(java.lang.String originalValueMessage)
Default template HTML string when an item does not set its own
FormItem.originalValueMessage . |
DynamicForm |
setPreventDuplicates(java.lang.Boolean preventDuplicates)
If set, detect and prevent duplicate records from being transferred to this component, either via
drag and drop or via
DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent) . |
DynamicForm |
setProgressiveLoading(java.lang.Boolean progressiveLoading)
Indicates whether or not this component will load its data
progressively |
DynamicForm |
setReadOnlyDisplay(ReadOnlyDisplayAppearance readOnlyDisplay)
If
canEdit is set to false , how should the
items in this form be displayed to the user? |
DynamicForm |
setReadOnlyTextBoxStyle(java.lang.String readOnlyTextBoxStyle)
Default
FormItem.readOnlyTextBoxStyle
setting for items in this form. |
DynamicForm |
setRejectInvalidValueOnChange(java.lang.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.
|
DynamicForm |
setRemoveOperation(java.lang.String removeOperation)
operationId this component
should use when performing remove operations. |
DynamicForm |
setRequiredMessage(java.lang.String requiredMessage)
The required message for required field errors.
|
DynamicForm |
setRequiredRightTitlePrefix(java.lang.String requiredRightTitlePrefix)
The string pre-pended to the title of every required item in this form if
hiliteRequiredFields is true and the TitleOrientation property is set to "right". |
DynamicForm |
setRequiredRightTitleSuffix(java.lang.String requiredRightTitleSuffix)
The string appended to the title of every required item in this form if
hiliteRequiredFields is true and the TitleOrientation property is set to "right". |
DynamicForm |
setRequiredTitlePrefix(java.lang.String requiredTitlePrefix)
The string pre-pended to the title of every required item in this form if
hiliteRequiredFields is true. |
DynamicForm |
setRequiredTitleSuffix(java.lang.String requiredTitleSuffix)
The string appended to the title of every required item in this form if
hiliteRequiredFields is true. |
DynamicForm |
setRevertValueKey(KeyIdentifier revertValueKey)
Keyboard shortcut that causes the value of the currently focused form item to be reverted to whatever value would be
shown if
resetValues() were called. |
DynamicForm |
setRightTitlePrefix(java.lang.String rightTitlePrefix)
The string pre-pended to the title of an item in this form if its titleOrientation property is set to "right".
|
DynamicForm |
setRightTitleSuffix(java.lang.String rightTitleSuffix)
The string appended to the title of an item in this form if its titleOrientation property is set to "right".
|
DynamicForm |
setSavedSearchId(java.lang.String savedSearchId)
Optional identifier for saved searches that should be applied to this component.
|
DynamicForm |
setSaveOnEnter(java.lang.Boolean saveOnEnter)
If
true , 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 the submit() method. |
DynamicForm |
setSaveOperationType(DSOperationType saveOperationType)
Default
DSOperationType to be performed when saveData() is called. |
DynamicForm |
setSectionVisibilityMode(VisibilityMode sectionVisibilityMode)
If the form has sections, [implemented as
SectionItem s], this attribute
controls whether multiple sections can be expanded at once. |
DynamicForm |
setSelectOnClick(java.lang.Boolean selectOnClick)
If this property is set to true, whenever a text-based field in this form (
TextItem , TextAreaItem ) is
given focus - whether programmatically (see focusInItem() ), or via a mouse click, all text within the item will be selected. |
DynamicForm |
setSelectOnFocus(java.lang.Boolean selectOnFocus)
If this property is set to true, whenever a text-based field in this form (
TextItem , TextAreaItem ) is
given focus programmatically (see focusInItem() ), all
text within the item will be selected. |
DynamicForm |
setShowComplexFields(java.lang.Boolean showComplexFields)
Whether to show fields of non-atomic types when a DataBoundComponent is given a
DataSource but no
component.fields .
|
DynamicForm |
setShowComplexFieldsRecursively(java.lang.Boolean showComplexFieldsRecursively)
If set, this
DynamicForm will set both showComplexFields and
showComplexFieldsRecursively on any nested component used for showing/editing a complex field. |
DynamicForm |
setShowDeletions(java.lang.Boolean showDeletions)
Default
FormItem.showDeletions setting for
items in this form. |
DynamicForm |
setShowDetailFields(java.lang.Boolean showDetailFields)
For databound forms, whether to show fields marked as detail fields.
|
DynamicForm |
setShowErrorIcons(java.lang.Boolean showErrorIcons)
showErrorIcons , showErrorText , errorOrientation , and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
DynamicForm |
setShowErrorStyle(java.lang.Boolean showErrorStyle)
showErrorIcons , showErrorText , errorOrientation , and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
DynamicForm |
setShowErrorText(java.lang.Boolean showErrorText)
showErrorIcons , showErrorText , errorOrientation , and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
DynamicForm |
setShowHiddenFields(java.lang.Boolean showHiddenFields)
Whether to show fields marked
hidden:true when a DataBoundComponent is given a
DataSource but no component.fields .
|
DynamicForm |
setShowImageAsURL(boolean showImageAsURL)
For fields of
type:"image" , if the field is non editable, and being
displayed with readOnlyDisplay:"static" ,
should the value (URL) be displayed as text, or should an image be rendered? |
DynamicForm |
setShowInlineErrors(java.lang.Boolean showInlineErrors)
If true, field errors are written into the form next to the item(s) where the errors occurred.
|
DynamicForm |
setShowOldValueInHover(java.lang.Boolean showOldValueInHover)
Default setting for the form items'
FormItem.showOldValueInHover setting. |
DynamicForm |
setShowPending(java.lang.Boolean showPending)
This property applies to all of the items that a form has, and works according to
FormItem.showPending . |
DynamicForm |
setShowSavedSearchesByDS(boolean showSavedSearchesByDS)
Whether to associate saved searches by default with the current
DataSource
of a component when a
savedSearchId is
not provided. |
DynamicForm |
setShowTitlesWithErrorMessages(java.lang.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(java.lang.Boolean convert)
Call this method passing true to skip conversion of the Javascript object to a Java Map when
calling the mapDisplayToValue() API.
|
DynamicForm |
setSort(SortSpecifier... sortSpecifiers)
Sort the component on one or more fields.
|
DynamicForm |
setSparseFieldState(java.lang.Boolean sparseFieldState)
If true,
ListGrid.getFieldState() and
ListGrid.setFieldState(java.lang.String) will omit state
information for hidden fields by default. |
DynamicForm |
setStopOnError(java.lang.Boolean stopOnError)
Indicates that if validation fails, the user should not be allowed to exit the field - focus will be forced back into
the field until the error is corrected.
|
DynamicForm |
setStoreDisplayValues(java.lang.Boolean storeDisplayValues)
For editable fields with a specified
FormItem.displayField and FormItem.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 using local display field values - typically
foreignKey fields where the display field is included from another dataSource. |
DynamicForm |
setSuppressBrowserClearIcons(boolean suppressBrowserClearIcons)
Default
TextItem.suppressBrowserClearIcon value for TextItems within this form. |
DynamicForm |
setSuppressValidationErrorCallback(java.lang.Boolean suppressValidationErrorCallback)
When calling
saveData() on a form or valuesManager, by
default if the server returns an error code, any callback passed into saveData() will not be fired. |
DynamicForm |
setSynchronousValidation(java.lang.Boolean synchronousValidation)
If enabled, whenever validation is triggered and a request to the server is required, user interactivity will be blocked
until the request returns.
|
DynamicForm |
setTarget(java.lang.String target)
The name of a window or frame that will receive the results returned by the form's action.
|
DynamicForm |
setTimeFormatter(TimeDisplayFormat timeFormatter)
Default
TimeDisplayFormat for type:"time" field values displayed in this form. |
DynamicForm |
setTitleAlign(Alignment titleAlign)
Default alignment for item titles.
|
DynamicForm |
setTitleField(java.lang.String titleField)
Sets the best field to use for a user-visible title for an individual record from this component.
|
DynamicForm |
setTitleOrientation(TitleOrientation titleOrientation)
Default orientation for titles for items in this form.
|
DynamicForm |
setTitlePrefix(java.lang.String titlePrefix)
The string pre-pended to the title of every item in this form.
|
DynamicForm |
setTitleSuffix(java.lang.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(java.lang.String titleWidth)
The width in pixels allocated to the title of every item in this form.
|
DynamicForm |
setUnknownErrorMessage(java.lang.String unknownErrorMessage)
The error message for a failed validator that does not specify its own errorMessage.
|
DynamicForm |
setUpdateOperation(java.lang.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.
|
DynamicForm |
setUseAllDataSourceFields(java.lang.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.
|
DynamicForm |
setUseFlatFields(java.lang.Boolean useFlatFields)
The
useFlatFields flag causes all simple type fields anywhere in a nested
set of DataSources to be exposed as a flat list for form binding. |
DynamicForm |
setUserTask(UserTask userTask)
Associated userTask if current dynamic form used along with workflow.
|
DynamicForm |
setValidateOnChange(java.lang.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.
|
DynamicForm |
setValidateOnExit(java.lang.Boolean validateOnExit)
If true, form items will be validated when each item's "editorExit" handler is fired as well as when the entire form is
submitted or validated.
|
DynamicForm |
setValidationURL(java.lang.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 |
setValue(java.lang.String fieldName,
boolean value)
Set the value for some field.
|
void |
setValue(java.lang.String fieldName,
DataClass value)
Set the value for some field.
|
void |
setValue(java.lang.String fieldName,
DataClass[] value)
Set the value for some field.
|
void |
setValue(java.lang.String fieldName,
java.util.Date value)
Set the value for some field.
|
void |
setValue(java.lang.String fieldName,
double value)
Set the value for some field.
|
void |
setValue(java.lang.String fieldName,
int[] value)
Set the value for some field.
|
void |
setValue(java.lang.String fieldName,
com.google.gwt.core.client.JavaScriptObject value)
Set the value for some field.
|
void |
setValue(java.lang.String fieldName,
java.util.Map value)
Set the value for some field.
|
void |
setValue(java.lang.String fieldName,
Record value)
Set the value for some field.
|
void |
setValue(java.lang.String fieldName,
Record[] value)
Set the value for some field.
|
void |
setValue(java.lang.String fieldName,
RelativeDate value)
Set the value for some field.
|
void |
setValue(java.lang.String fieldName,
java.lang.String value)
Sets the value for some field
|
void |
setValue(java.lang.String fieldName,
java.lang.String[] value)
Set the value for some field.
|
DynamicForm |
setValues(java.util.Map values)
An Object containing the initial 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. |
void |
setValuesAsCriteria(Criterion criteria)
This method will display the specified criteria in this form for editing.
|
DynamicForm |
setValuesManager(ValuesManager valuesManager)
Adds this DynamicForm as a member of the specified valuesManager.
|
DynamicForm |
setWrapHintText(java.lang.Boolean wrapHintText)
Should items within this form that are showing a
FormItem.hint have the hint text wrap? May be overridden at the item level via FormItem.wrapHintText . |
DynamicForm |
setWrapItemTitles(java.lang.Boolean wrapItemTitles)
Whether titles for form items should wrap.
|
void |
showErrors()
If this form has any outstanding validation errors, show them now.
This method is called when the set of errors are changed by setErrors(java.util.Map, boolean) or
validate() . |
void |
showFieldErrors(java.lang.String fieldName)
If this form has any outstanding validation errors for the field passed in, show them now.
|
void |
showItem(java.lang.String itemName)
Show a form item via
FormItem.show() |
boolean |
showItemContextMenu(FormItem item)
Called when the mouse is right-clicked in some formItem.
|
FormItem[] |
sortItemsIntoTabOrder()
Helper method to take our specified items and sort them into their desired tab sequence
|
void |
submit()
submit() is automatically called when a SubmitItem included
in the form is clicked, or, if saveOnEnter 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 a SubmitItem included
in the form is clicked, or, if saveOnEnter is set,
when the "Enter" key is pressed in a text input. |
void |
submitForm()
|
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,
java.lang.Integer index,
Canvas sourceWidget,
TransferRecordsCallback callback)
Transfer a list of
Record s from another component
(does not have to be a databound component) into this component. |
void |
transferSelectedData(DataBoundComponent source)
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.
|
java.lang.Boolean |
valuesHaveChanged()
Compares the current set of values with the values stored by the call to the
rememberValues() method. |
void |
viewSelectedData(ListGrid selectionComponent)
Displays the currently selected record(s) of the selectionComponent widget (typically a listGrid) in this component.
|
void |
viewSelectedData(java.lang.String 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.
|
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
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
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getOrCreateJsObj
public DynamicForm()
public DynamicForm(com.google.gwt.core.client.JavaScriptObject jsObj)
public static DynamicForm getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public static void changeAutoChildDefaults(java.lang.String autoChildName, Canvas defaults)
autoChildName
.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, see SGWTProperties
.AutoChildUsage
public static void changeAutoChildDefaults(java.lang.String autoChildName, FormItem defaults)
autoChildName
.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, see SGWTProperties
.AutoChildUsage
protected com.google.gwt.core.client.JavaScriptObject create()
public DynamicForm setAction(java.lang.String action)
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.
See canSubmit
for more on this.
If this method is called after the component has been drawn/initialized:
Sets the action
for this form.
action
- New action URL. Default value is "#"DynamicForm
instance, for chaining setter callsRPCManager
,
URL
,
Submitting overview and related methods
public java.lang.String getAction()
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.
See canSubmit
for more on this.
RPCManager
,
URL
,
Submitting overview and related methods
public DynamicForm setAllowExpressions(java.lang.Boolean allowExpressions)
form.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 the defaultSearchOperator
to "iContainsPattern"
, so that simple search expressions
similar to SQL "LIKE" patterns can be entered in most fields.
See FormItem.allowExpressions
for details.
allowExpressions
- New allowExpressions value. Default value is nullDynamicForm
instance, for chaining setter callsAdvanced Filtering
public java.lang.Boolean getAllowExpressions()
form.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 the defaultSearchOperator
to "iContainsPattern"
, so that simple search expressions
similar to SQL "LIKE" patterns can be entered in most fields.
See FormItem.allowExpressions
for details.
Advanced Filtering
public DynamicForm setAutoComplete(AutoComplete autoComplete)
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 and password
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.
autoComplete
- New autoComplete value. Default value is "none"DynamicForm
instance, for chaining setter callsFormItem.setAutoComplete(com.smartgwt.client.types.AutoComplete)
public AutoComplete getAutoComplete()
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 and password
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.
FormItem.getAutoComplete()
public DynamicForm setAutoFocus(java.lang.Boolean autoFocus)
dynamicForm.focusInItem(itemName)
autoFocus
- New autoFocus value. Default value is falseDynamicForm
instance, for chaining setter callsfocusInItem(int)
,
Focus
public java.lang.Boolean getAutoFocus()
dynamicForm.focusInItem(itemName)
focusInItem(int)
,
Focus
public DynamicForm setAutoFocusOnError(java.lang.Boolean autoFocusOnError)
validation
fails focus will automatically be
put into the first focusable field which failed validation.autoFocusOnError
- New autoFocusOnError value. Default value is trueDynamicForm
instance, for chaining setter callsFocus
public java.lang.Boolean getAutoFocusOnError()
validation
fails focus will automatically be
put into the first focusable field which failed validation.Focus
public DynamicForm setBrowserSpellCheck(java.lang.Boolean browserSpellCheck)
FormItem.browserSpellCheck
Notes:
- this property only applies to text based items such as TextItem and
TextAreaItem.
- this property is not supported on all browsers.
browserSpellCheck
- New browserSpellCheck value. Default value is trueDynamicForm
instance, for chaining setter callsFormItem.setBrowserSpellCheck(java.lang.Boolean)
public java.lang.Boolean getBrowserSpellCheck()
FormItem.browserSpellCheck
Notes:
- this property only applies to text based items such as TextItem and
TextAreaItem.
- this property is not supported on all browsers.
FormItem.getBrowserSpellCheck()
public DynamicForm setCanEdit(java.lang.Boolean canEdit)
false
, 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-null canEdit
attribute has canEdit:true, or (2) neither the widget nor any parent has a non-null
canEdit
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) or true
.
Note that this property may validly be null
as a distinct state
from false
. See fieldIsEditable()
for
an API that will always return true
or false
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's canEdit
attribute is true
).
Note : This is an advanced setting
canEdit
- Can this form be edited?. Default value is nullDynamicForm
instance, for chaining setter callssetReadOnlyDisplay(com.smartgwt.client.types.ReadOnlyDisplayAppearance)
public java.lang.Boolean getCanEdit()
false
, 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-null canEdit
attribute has canEdit:true, or (2) neither the widget nor any parent has a non-null
canEdit
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) or true
.
Note that this property may validly be null
as a distinct state
from false
. See fieldIsEditable()
for
an API that will always return true
or false
and give a definitive answer as to whether
editing is possible.
getReadOnlyDisplay()
public DynamicForm setCanEditFieldAttribute(java.lang.String canEditFieldAttribute) throws java.lang.IllegalStateException
SearchForm
class has this attribute
set to "canFilter"
which allows search forms to edit dataSource fields marked as canEdit:false
(but not those marked as canFilter:false
). Note that if canEdit
is explicitly specified on
a field in the DataBoundComponent.fields
array, that
property will be respected in preference to the canEditAttribute value. (See FormItem.canEdit
, ListGridField.canEdit
). Also note that individual
dataBoundComponents may have additional logic around whether a field can be edited - for example ListGrid.canEditCell()
may be overridden.
Note : This is an advanced setting
canEditFieldAttribute
- New canEditFieldAttribute value. Default value is "canEdit"DynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdIdentifier
public java.lang.String getCanEditFieldAttribute()
SearchForm
class has this attribute
set to "canFilter"
which allows search forms to edit dataSource fields marked as canEdit:false
(but not those marked as canFilter:false
). Note that if canEdit
is explicitly specified on
a field in the DataBoundComponent.fields
array, that
property will be respected in preference to the canEditAttribute value. (See FormItem.canEdit
, ListGridField.canEdit
). Also note that individual
dataBoundComponents may have additional logic around whether a field can be edited - for example ListGrid.canEditCell()
may be overridden.
Identifier
public DynamicForm setCanFocus(java.lang.Boolean canFocus)
dynamicForm.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
setCanFocus
in class Canvas
canFocus
- New canFocus value. Default value is trueDynamicForm
instance, for chaining setter callsFocus
public java.lang.Boolean getCanFocus()
dynamicForm.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.getCanFocus
in class Canvas
Focus
public DynamicForm setCanSubmit(java.lang.Boolean canSubmit)
submit()
will perform a native HTML submission to the specified
action
URL.DataBound 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
canSubmit
- New canSubmit value. Default value is falseDynamicForm
instance, for chaining setter callsSubmitting overview and related methods
public java.lang.Boolean getCanSubmit()
submit()
will perform a native HTML submission to the specified
action
URL.DataBound 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.Submitting overview and related methods
public DynamicForm setCanTabToIcons(java.lang.Boolean canTabToIcons)
icons
and picker 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
canTabToIcons
- New canTabToIcons value. Default value is trueDynamicForm
instance, for chaining setter callspublic java.lang.Boolean getCanTabToIcons()
icons
and picker 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
.
public DynamicForm setCanTabToSectionHeaders(java.lang.Boolean canTabToSectionHeaders) throws java.lang.IllegalStateException
SectionItems
will
be included in the page's tab order for accessibility. May also be set at the item level via SectionItem.canTabToHeader
If unset, section
headers will be focusable if SC.setScreenReaderMode()
has been
called. See Accessibility
.
Note : This is an advanced setting
canTabToSectionHeaders
- New canTabToSectionHeaders value. Default value is nullDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getCanTabToSectionHeaders()
SectionItems
will
be included in the page's tab order for accessibility. May also be set at the item level via SectionItem.canTabToHeader
If unset, section
headers will be focusable if SC.setScreenReaderMode()
has been
called. See Accessibility
.
public DynamicForm setCellBorder(int cellBorder)
cellBorder
- New cellBorder value. Default value is 0DynamicForm
instance, for chaining setter callsForm Layout
public int getCellBorder()
Form Layout
public DynamicForm setCellPadding(int cellPadding)
cellPadding
- New cellPadding value. Default value is 2DynamicForm
instance, for chaining setter callsForm Layout
public int getCellPadding()
Form Layout
public DynamicForm setCheckFileAccessOnSubmit(boolean checkFileAccessOnSubmit)
FileItem
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 synchronously
clears
it from the DOM, the upload will never be kicked off.
Setting checkFileAccessOnSubmit
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 the saveData 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
checkFileAccessOnSubmit
- New checkFileAccessOnSubmit value. Default value is trueDynamicForm
instance, for chaining setter callspublic boolean getCheckFileAccessOnSubmit()
FileItem
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 synchronously
clears
it from the DOM, the upload will never be kicked off.
Setting checkFileAccessOnSubmit
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 the saveData 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.
public DynamicForm setClipItemTitles(boolean clipItemTitles)
Can be overridden for
individual items via FormItem.clipTitle
.
clipItemTitles
- New clipItemTitles value. Default value is falseDynamicForm
instance, for chaining setter callspublic boolean getClipItemTitles()
Can be overridden for
individual items via FormItem.clipTitle
.
public DynamicForm setClipStaticValue(java.lang.Boolean clipStaticValue) throws java.lang.IllegalStateException
FormItem.clipStaticValue
setting for
items in this form. When unset, this is equivalent to false
.clipStaticValue
- New clipStaticValue value. Default value is nullDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getClipStaticValue()
FormItem.clipStaticValue
setting for
items in this form. When unset, this is equivalent to false
.public DynamicForm setDataArity(java.lang.String dataArity)
dataArity
:single component.
Note : This is an advanced setting
dataArity
- New dataArity value. Default value is "single"DynamicForm
instance, for chaining setter callsDataBinding
public java.lang.String getDataArity()
dataArity
:single component.DataBinding
public DynamicForm setDataFetchMode(FetchMode dataFetchMode)
FetchMode
. This
setting only applies to the ResultSet
automatically created by calling fetchData()
. If a pre-existing ResultSet is passed to setData()
instead, it's existing setting for ResultSet.fetchMode
applies.
setDataFetchMode
in interface DataBoundComponent
dataFetchMode
- New dataFetchMode value. Default value is "paged"DynamicForm
instance, for chaining setter callsDataBinding
public FetchMode getDataFetchMode()
FetchMode
. This
setting only applies to the ResultSet
automatically created by calling fetchData()
. If a pre-existing ResultSet is passed to setData()
instead, it's existing setting for ResultSet.fetchMode
applies.
getDataFetchMode
in interface DataBoundComponent
DataBinding
public DynamicForm setDataSource(DataSource dataSource)
DataSource requests
. Can be specified as either a DataSource instance or the String ID of a DataSource.
setDataSource
in interface DataBoundComponent
dataSource
- New dataSource value. Default value is nullDynamicForm
instance, for chaining setter callsDataBinding
,
DataSource fields Examplepublic DynamicForm setDataSource(java.lang.String dataSource)
DataSource requests
. Can be specified as either a DataSource instance or the String ID of a DataSource.
setDataSource
in interface DataBoundComponent
dataSource
- New dataSource value. Default value is nullDynamicForm
instance, for chaining setter callsDataBinding
,
DataSource fields Examplepublic DynamicForm setDateFormatter(DateDisplayFormat dateFormatter)
DateDisplayFormat
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"
(See timeFormatter
).
May be overridden at the component
level for fields of type datetime
via datetimeFormatter
.
Note that if specified, FormItem.dateFormatter
and FormItem.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
or short datetime
display format
depending on the specified field type.
dateFormatter
- New dateFormatter value. Default value is nullDynamicForm
instance, for chaining setter callspublic DateDisplayFormat getDateFormatter()
DateDisplayFormat
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"
(See timeFormatter
).
May be overridden at the component
level for fields of type datetime
via datetimeFormatter
.
Note that if specified, FormItem.dateFormatter
and FormItem.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
or short datetime
display format
depending on the specified field type.
public DynamicForm setDatetimeFormatter(DateDisplayFormat datetimeFormatter)
DateDisplayFormat
for Date type values displayed in this form in fields of
type datetime
. For datetime fields, this attribute will be used instead of dateFormatter
when formatting Date values.
Note that
if specified, FormItem.dateFormatter
and
FormItem.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
.
datetimeFormatter
- New datetimeFormatter value. Default value is nullDynamicForm
instance, for chaining setter callspublic DateDisplayFormat getDatetimeFormatter()
DateDisplayFormat
for Date type values displayed in this form in fields of
type datetime
. For datetime fields, this attribute will be used instead of dateFormatter
when formatting Date values.
Note that
if specified, FormItem.dateFormatter
and
FormItem.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
.
public DynamicForm setDefaultSearchOperator(OperatorId defaultSearchOperator) throws java.lang.IllegalStateException
search operator
to use for fields in a form that produces AdvancedCriteria
. Default is "iContains" unless allowExpressions
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
or optionDataSource
.
defaultSearchOperator
also has no effect in a form that does not produce AdvancedCriteria
-
see getValuesAsCriteria()
for settings that
cause a form to produce AdvancedCriteria.
defaultSearchOperator
- New defaultSearchOperator value. Default value is nullDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic OperatorId getDefaultSearchOperator()
search operator
to use for fields in a form that produces AdvancedCriteria
. Default is "iContains" unless allowExpressions
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
or optionDataSource
.
defaultSearchOperator
also has no effect in a form that does not produce AdvancedCriteria
-
see getValuesAsCriteria()
for settings that
cause a form to produce AdvancedCriteria.
public DynamicForm setDisableValidation(java.lang.Boolean disableValidation)
disableValidation
- New disableValidation value. Default value is nullDynamicForm
instance, for chaining setter callssaveData()
,
submit()
,
Validation overview and related methods
public java.lang.Boolean getDisableValidation()
saveData()
,
submit()
,
Validation overview and related methods
public DynamicForm setEditProxyConstructor(java.lang.String editProxyConstructor) throws java.lang.IllegalStateException
EditProxy
for this component when the component is
first placed into edit mode
.setEditProxyConstructor
in class Canvas
editProxyConstructor
- New editProxyConstructor value. Default value is "FormEditProxy"DynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdSCClassName
public java.lang.String getEditProxyConstructor()
EditProxy
for this component when the component is
first placed into edit mode
.getEditProxyConstructor
in class Canvas
SCClassName
public DynamicForm setEncoding(Encoding encoding)
Note : This is an advanced setting
encoding
- New encoding value. Default value is DynamicForm.NORMALDynamicForm
instance, for chaining setter callsSubmitting overview and related methods
public Encoding getEncoding()
Submitting overview and related methods
public DynamicForm setErrorItemCellStyle(java.lang.String errorItemCellStyle) throws java.lang.IllegalStateException
showInlineErrors
is false we show all errors
for the form item in a single item rendered at the top of the form.errorItemCellStyle
- New errorItemCellStyle value. Default value is "formCellError"DynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdValidation overview and related methods
public java.lang.String getErrorItemCellStyle()
showInlineErrors
is false we show all errors
for the form item in a single item rendered at the top of the form.Validation overview and related methods
public DynamicForm setErrorsPreamble(java.lang.String errorsPreamble) throws java.lang.IllegalStateException
showInlineErrors
is false
, 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.errorsPreamble
- New errorsPreamble value. Default value is "The following errors were found"DynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdHTMLString
,
Validation overview and related methods
public java.lang.String getErrorsPreamble()
showInlineErrors
is false
, 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.HTMLString
,
Validation overview and related methods
public DynamicForm setFetchRequestProperties(DSRequest fetchRequestProperties) throws java.lang.IllegalStateException
autoFetchData
is true
, this
attribute allows the developer to declaratively specify DSRequest
properties for the
initial fetchData()
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.
fetchRequestProperties
- New fetchRequestProperties value. Default value is nullDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdDataBinding
public DSRequest getFetchRequestProperties()
autoFetchData
is true
, this
attribute allows the developer to declaratively specify DSRequest
properties for the
initial fetchData()
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.
DataBinding
public DynamicForm setFileAccessFailedWarning(java.lang.String fileAccessFailedWarning)
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
.
fileAccessFailedWarning
- New fileAccessFailedWarning value. Default value is "Unable to access the selected file(s) for upload. Please re-select the file and try again."DynamicForm
instance, for chaining setter callspublic java.lang.String getFileAccessFailedWarning()
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
.
public DynamicForm setFixedColWidths(java.lang.Boolean fixedColWidths)
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.
fixedColWidths
- New fixedColWidths value. Default value is falseDynamicForm
instance, for chaining setter callsForm Layout
public java.lang.Boolean getFixedColWidths()
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.
Form Layout
public DynamicForm setFormSubmitFailedWarning(java.lang.String formSubmitFailedWarning)
DynamicForm.formSubmitFailed()
natively
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
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."DynamicForm
instance, for chaining setter callspublic java.lang.String getFormSubmitFailedWarning()
DynamicForm.formSubmitFailed()
natively
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.public DynamicForm setHiliteRequiredFields(java.lang.Boolean hiliteRequiredFields)
requiredTitlePrefix
and requiredTitleSuffix
attributes, instead of the
standard prefix and suffix.hiliteRequiredFields
- New hiliteRequiredFields value. Default value is trueDynamicForm
instance, for chaining setter callsForm Titles
public java.lang.Boolean getHiliteRequiredFields()
requiredTitlePrefix
and requiredTitleSuffix
attributes, instead of the
standard prefix and suffix.Form Titles
public DynamicForm setImplicitSave(java.lang.Boolean implicitSave)
delay
, as well as when the entire form is submitted.
Unless form.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.implicitSave
- New implicitSave value. Default value is falseDynamicForm
instance, for chaining setter callspublic java.lang.Boolean getImplicitSave()
delay
, as well as when the entire form is submitted.
Unless form.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.public DynamicForm setImplicitSaveDelay(int implicitSaveDelay)
implicitSave
is true, this attribute dictates
the millisecond delay after which form items are automatically saved during editing.implicitSaveDelay
- New implicitSaveDelay value. Default value is 2000DynamicForm
instance, for chaining setter callspublic int getImplicitSaveDelay()
implicitSave
is true, this attribute dictates
the millisecond delay after which form items are automatically saved during editing.public DynamicForm setImplicitSaveOnBlur(java.lang.Boolean implicitSaveOnBlur)
implicitSaveOnBlur
- New implicitSaveOnBlur value. Default value is falseDynamicForm
instance, for chaining setter callspublic java.lang.Boolean getImplicitSaveOnBlur()
public DynamicForm setInitialSort(SortSpecifier... initialSort) throws java.lang.IllegalStateException
SortSpecifier
objects used to set up the initial sort configuration for
this form.initialSort
- New initialSort value. Default value is nullDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic SortSpecifier[] getInitialSort()
SortSpecifier
objects used to set up the initial sort configuration for
this form.public DynamicForm setItemHoverAlign(Alignment itemHoverAlign)
itemHoverAlign
- New itemHoverAlign value. Default value is nullDynamicForm
instance, for chaining setter callsFormItem.setHoverAlign(com.smartgwt.client.types.Alignment)
public Alignment getItemHoverAlign()
FormItem.getHoverAlign()
public DynamicForm setItemHoverDelay(int itemHoverDelay)
itemHoverDelay
- New itemHoverDelay value. Default value is 500DynamicForm
instance, for chaining setter callsFormItem.setHoverDelay(java.lang.Integer)
public int getItemHoverDelay()
FormItem.getHoverDelay()
public DynamicForm setItemHoverHeight(java.lang.Integer itemHoverHeight)
itemHoverHeight
- New itemHoverHeight value. Default value is nullDynamicForm
instance, for chaining setter callsFormItem.setHoverHeight(java.lang.Integer)
public java.lang.Integer getItemHoverHeight()
FormItem.getHoverHeight()
public DynamicForm setItemHoverHeight(java.lang.String itemHoverHeight)
itemHoverHeight
- New itemHoverHeight value. Default value is nullDynamicForm
instance, for chaining setter callsFormItem.setHoverHeight(java.lang.Integer)
public java.lang.String getItemHoverHeightAsString()
FormItem.getHoverHeight()
public DynamicForm setItemHoverOpacity(java.lang.Integer itemHoverOpacity)
itemHoverOpacity
- New itemHoverOpacity value. Default value is nullDynamicForm
instance, for chaining setter callsFormItem.setHoverOpacity(java.lang.Integer)
public java.lang.Integer getItemHoverOpacity()
FormItem.getHoverOpacity()
public DynamicForm setItemHoverStyle(java.lang.String itemHoverStyle)
itemHoverStyle
- New itemHoverStyle value. Default value is "formHover"DynamicForm
instance, for chaining setter callsFormItem.setHoverStyle(java.lang.String)
,
CSSStyleName
public java.lang.String getItemHoverStyle()
FormItem.getHoverStyle()
,
CSSStyleName
public DynamicForm setItemHoverVAlign(java.lang.Integer itemHoverVAlign)
itemHoverVAlign
- New itemHoverVAlign value. Default value is nullDynamicForm
instance, for chaining setter callsFormItem.setHoverVAlign(com.smartgwt.client.types.VerticalAlignment)
public java.lang.Integer getItemHoverVAlign()
FormItem.getHoverVAlign()
public DynamicForm setItemHoverVAlign(java.lang.String itemHoverVAlign)
itemHoverVAlign
- New itemHoverVAlign value. Default value is nullDynamicForm
instance, for chaining setter callsFormItem.setHoverVAlign(com.smartgwt.client.types.VerticalAlignment)
public java.lang.String getItemHoverVAlignAsString()
FormItem.getHoverVAlign()
public DynamicForm setItemHoverWidth(java.lang.Integer itemHoverWidth)
itemHoverWidth
- New itemHoverWidth value. Default value is nullDynamicForm
instance, for chaining setter callsFormItem.setHoverWidth(java.lang.Integer)
,
Hovers Examplepublic java.lang.Integer getItemHoverWidth()
FormItem.getHoverWidth()
,
Hovers Examplepublic DynamicForm setItemHoverWidth(java.lang.String itemHoverWidth)
itemHoverWidth
- New itemHoverWidth value. Default value is nullDynamicForm
instance, for chaining setter callsFormItem.setHoverWidth(java.lang.Integer)
,
Hovers Examplepublic java.lang.String getItemHoverWidthAsString()
FormItem.getHoverWidth()
,
Hovers Examplepublic DynamicForm setItemLayout(FormLayoutType itemLayout)
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:
FormItem.setLeft()
and FormItem.setTop()
can be used for manual reflow. Note : This is an advanced setting
itemLayout
- New itemLayout value. Default value is "table"DynamicForm
instance, for chaining setter callsFormItem.setWidth(int)
,
FormItem.setHeight(int)
,
Form Layout
public FormLayoutType getItemLayout()
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:
FormItem.setLeft()
and FormItem.setTop()
can be used for manual reflow. FormItem.getWidth()
,
FormItem.getHeight()
,
Form Layout
public DynamicForm setLinearAutoSpanItems(java.lang.Boolean linearAutoSpanItems)
linearMode
, should each
item appear on its own row, spanning the full set of rendered columns by default?linearAutoSpanItems
- New linearAutoSpanItems value. Default value is trueDynamicForm
instance, for chaining setter callspublic java.lang.Boolean getLinearAutoSpanItems()
linearMode
, should each
item appear on its own row, spanning the full set of rendered columns by default?public DynamicForm setLinearMode(java.lang.Boolean linearMode)
FormItem
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:
TitleOrientation
is not explicitly
specified, it will be defaulted to top
, causing each item's title to appear above its element.FormItem.titleOrientation
attribute will be
ignored.hint
that
support showing the hint in the field
,
showHintInField
will be defaulted true if unset.error text
will be displayed, and
errors will be rendered above the item
element
.numCols
property for the form is
ignored. The form will render as a single column of items - or two columns if titleOrientation
is
specified as "left"
or "right"
by default. To override this, a developer may specify an
explicit linearNumCols
allowing multiple
items to potentially be placed next to each other.FormItem.width
is ignored and all items receive "*" width
unless FormItem.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 "*", unless
FormItem.linearColSpan
is specified.FormItem.startRow
and FormItem.endRow
are ignored and all items will default
to startRow:false
and endRow:true
. This may be overridden per item via FormItem.linearStartRow
and FormItem.linearEndRow
.SplitPane
.linearMode
- New linearMode value. Default value is nullDynamicForm
instance, for chaining setter callssetLinearOnMobile(boolean)
,
Form Layout
public java.lang.Boolean getLinearMode()
FormItem
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:
TitleOrientation
is not explicitly
specified, it will be defaulted to top
, causing each item's title to appear above its element.FormItem.titleOrientation
attribute will be
ignored.hint
that
support showing the hint in the field
,
showHintInField
will be defaulted true if unset.error text
will be displayed, and
errors will be rendered above the item
element
.numCols
property for the form is
ignored. The form will render as a single column of items - or two columns if titleOrientation
is
specified as "left"
or "right"
by default. To override this, a developer may specify an
explicit linearNumCols
allowing multiple
items to potentially be placed next to each other.FormItem.width
is ignored and all items receive "*" width
unless FormItem.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 "*", unless
FormItem.linearColSpan
is specified.FormItem.startRow
and FormItem.endRow
are ignored and all items will default
to startRow:false
and endRow:true
. This may be overridden per item via FormItem.linearStartRow
and FormItem.linearEndRow
.SplitPane
.getLinearOnMobile()
,
Form Layout
public DynamicForm setLinearNumCols(java.lang.Integer linearNumCols)
number of columns
when the form is being
rendered in linearMode
, overriding any automatically
derived value in that mode.linearNumCols
- New linearNumCols value. Default value is nullDynamicForm
instance, for chaining setter callsForm Layout
public java.lang.Integer getLinearNumCols()
number of columns
when the form is being
rendered in linearMode
, overriding any automatically
derived value in that mode.Form Layout
public DynamicForm setLinearOnMobile(boolean linearOnMobile) throws java.lang.IllegalStateException
handset device
with one FormItem
per row by automatically defaulting linearMode
to true
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 where
linearOnMobile
defaults to true, and pervasively use that subclass.
linearOnMobile
- New linearOnMobile value. Default value is falseDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdForm Layout
public boolean getLinearOnMobile()
handset device
with one FormItem
per row by automatically defaulting linearMode
to true
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 where
linearOnMobile
defaults to true, and pervasively use that subclass.
Form Layout
public DynamicForm setLongTextEditorThreshold(int longTextEditorThreshold)
this.longTextEditorType
(a TextAreaItem by default), rather than a simple
text item. Overridden by explicitly specifying editorType
for the field.longTextEditorThreshold
- New longTextEditorThreshold value. Default value is 255DynamicForm
instance, for chaining setter callsAppearance overview and related methods
public int getLongTextEditorThreshold()
this.longTextEditorType
(a TextAreaItem by default), rather than a simple
text item. Overridden by explicitly specifying editorType
for the field.Appearance overview and related methods
public DynamicForm setLongTextEditorType(java.lang.String longTextEditorType)
longTextEditorType
- New longTextEditorType value. Default value is "textArea"DynamicForm
instance, for chaining setter callsAppearance overview and related methods
public java.lang.String getLongTextEditorType()
Appearance overview and related methods
public DynamicForm setMethod(FormMethod method)
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 the method
for this form.
method
- html form submission method (get or post). Default value is DynamicForm.POSTDynamicForm
instance, for chaining setter callsSubmitting overview and related methods
public FormMethod getMethod()
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
.
Submitting overview and related methods
public DynamicForm setMinColWidth(int minColWidth)
minColWidth
- New minColWidth value. Default value is 20DynamicForm
instance, for chaining setter callsForm Layout
public int getMinColWidth()
Form Layout
public DynamicForm setMinHintWidth(java.lang.Integer minHintWidth) throws java.lang.IllegalStateException
FormItem.hint
text. Typically this reflects how much space the hint text takes up before it wraps. May be overridden at
the item level via FormItem.minHintWidth
.
This setting does not apply to hints that are shown in field
.
minHintWidth
- New minHintWidth value. Default value is 80DynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdsetWrapHintText(java.lang.Boolean)
public java.lang.Integer getMinHintWidth()
FormItem.hint
text. Typically this reflects how much space the hint text takes up before it wraps. May be overridden at
the item level via FormItem.minHintWidth
.
This setting does not apply to hints that are shown in field
.
getWrapHintText()
public DynamicForm setNoErrorDetailsMessage(java.lang.String noErrorDetailsMessage)
noErrorDetailsMessage
- New noErrorDetailsMessage value. Default value is "Error during validation; no error details were provided"DynamicForm
instance, for chaining setter callsValidation overview and related methods
public java.lang.String getNoErrorDetailsMessage()
Validation overview and related methods
public DynamicForm setNumCols(int numCols)
numCols
- New numCols value. Default value is 2DynamicForm
instance, for chaining setter callsForm Layout
public int getNumCols()
Form Layout
public DynamicForm setOperator(OperatorId operator) throws java.lang.IllegalStateException
FormItem.operator
has been set for any FormItem
in this form, what logical operator should be applied across the
criteria
produced by the form items? Only applicable to forms that have a
dataSource
.operator
- New operator value. Default value is "and"DynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic OperatorId getOperator()
FormItem.operator
has been set for any FormItem
in this form, what logical operator should be applied across the
criteria
produced by the form items? Only applicable to forms that have a
dataSource
.public DynamicForm setOriginalValueMessage(java.lang.String originalValueMessage)
FormItem.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
originalValueMessage
- New originalValueMessage value. Default value is "Original value: $value"DynamicForm
instance, for chaining setter callsHTMLString
public java.lang.String getOriginalValueMessage()
FormItem.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.
HTMLString
public DynamicForm setReadOnlyDisplay(ReadOnlyDisplayAppearance readOnlyDisplay)
canEdit
is set to false
, 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 the readOnlyDisplay
attribute.
readOnlyDisplay
- New read-only display appearance. Default value is "readOnly"DynamicForm
instance, for chaining setter callsAppearance overview and related methods
public ReadOnlyDisplayAppearance getReadOnlyDisplay()
canEdit
is set to false
, how should the
items in this form be displayed to the user? Can be overridden via FormItem.readOnlyDisplay
on individual form items.
Appearance overview and related methods
public DynamicForm setReadOnlyTextBoxStyle(java.lang.String readOnlyTextBoxStyle)
FormItem.readOnlyTextBoxStyle
setting for items in this form. Note: The default style may vary depending on the skin.
readOnlyTextBoxStyle
- New readOnlyTextBoxStyle value. Default value is "staticTextItem"DynamicForm
instance, for chaining setter callsFormItemBaseStyle
public java.lang.String getReadOnlyTextBoxStyle()
FormItem.readOnlyTextBoxStyle
setting for items in this form. Note: The default style may vary depending on the skin.
FormItemBaseStyle
public DynamicForm setRejectInvalidValueOnChange(java.lang.Boolean rejectInvalidValueOnChange)
Note : This is an advanced setting
rejectInvalidValueOnChange
- New rejectInvalidValueOnChange value. Default value is nullDynamicForm
instance, for chaining setter callspublic java.lang.Boolean getRejectInvalidValueOnChange()
public DynamicForm setRequiredMessage(java.lang.String requiredMessage)
requiredMessage
- New requiredMessage value. Default value is nullDynamicForm
instance, for chaining setter callsHTMLString
,
Form Titles
public java.lang.String getRequiredMessage()
HTMLString
,
Form Titles
public DynamicForm setRequiredRightTitlePrefix(java.lang.String requiredRightTitlePrefix)
hiliteRequiredFields
is true and the TitleOrientation
property is set to "right".requiredRightTitlePrefix
- New requiredRightTitlePrefix value. Default value is "<b>: "DynamicForm
instance, for chaining setter callsHTMLString
,
Form Titles
public java.lang.String getRequiredRightTitlePrefix()
hiliteRequiredFields
is true and the TitleOrientation
property is set to "right".HTMLString
,
Form Titles
public DynamicForm setRequiredRightTitleSuffix(java.lang.String requiredRightTitleSuffix)
hiliteRequiredFields
is true and the TitleOrientation
property is set to "right".requiredRightTitleSuffix
- New requiredRightTitleSuffix value. Default value is "</b>"DynamicForm
instance, for chaining setter callsHTMLString
,
Form Titles
public java.lang.String getRequiredRightTitleSuffix()
hiliteRequiredFields
is true and the TitleOrientation
property is set to "right".HTMLString
,
Form Titles
public DynamicForm setRequiredTitlePrefix(java.lang.String requiredTitlePrefix)
hiliteRequiredFields
is true.requiredTitlePrefix
- New requiredTitlePrefix value. Default value is "<b>"DynamicForm
instance, for chaining setter callsHTMLString
,
Form Titles
public java.lang.String getRequiredTitlePrefix()
hiliteRequiredFields
is true.HTMLString
,
Form Titles
public DynamicForm setRequiredTitleSuffix(java.lang.String requiredTitleSuffix)
hiliteRequiredFields
is true.requiredTitleSuffix
- New requiredTitleSuffix value. Default value is " :</b>"DynamicForm
instance, for chaining setter callsHTMLString
,
Form Titles
public java.lang.String getRequiredTitleSuffix()
hiliteRequiredFields
is true.HTMLString
,
Form Titles
public DynamicForm setRevertValueKey(KeyIdentifier revertValueKey) throws java.lang.IllegalStateException
resetValues()
were called.revertValueKey
- New revertValueKey value. Default value is nullDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic KeyIdentifier getRevertValueKey()
resetValues()
were called.public DynamicForm setRightTitlePrefix(java.lang.String rightTitlePrefix)
rightTitlePrefix
- New rightTitlePrefix value. Default value is ": "DynamicForm
instance, for chaining setter callsHTMLString
,
Form Titles
public java.lang.String getRightTitlePrefix()
HTMLString
,
Form Titles
public DynamicForm setRightTitleSuffix(java.lang.String rightTitleSuffix)
rightTitleSuffix
- New rightTitleSuffix value. Default value is ""DynamicForm
instance, for chaining setter callsHTMLString
,
Form Titles
public java.lang.String getRightTitleSuffix()
HTMLString
,
Form Titles
public DynamicForm setSaveOnEnter(java.lang.Boolean saveOnEnter)
true
, 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 the submit()
method.saveOnEnter
- New saveOnEnter value. Default value is falseDynamicForm
instance, for chaining setter callsSubmitting overview and related methods
public java.lang.Boolean getSaveOnEnter()
true
, 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 the submit()
method.Submitting overview and related methods
public DynamicForm setSaveOperationType(DSOperationType saveOperationType)
DSOperationType
to be performed when saveData()
is called. This property is automatically set on a
call to editRecord()
or editNewRecord()
, or may be set directly via 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.
If this method is called after the component has been drawn/initialized:
Setter for the default DSOperationType
when saveData()
is called. Note that this property can also be set by calling editRecord()
or editNewRecord()
saveOperationType
- Operation type to use as a default. Valid values are "add"
or "update"
. Default value is nullDynamicForm
instance, for chaining setter callspublic DSOperationType getSaveOperationType()
DSOperationType
to be performed when saveData()
is called. This property is automatically set on a
call to editRecord()
or editNewRecord()
, or may be set directly via 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.
DSOperationType
to be performed when saveData()
or ValuesManager.saveData()
is called."add"
or "update"
. If a DSRequest
configuration object is
passed in containing an explicit operationType this will be returned. Otherwise this.saveOperationType
will be returned if set. Note
that saveOperationType
is automatically set via calls to data binding methods such as editNewRecord()
, or it may be set explicitly
.
If no explicit saveOperationType is present, the system will use the following heuristic to determine the save operationType:
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).when the form's values were populated
, the form had value
for the primaryKey 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 the oldValues
for the form.primaryKey field
is editable and a value is now present for
the primary key field, but was not present in the oldValues
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.public DynamicForm setSectionVisibilityMode(VisibilityMode sectionVisibilityMode)
SectionItem
s], this attribute
controls whether multiple sections can be expanded at once.sectionVisibilityMode
- New sectionVisibilityMode value. Default value is "multiple"DynamicForm
instance, for chaining setter callsVisibilityMode
,
SectionItem
,
Form Layout
public VisibilityMode getSectionVisibilityMode()
SectionItem
s], this attribute
controls whether multiple sections can be expanded at once.VisibilityMode
,
SectionItem
,
Form Layout
public DynamicForm setSelectOnClick(java.lang.Boolean selectOnClick)
TextItem
, TextAreaItem
) is
given focus - whether programmatically (see focusInItem()
), 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
.
selectOnClick
- New selectOnClick value. Default value is falseDynamicForm
instance, for chaining setter callsFocus
public java.lang.Boolean getSelectOnClick()
TextItem
, TextAreaItem
) is
given focus - whether programmatically (see focusInItem()
), 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
.
Focus
public DynamicForm setSelectOnFocus(java.lang.Boolean selectOnFocus)
TextItem
, TextAreaItem
) is
given focus programmatically (see focusInItem()
), 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
.
selectOnFocus
- New selectOnFocus value. Default value is falseDynamicForm
instance, for chaining setter callsFocus
public java.lang.Boolean getSelectOnFocus()
TextItem
, TextAreaItem
) is
given focus programmatically (see focusInItem()
), 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
.
Focus
public DynamicForm setShowComplexFieldsRecursively(java.lang.Boolean showComplexFieldsRecursively) throws java.lang.IllegalStateException
DynamicForm
will set both showComplexFields
and
showComplexFieldsRecursively
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.
showComplexFieldsRecursively
- New showComplexFieldsRecursively value. Default value is nullDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getShowComplexFieldsRecursively()
DynamicForm
will set both showComplexFields
and
showComplexFieldsRecursively
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.
public DynamicForm setShowDeletions(java.lang.Boolean showDeletions) throws java.lang.IllegalStateException
FormItem.showDeletions
setting for
items in this form.
Note : This is an advanced setting
showDeletions
- New showDeletions value. Default value is nullDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getShowDeletions()
FormItem.showDeletions
setting for
items in this form.public DynamicForm setShowDetailFields(java.lang.Boolean showDetailFields) throws java.lang.IllegalStateException
setShowDetailFields
in interface DataBoundComponent
showDetailFields
- New showDetailFields value. Default value is trueDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getShowDetailFields()
getShowDetailFields
in interface DataBoundComponent
public DynamicForm setShowErrorIcons(java.lang.Boolean showErrorIcons)
showErrorIcons
, showErrorText
, errorOrientation
, and showErrorStyle
control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors
:false.
showErrorIcons
, showErrorText
, errorOrientation
and showErrorStyle
are all boolean properties, and can be set on a DynamicForm to control the behavior form-wide, or set on individual
FormItems.
The HTML displayed next to a form item with errors is generated by FormItem.getErrorHTML()
. The default implementation of
that method respects showErrorIcons
and showErrorText
as follows:
showErrorIcons
, or showErrorIcon
at the FormItem level controls whether an error icon should
appear next to fields which have validation errors. The icon's appearance is governed by FormItem.errorIconSrc
, FormItem.errorIconWidth
and FormItem.errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which
have validation errors. The attribute showTitlesWithErrorMessages
may be set to prefix error messages with the form item's title + ":"
(may be
desired if the item has FormItem.showTitle
set to
false).
If showErrorText
is unset, the error text will be shown if linearMode
is true (or linearOnMobile
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 of
showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
If errorOrientation
is unset, the
error orientation will default to "top" if linearMode
is enabled (or linearOnMobile
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. See FormItemBaseStyle
for more on this.
showErrorIcons
- New showErrorIcons value. Default value is trueDynamicForm
instance, for chaining setter callsValidation overview and related methods
public java.lang.Boolean getShowErrorIcons()
showErrorIcons
, showErrorText
, errorOrientation
, and showErrorStyle
control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors
:false.
showErrorIcons
, showErrorText
, errorOrientation
and showErrorStyle
are all boolean properties, and can be set on a DynamicForm to control the behavior form-wide, or set on individual
FormItems.
The HTML displayed next to a form item with errors is generated by FormItem.getErrorHTML()
. The default implementation of
that method respects showErrorIcons
and showErrorText
as follows:
showErrorIcons
, or showErrorIcon
at the FormItem level controls whether an error icon should
appear next to fields which have validation errors. The icon's appearance is governed by FormItem.errorIconSrc
, FormItem.errorIconWidth
and FormItem.errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which
have validation errors. The attribute showTitlesWithErrorMessages
may be set to prefix error messages with the form item's title + ":"
(may be
desired if the item has FormItem.showTitle
set to
false).
If showErrorText
is unset, the error text will be shown if linearMode
is true (or linearOnMobile
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 of
showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
If errorOrientation
is unset, the
error orientation will default to "top" if linearMode
is enabled (or linearOnMobile
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. See FormItemBaseStyle
for more on this.
Validation overview and related methods
public DynamicForm setShowErrorStyle(java.lang.Boolean showErrorStyle)
showErrorIcons
, showErrorText
, errorOrientation
, and showErrorStyle
control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors
:false.
showErrorIcons
, showErrorText
, errorOrientation
and showErrorStyle
are all boolean properties, and can be set on a DynamicForm to control the behavior form-wide, or set on individual
FormItems.
The HTML displayed next to a form item with errors is generated by FormItem.getErrorHTML()
. The default implementation of
that method respects showErrorIcons
and showErrorText
as follows:
showErrorIcons
, or showErrorIcon
at the FormItem level controls whether an error icon should
appear next to fields which have validation errors. The icon's appearance is governed by FormItem.errorIconSrc
, FormItem.errorIconWidth
and FormItem.errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which
have validation errors. The attribute showTitlesWithErrorMessages
may be set to prefix error messages with the form item's title + ":"
(may be
desired if the item has FormItem.showTitle
set to
false).
If showErrorText
is unset, the error text will be shown if linearMode
is true (or linearOnMobile
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 of
showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
If errorOrientation
is unset, the
error orientation will default to "top" if linearMode
is enabled (or linearOnMobile
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. See FormItemBaseStyle
for more on this.
showErrorStyle
- New showErrorStyle value. Default value is trueDynamicForm
instance, for chaining setter callsValidation overview and related methods
public java.lang.Boolean getShowErrorStyle()
showErrorIcons
, showErrorText
, errorOrientation
, and showErrorStyle
control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors
:false.
showErrorIcons
, showErrorText
, errorOrientation
and showErrorStyle
are all boolean properties, and can be set on a DynamicForm to control the behavior form-wide, or set on individual
FormItems.
The HTML displayed next to a form item with errors is generated by FormItem.getErrorHTML()
. The default implementation of
that method respects showErrorIcons
and showErrorText
as follows:
showErrorIcons
, or showErrorIcon
at the FormItem level controls whether an error icon should
appear next to fields which have validation errors. The icon's appearance is governed by FormItem.errorIconSrc
, FormItem.errorIconWidth
and FormItem.errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which
have validation errors. The attribute showTitlesWithErrorMessages
may be set to prefix error messages with the form item's title + ":"
(may be
desired if the item has FormItem.showTitle
set to
false).
If showErrorText
is unset, the error text will be shown if linearMode
is true (or linearOnMobile
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 of
showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
If errorOrientation
is unset, the
error orientation will default to "top" if linearMode
is enabled (or linearOnMobile
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. See FormItemBaseStyle
for more on this.
Validation overview and related methods
public DynamicForm setShowErrorText(java.lang.Boolean showErrorText)
showErrorIcons
, showErrorText
, errorOrientation
, and showErrorStyle
control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors
:false.
showErrorIcons
, showErrorText
, errorOrientation
and showErrorStyle
are all boolean properties, and can be set on a DynamicForm to control the behavior form-wide, or set on individual
FormItems.
The HTML displayed next to a form item with errors is generated by FormItem.getErrorHTML()
. The default implementation of
that method respects showErrorIcons
and showErrorText
as follows:
showErrorIcons
, or showErrorIcon
at the FormItem level controls whether an error icon should
appear next to fields which have validation errors. The icon's appearance is governed by FormItem.errorIconSrc
, FormItem.errorIconWidth
and FormItem.errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which
have validation errors. The attribute showTitlesWithErrorMessages
may be set to prefix error messages with the form item's title + ":"
(may be
desired if the item has FormItem.showTitle
set to
false).
If showErrorText
is unset, the error text will be shown if linearMode
is true (or linearOnMobile
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 of
showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
If errorOrientation
is unset, the
error orientation will default to "top" if linearMode
is enabled (or linearOnMobile
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. See FormItemBaseStyle
for more on this.
showErrorText
- New showErrorText value. Default value is falseDynamicForm
instance, for chaining setter callsValidation overview and related methods
public java.lang.Boolean getShowErrorText()
showErrorIcons
, showErrorText
, errorOrientation
, and showErrorStyle
control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors
:false.
showErrorIcons
, showErrorText
, errorOrientation
and showErrorStyle
are all boolean properties, and can be set on a DynamicForm to control the behavior form-wide, or set on individual
FormItems.
The HTML displayed next to a form item with errors is generated by FormItem.getErrorHTML()
. The default implementation of
that method respects showErrorIcons
and showErrorText
as follows:
showErrorIcons
, or showErrorIcon
at the FormItem level controls whether an error icon should
appear next to fields which have validation errors. The icon's appearance is governed by FormItem.errorIconSrc
, FormItem.errorIconWidth
and FormItem.errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which
have validation errors. The attribute showTitlesWithErrorMessages
may be set to prefix error messages with the form item's title + ":"
(may be
desired if the item has FormItem.showTitle
set to
false).
If showErrorText
is unset, the error text will be shown if linearMode
is true (or linearOnMobile
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 of
showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
If errorOrientation
is unset, the
error orientation will default to "top" if linearMode
is enabled (or linearOnMobile
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. See FormItemBaseStyle
for more on this.
Validation overview and related methods
public DynamicForm setShowImageAsURL(boolean showImageAsURL)
type:"image"
, if the field is non editable, and being
displayed with readOnlyDisplay:"static"
,
should the value (URL) be displayed as text, or should an image be rendered? May be overridden for individual items
via FormItem.showImageAsURL
.
showImageAsURL
- New showImageAsURL value. Default value is falseDynamicForm
instance, for chaining setter callspublic boolean getShowImageAsURL()
type:"image"
, if the field is non editable, and being
displayed with readOnlyDisplay:"static"
,
should the value (URL) be displayed as text, or should an image be rendered? May be overridden for individual items
via FormItem.showImageAsURL
.
public DynamicForm setShowInlineErrors(java.lang.Boolean showInlineErrors)
showErrorText
:false).
If false, errors are written at the top of the form.
To do some other kind of error display, override showErrors()
.
showInlineErrors
- New showInlineErrors value. Default value is trueDynamicForm
instance, for chaining setter callsValidation overview and related methods
public java.lang.Boolean getShowInlineErrors()
showErrorText
:false).
If false, errors are written at the top of the form.
To do some other kind of error display, override showErrors()
.
Validation overview and related methods
public DynamicForm setShowOldValueInHover(java.lang.Boolean showOldValueInHover)
FormItem.showOldValueInHover
setting.
Note : This is an advanced setting
showOldValueInHover
- New showOldValueInHover value. Default value is nullDynamicForm
instance, for chaining setter callspublic java.lang.Boolean getShowOldValueInHover()
FormItem.showOldValueInHover
setting.public DynamicForm setShowPending(java.lang.Boolean showPending) throws java.lang.IllegalStateException
FormItem.showPending
. Also, in a form with
showPending:true, an individual FormItem
can set showPending:false and
vice versa.
Note : This is an advanced setting
showPending
- New showPending value. Default value is nullDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getShowPending()
FormItem.showPending
. Also, in a form with
showPending:true, an individual FormItem
can set showPending:false and
vice versa.
public DynamicForm setShowTitlesWithErrorMessages(java.lang.Boolean showTitlesWithErrorMessages)
showTitlesWithErrorMessages
- New showTitlesWithErrorMessages value. Default value is falseDynamicForm
instance, for chaining setter callsValidation overview and related methods
public java.lang.Boolean getShowTitlesWithErrorMessages()
Validation overview and related methods
public DynamicForm setStopOnError(java.lang.Boolean stopOnError) throws java.lang.IllegalStateException
Enabling this property also implies FormItem.validateOnExit
is automatically enabled. If
there are server-based validators on this item, setting this property also implies that FormItem.synchronousValidation
is forced on.
stopOnError
- New stopOnError value. Default value is nullDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getStopOnError()
Enabling this property also implies FormItem.validateOnExit
is automatically enabled. If
there are server-based validators on this item, setting this property also implies that FormItem.synchronousValidation
is forced on.
public DynamicForm setStoreDisplayValues(java.lang.Boolean storeDisplayValues) throws java.lang.IllegalStateException
FormItem.displayField
and FormItem.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.local display field values
- typically
foreignKey fields
where the display field is included 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 is included 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
storeDisplayValues
- New storeDisplayValues value. Default value is trueDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getStoreDisplayValues()
FormItem.displayField
and FormItem.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.local display field values
- typically
foreignKey fields
where the display field is included 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 is included 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
.
public DynamicForm setSuppressBrowserClearIcons(boolean suppressBrowserClearIcons)
TextItem.suppressBrowserClearIcon
value for TextItems within this form.suppressBrowserClearIcons
- New suppressBrowserClearIcons value. Default value is falseDynamicForm
instance, for chaining setter callspublic boolean getSuppressBrowserClearIcons()
TextItem.suppressBrowserClearIcon
value for TextItems within this form.public DynamicForm setSuppressValidationErrorCallback(java.lang.Boolean suppressValidationErrorCallback)
saveData()
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 if willHandleError: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
Note : This is an advanced setting
suppressValidationErrorCallback
- New suppressValidationErrorCallback value. Default value is falseDynamicForm
instance, for chaining setter callspublic java.lang.Boolean getSuppressValidationErrorCallback()
saveData()
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 if willHandleError: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
public DynamicForm setSynchronousValidation(java.lang.Boolean synchronousValidation) throws java.lang.IllegalStateException
If false, the form will try to avoid blocking user interaction until it is strictly required. That is until the user attempts to use a FormItem whose state could be affected by a server request that has not yet returned.
synchronousValidation
- New synchronousValidation value. Default value is falseDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getSynchronousValidation()
If false, the form will try to avoid blocking user interaction until it is strictly required. That is until the user attempts to use a FormItem whose state could be affected by a server request that has not yet returned.
public DynamicForm setTarget(java.lang.String target)
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 the target
for this form.
Note : This is an advanced setting
target
- New submission target. Default value is nullDynamicForm
instance, for chaining setter callsSubmitting overview and related methods
public java.lang.String getTarget()
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
.
Submitting overview and related methods
public DynamicForm setTimeFormatter(TimeDisplayFormat timeFormatter)
TimeDisplayFormat
for type:"time"
field values displayed in this form. Note that
if specified, FormItem.dateFormatter
and
FormItem.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.
timeFormatter
- New timeFormatter value. Default value is nullDynamicForm
instance, for chaining setter callspublic TimeDisplayFormat getTimeFormatter()
TimeDisplayFormat
for type:"time"
field values displayed in this form. Note that
if specified, FormItem.dateFormatter
and
FormItem.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.
public DynamicForm setTitleAlign(Alignment titleAlign)
text direction
as described in getTitleAlign()
titleAlign
- New titleAlign value. Default value is nullDynamicForm
instance, for chaining setter callspublic Alignment getTitleAlign()
text direction
as described in getTitleAlign()
FormItem.titleAlign
is specified, it will be
respectedthis.titleAlign
is
set, it will be respectedtext direction
; for titleOrientation
"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.public DynamicForm setTitleOrientation(TitleOrientation titleOrientation)
TitleOrientation
lists valid
options. Note that titles on the left or right take up a cell in tabular form layouts
, but titles on top do not.
If this method is called after the component has been drawn/initialized:
Modify this form's TitleOrientation
at runtime
titleOrientation
- new default item titleOrientation. Default value is "left"DynamicForm
instance, for chaining setter callsForm Titles
,
Titles Examplepublic TitleOrientation getTitleOrientation()
TitleOrientation
lists valid
options. Note that titles on the left or right take up a cell in tabular form layouts
, but titles on top do not.
Form Titles
,
Titles Examplepublic DynamicForm setTitlePrefix(java.lang.String titlePrefix)
titlePrefix
- New titlePrefix value. Default value is ""DynamicForm
instance, for chaining setter callsHTMLString
,
Form Titles
public java.lang.String getTitlePrefix()
HTMLString
,
Form Titles
public DynamicForm setTitleSuffix(java.lang.String titleSuffix)
titleSuffix
- New titleSuffix value. Default value is " :"DynamicForm
instance, for chaining setter callsHTMLString
,
Form Titles
public java.lang.String getTitleSuffix()
HTMLString
,
Form Titles
public DynamicForm setUnknownErrorMessage(java.lang.String unknownErrorMessage)
unknownErrorMessage
- New unknownErrorMessage value. Default value is "Invalid value"DynamicForm
instance, for chaining setter callsHTMLString
,
Validation overview and related methods
public java.lang.String getUnknownErrorMessage()
HTMLString
,
Validation overview and related methods
public DynamicForm setUserTask(UserTask userTask) throws java.lang.IllegalStateException
userTask
for more details.userTask
- New userTask value. Default value is nullDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic UserTask getUserTask()
userTask
for more details.public DynamicForm setValidateOnChange(java.lang.Boolean validateOnChange)
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.
validateOnChange
- New validateOnChange value. Default value is falseDynamicForm
instance, for chaining setter callsFormItem.setValidateOnChange(java.lang.Boolean)
,
Validation overview and related methods
public java.lang.Boolean getValidateOnChange()
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.
FormItem.getValidateOnChange()
,
Validation overview and related methods
public DynamicForm setValidateOnExit(java.lang.Boolean validateOnExit)
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.
validateOnExit
- New validateOnExit value. Default value is falseDynamicForm
instance, for chaining setter callsFormItem.setValidateOnExit(java.lang.Boolean)
public java.lang.Boolean getValidateOnExit()
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.
FormItem.getValidateOnExit()
public DynamicForm setValidationURL(java.lang.String validationURL)
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 by action
.
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.
validationURL
- New validationURL value. Default value is nullDynamicForm
instance, for chaining setter callssaveData()
,
submit()
,
URL
,
Validation overview and related methods
public java.lang.String getValidationURL()
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 by action
.
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.
saveData()
,
submit()
,
URL
,
Validation overview and related methods
public DynamicForm setValues(java.util.Map values)
form 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
and on 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 a TextItem
or CheckboxItem
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, or editNewRecord()
for a new record. In addition to setting the current values of the form, these APIs establish the DSRequest.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 via FormItem.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 its defaultValue
. To cause all FormItems to revert to default values, pass null.
This method also calls rememberValues()
so that a subsequent later call to resetValues()
will revert to the passed values.
values
- values for the form, or null to reset all items to default values. Default value is nullDynamicForm
instance, for chaining setter callspublic java.util.Map getValues()
form 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
and on 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 a TextItem
or CheckboxItem
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.
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()
or setValues()
. Default value is null
public DynamicForm setWrapHintText(java.lang.Boolean wrapHintText) throws java.lang.IllegalStateException
FormItem.hint
have the hint text wrap? May be overridden at the item level via FormItem.wrapHintText
. If wrapHintText
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
.
wrapHintText
- New wrapHintText value. Default value is trueDynamicForm
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdsetMinHintWidth(java.lang.Integer)
public java.lang.Boolean getWrapHintText()
FormItem.hint
have the hint text wrap? May be overridden at the item level via FormItem.wrapHintText
. If wrapHintText
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
.
getMinHintWidth()
public DynamicForm setWrapItemTitles(java.lang.Boolean wrapItemTitles)
FormItem.wrapTitle
wrapItemTitles
- New wrapItemTitles value. Default value is nullDynamicForm
instance, for chaining setter callsForm Titles
public java.lang.Boolean getWrapItemTitles()
FormItem.wrapTitle
Form Titles
public void assignItemsTabPositions()
Makes use of sortItemsIntoTabOrder()
to order the items and
ensures the items are ordered in the TabIndexManager
correctly.
public void cancel(DSRequest requestProperties)
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);
requestProperties
- additional properties to set on the RPCRequest that will be issuedcancelEditing()
,
Submitting overview and related methods
public void cancelEditing()
public java.util.Map checkForValidationErrors(ValidationStatusCallback callback)
valuesAreValid()
. In contrast to valuesAreValid()
, 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.
callback
- callback to invoke after validation is completeValidation overview and related methods
public java.util.Map checkForValidationErrors(ValidationStatusCallback callback, boolean validateHiddenFields)
public java.util.Map checkForValidationErrors(ValidationStatusCallback callback, boolean validateHiddenFields, boolean skipServerValidation)
valuesAreValid()
. In contrast to valuesAreValid()
, 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.
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 validationValidation overview and related methods
public void clearErrors(boolean show)
show
- If true, redraw the form to clear any visible error messages.Errors overview and related methods
public void clearFieldErrors(java.lang.String fieldName, boolean show)
fieldName
- field to clear errors fromshow
- If true this method will fall through to showFieldErrors()
to update the displayErrors overview and related methods
public void clearValue(java.lang.String fieldName)
FormItem.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.fieldName
- Name of the field being cleared. A DataPath
may be used for clearing details of nested
data structures.public void clearValues()
public void completeEditing()
process state
.public void editNewRecord()
setSaveOperationType()
to ensure subsequent calls to saveData()
will use an add
rather than
an update
operation.saveData()
,
DataBound Component Methods
public void editNewRecord(Record initialValues)
setSaveOperationType()
to ensure subsequent calls to saveData()
will use an add
rather than
an update
operation.initialValues
- initial set of values for the editor as a map of field names to their corresponding valuessaveData()
,
DataBound Component Methods
public void editNewRecord(java.util.Map initialValues)
setSaveOperationType()
to ensure subsequent calls to saveData()
will use an add
rather than
an update
operation.initialValues
- initial set of values for the editor as a map of field names to their corresponding valuessaveData()
,
DataBound Component Methods
public void editRecord(Record record)
setValues()
. This method will also call setSaveOperationType()
to ensure subsequent calls to
saveData()
will use an update
rather than an add
operation.
record
- the record to be edited as a map of field names to their corresponding valuessaveData()
,
DataBound Component Methods
public void fetchRelatedData(ListGridRecord record, Canvas schema)
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.
record
- DataSource recordschema
- schema of the DataSource record, or DataBoundComponent already bound to that schemaDataBound Component Methods
public void fetchRelatedData(ListGridRecord record, Canvas schema, DSCallback callback)
public void fetchRelatedData(ListGridRecord record, Canvas schema, DSCallback callback, DSRequest requestProperties)
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.
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 issuedDataBound Component Methods
public boolean fieldIsEditable(FormItem field)
canEdit
for the grid as well as the FormItem.canEdit
value,
to determine whether editing is actually allowed. For a detailed discussion, see the documentation at canEdit
.field
- field object or identifierGrid Editing
public boolean fieldIsEditable(int field)
canEdit
for the grid as well as the FormItem.canEdit
value,
to determine whether editing is actually allowed. For a detailed discussion, see the documentation at canEdit
.field
- field object or identifierGrid Editing
public boolean fieldIsEditable(java.lang.String field)
canEdit
for the grid as well as the FormItem.canEdit
value,
to determine whether editing is actually allowed. For a detailed discussion, see the documentation at canEdit
.field
- field object or identifierGrid Editing
public void focus()
getFocusItem()
) - otherwise focus will be
passed to the first focusable item in the form. To put focus in a specific item, use focusInItem()
instead.
public com.google.gwt.event.shared.HandlerRegistration addFormSubmitFailedHandler(FormSubmitFailedHandler handler)
Method called when an attempt to natively submit
a form
is unable to submit to the server. Default behavior is to display the DynamicForm.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
.
addFormSubmitFailedHandler
in interface HasFormSubmitFailedHandlers
handler
- the formSubmitFailed handlerHandlerRegistration
used to remove this handlerpublic FormItem getEventItem()
public FormItem getFocusItem()
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 to form.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
or RadioGroupItem
,
this method will return the parent item, not the sub-item.
isFocused()
,
FormItem.isFocused()
,
Focus
public AdvancedCriteria getValuesAsAdvancedCriteria()
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 specified FormItem.operator
AdvancedCriteria
based on the form's current valuesCriteria Editing
public AdvancedCriteria getValuesAsAdvancedCriteria(TextMatchStyle textMatchStyle)
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 specified FormItem.operator
textMatchStyle
- If specified the text match style will be used to generate the appropriate operator
for per field
criteria.AdvancedCriteria
based on the form's current valuesCriteria Editing
public com.google.gwt.event.shared.HandlerRegistration addAsyncValidationReplyHandler(AsyncValidationReplyHandler handler)
Notification fired when an asynchronous validation completes.
addAsyncValidationReplyHandler
in interface HasAsyncValidationReplyHandlers
handler
- the asyncValidationReply handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addHiddenValidationErrorsHandler(HiddenValidationErrorsHandler 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. Call HiddenValidationErrorsEvent.cancel()
from within
HiddenValidationErrorsHandler.onHiddenValidationErrors(com.smartgwt.client.widgets.form.events.HiddenValidationErrorsEvent)
from this method
to suppress that behavior.
addHiddenValidationErrorsHandler
in interface HasHiddenValidationErrorsHandlers
handler
- the hiddenValidationErrors handlerHandlerRegistration
used to remove this handlerpublic java.lang.Boolean hasErrors()
Note that validation errors are set up automatically by validation (see validate()
), or may be explicitly set via setErrors()
or setFieldErrors()
.
Errors overview and related methods
public java.lang.Boolean hasFieldErrors(java.lang.String fieldName)
Note that validation errors are set up automatically by validation (see validate()
), or may be explicitly set via setErrors()
or setFieldErrors()
.
fieldName
- field to test for validation errorsErrors overview and related methods
public void hideItem(java.lang.String itemName)
FormItem.hide()
itemName
- Name of the item to showpublic java.lang.Boolean isFocused()
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.
isFocused
in class Canvas
Canvas.containsFocus()
public java.lang.Boolean isNewRecord()
saveOperationType
is currently
"add". See saveOperationType
.public java.lang.Boolean isPendingAsyncValidation()
validate()
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.
public com.google.gwt.event.shared.HandlerRegistration addItemChangeHandler(ItemChangeHandler 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.
addItemChangeHandler
in interface HasItemChangeHandlers
handler
- the itemChange handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addItemChangedHandler(ItemChangedHandler 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.
addItemChangedHandler
in interface HasItemChangedHandlers
handler
- the itemChanged handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addItemKeyPressHandler(ItemKeyPressHandler 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.
addItemKeyPressHandler
in interface HasItemKeyPressHandlers
handler
- the itemKeyPress handlerHandlerRegistration
used to remove this handlerpublic void reset()
setValues()
or rememberValues()
was called. If
neither of those methods has been called, values will be set back to their initial values at init time.public void resetValues()
reset()
.public void saveData()
DataSource
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 though DataSource.addData()
or DataSource.updateData()
had been called with the form's values
as data. The DSRequest.operationType
will be either "update" or "add", depending
on the current saveOperationType
.
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()
or
ValuesManager.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 the requestProperties
parameter to force your callback to be invoked.
However, first consider:
built-in modes
and showErrors()
may be a better place to put customizations. 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.DataBound Component Methods
,
Add Examplepublic void saveData(DSCallback callback)
saveData()
public void saveData(DSCallback callback, DSRequest requestProperties)
DataSource
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 though DataSource.addData()
or DataSource.updateData()
had been called with the form's values
as data. The DSRequest.operationType
will be either "update" or "add", depending
on the current saveOperationType
.
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()
or
ValuesManager.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 the requestProperties
parameter to force your callback to be invoked.
However, first consider:
built-in modes
and showErrors()
may be a better place to put customizations. 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.callback
- callback to invoke on completionrequestProperties
- additional properties to set on the DSRequest that will be issuedDataBound Component Methods
,
Add Examplepublic void setValue(java.lang.String fieldName, java.lang.String value)
fieldName
- Name of the field being updated. A DataPath
may be passed to
set nested valuesvalue
- New value.public void setValuesAsCriteria(Criterion criteria)
Criterion
object or an AdvancedCriteria
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:
operator
for this form, the entire criteria will be nested in
an outer advanced criteria object with the appropriate operator.FormItem.shouldSaveValue
is true for the item and FormItem.canEditCriterion()
returns true for the
criterion in question. By default this method checks for a match with both the fieldName
and
operator
of the criterion. The criterion is actually passed to the item for editing via the
FormItemCriterionSetter
's setCriterion()
method. Note that these methods may be overridden
for custom handling. Also note that the default FormItemCriterionSetter.setCriterion()
implementation
used by CanvasItem
handles editing nested criteria via embedded
dynamicForms.getValuesAsCriteria()
is called.criteria
- criteria to edit.Criteria Editing
public void showFieldErrors(java.lang.String fieldName)
setFieldErrors()
/ addFieldErrors()
/ clearFieldErrors()
.showErrors()
.fieldName
- field to show errors forErrors overview and related methods
public void showItem(java.lang.String itemName)
FormItem.show()
itemName
- Name of the item to showpublic boolean showItemContextMenu(FormItem item)
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.
item
- the form item showing its context menupublic FormItem[] sortItemsIntoTabOrder()
Default behavior will respect explicitly specified tab index as a local tab index, otherwise just use specified order within the items array
public void submit()
submit()
is automatically called when a SubmitItem
included
in the form is clicked, or, if saveOnEnter
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, and form.submitValues()
exists, it will be called, and no further action will be taken.
Otherwise, default behavior
varies based on form.canSubmit
: if
canSubmit
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 via submitForm()
.
The parameters
to submit()
apply only if submit()
will be calling saveData()
. If you override submit()
, you can
safely ignore the parameters as Smart GWT framework code does not pass them.
SubmitValuesEvent
,
DataBound Component Methods
public void submit(DSCallback callback)
submit()
public void submit(DSCallback callback, DSRequest requestProperties)
submit()
is automatically called when a SubmitItem
included
in the form is clicked, or, if saveOnEnter
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, and form.submitValues()
exists, it will be called, and no further action will be taken.
Otherwise, default behavior
varies based on form.canSubmit
: if
canSubmit
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 via submitForm()
.
The parameters
to submit()
apply only if submit()
will be calling saveData()
. If you override submit()
, you can
safely ignore the parameters as Smart GWT framework code does not pass them.
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]SubmitValuesEvent
,
DataBound Component Methods
public void submitForm()
action
,
identically to how a plain HTML <form> element would submit data, as either an HTTP GET or POST as specified by
method
. Notes:
DataBound Component Methods
.canSubmit
must be set to true
HiddenItem
with a FormItem.defaultValue
set. This is analogous to
<input type="hidden"> in HTML forms. Submitting overview and related methods
public com.google.gwt.event.shared.HandlerRegistration addSubmitValuesHandler(SubmitValuesHandler handler)
Triggered when a SubmitItem is included in the form is submitted and gets pressed.
addSubmitValuesHandler
in interface HasSubmitValuesHandlers
handler
- the submitValues handlerHandlerRegistration
used to remove this handlerpublic boolean titleClipped(FormItem item)
item
- the form item.getClipItemTitles()
,
FormItem.getClipTitle()
public boolean validate()
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 via DynamicForm.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 use isPendingAsyncValidation()
and DynamicForm.asyncValidationReply()
to
detect and respond to asynchronous validation.
Note that for silent validation, valuesAreValid()
(client-side) and checkForValidationErrors()
(client and
server-side) can be used instead.
ValuesManager.validate()
,
Validation overview and related methods
,
Type Examplepublic boolean validate(boolean validateHiddenFields)
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 via DynamicForm.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 use isPendingAsyncValidation()
and DynamicForm.asyncValidationReply()
to
detect and respond to asynchronous validation.
Note that for silent validation, valuesAreValid()
(client-side) and checkForValidationErrors()
(client and
server-side) can be used instead.
validateHiddenFields
- Should validators be processed for non-visible fields such as dataSource fields with no associated item or
fields with visibility set to "hidden"
?ValuesManager.validate()
,
Validation overview and related methods
,
Type Examplepublic boolean validateData(DSCallback callback)
public 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. Errors, if any, can be discovered by looking at the DSResponse
object returned in the callback.
validateData()
will first call validate()
to check for client-side errors, and will return false
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 use DataSource.validateData()
with the
form's current values
. valuesAreValid()
can be used in lieu of a call to validate()
if silent checking of client-side errors is also
desired.
callback
- callback to invoke on completionrequestProperties
- additional properties to set on the DSRequest that will be issuedValidation overview and related methods
public boolean valuesAreValid(boolean validateHiddenFields)
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.
validateHiddenFields
- Should validators be processed for non-visible fields such as dataSource fields with no associated item or
fields with visibility set to "hidden"
?returnErrors
was specified, a map of field names to
the associated errors, for those fields that failed validation, or null if validation succeeded.Validation overview and related methods
public com.google.gwt.event.shared.HandlerRegistration addValuesChangedHandler(ValuesChangedHandler handler)
Handler fired when the entire set of values is replaced, as by a call to DynamicForm.setValues()
, DynamicForm.resetValues()
or DynamicForm.editRecord()
.
Note that it is invalid to call such methods from this handler because doing so would result in an infinite loop.
addValuesChangedHandler
in interface HasValuesChangedHandlers
handler
- the valuesChanged handlerHandlerRegistration
used to remove this handlerpublic java.lang.Boolean valuesHaveChanged()
rememberValues()
method. rememberValues()
runs when the form is initialized and on every call to setValues()
. Returns true if the values have changed, and false otherwise.getChangedValues()
,
getOldValues()
public void viewSelectedData(ListGrid selectionComponent)
For a DynamicForm the first record of the selection is shown after the form is placed into read-only mode
. A subsequent call to editRecord()
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.
selectionComponent
- the ListGrid or TileGrid or ID of a ListGrid
/TileGrid
whose currently selected record(s) is/are to be viewedDataBound Component Methods
public void viewSelectedData(TileGrid selectionComponent)
For a DynamicForm the first record of the selection is shown after the form is placed into read-only mode
. A subsequent call to editRecord()
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.
selectionComponent
- the ListGrid or TileGrid or ID of a ListGrid
/TileGrid
whose currently selected record(s) is/are to be viewedDataBound Component Methods
public void viewSelectedData(java.lang.String selectionComponent)
For a DynamicForm the first record of the selection is shown after the form is placed into read-only mode
. A subsequent call to editRecord()
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.
selectionComponent
- the ListGrid or TileGrid or ID of a ListGrid
/TileGrid
whose currently selected record(s) is/are to be viewedDataBound Component Methods
public static void setDefaultProperties(DynamicForm dynamicFormProperties)
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.
dynamicFormProperties
- properties that should be used as new defaults when instances of this class are createdSGWTProperties
protected void onInit_DynamicForm()
public void showErrors()
setErrors(java.util.Map, boolean)
or
validate()
.
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.
public DynamicForm setValuesManager(ValuesManager valuesManager) throws java.lang.IllegalStateException
valuesManager.addMember(form)
and
valuesManager.removeMember(form)
Note : This is an advanced setting
setValuesManager
in class Canvas
valuesManager
- valuesManager Default value is nullDynamicForm
instance, for
chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic ValuesManager getValuesManager()
getValuesManager
in class Canvas
public void setCellSpacing(int cellSpacing) throws java.lang.IllegalStateException
setCellPadding(int)
insteadcellSpacing
- the cellSpacingjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic int getCellSpacing()
getCellPadding()
insteadpublic void setUseAllDataSourceFields(boolean useAllDataSourceFields)
useAllDataSourceFields
- useAllDataSourceFieldspublic java.util.Map getChangedValues()
DynamicForm.rememberValues
last ran. Note that DynamicForm.rememberValues
runs on dynamicForm
initialization, and with every call to DynamicForm.setValues
so this will typically contain all values the user has explicitly edited since then.public java.util.Map getOldValues()
DynamicForm.rememberValues
. Note that rememberValues()
is called automatically by DynamicForm.setValues
, and on form initialization, so this
typically contains all values as they were before the user edited them.public void setValue(java.lang.String fieldName, double value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, boolean value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, int[] value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, java.util.Date value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, java.lang.String[] value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, java.util.Map value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, com.google.gwt.core.client.JavaScriptObject value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, Record value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, DataClass value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, Record[] value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, DataClass[] value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, RelativeDate value)
fieldName
- Name of the field being updatedvalue
- New value.public void setItems(FormItem... items)
items
- the itemspublic void setFields(FormItem... fields)
fields
and dataSource
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.fields
- form item fieldspublic FormItem[] getFields()
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 specified dataSource
, fields
from the datasource are combined with fields specified explicitly on the component. It also ensures
that if fields were specified explicitly as JavaScriptObjects using
setFields()
, the returned FormItems will be of the
correct subclass.
To retrieve the form fields as specified without forcing creation in JavaScript, use
getFields(false)
public FormItem[] getFields(java.lang.Boolean forceCreation)
false
to this method
will avoid creating
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 as
FormItem
s before the DynamicForm
has been created
, as this may
result in the incorrect subclass of FormItem being built. Instead, use
getFieldsAsJavaScriptObjects()
.
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.
forceCreation
- controls whether the DynamicForm should be created if this has not already happenedpublic FormItem getItem(java.lang.String name)
name
or dataPath
.
This method will always create its parent form in JavaScript.name
- public FormItem getField(java.lang.String name)
name
.
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 specified dataSource
, fields
from the datasource are combined with fields specified explicitly on the component. It also ensures
that if fields were specified explicitly as JavaScriptObjects using
setFields()
, 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)
name
- name of the field to returnpublic FormItem getField(java.lang.String name, java.lang.Boolean forceCreation)
name
.
Passing a forceCreation parameter of false
to this method
will avoid creating
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
name
- name of the field to returnforceCreation
- controls whether the DynamicForm should be created if this has not already happenedpublic java.lang.String getValueAsString(java.lang.String fieldName)
public java.lang.Object getValue(java.lang.String fieldName)
public FormItemEventInfo getEventItemInfo(java.lang.String fieldName)
fieldName
- the field namepublic void editSelectedData(ListGrid selectionComponent)
saveData()
will use the "update" operation type.selectionComponent
- the List Grid whose currently selected record(s) is/are to be editedpublic void editSelectedData(java.lang.String listGridID)
saveData()
will use the "update" operation type.listGridID
- the List Grid ID whose currently selected record(s) is/are to be editedpublic Criteria getValuesAsCriteria()
public Record getValuesAsRecord()
public void setColWidths(java.lang.Object... colWidths)
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:
colWidths
- the column widthspublic DSOperationType getSaveOperationType(DSRequest requestProperties)
DSOperationType
to be performed when DynamicForm.saveData
is called. This property is automatically
set on a call to DynamicForm.editRecord
or DynamicForm.editNewRecord
, or may be set directly via
DynamicForm.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.
requestProperties
- Optional DSRequest config properties for the save operationDSOperationType
to be performed when DynamicForm.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. Otherwise saveOperationType
will be returned.
public void setTitleWidth(int titleWidth)
colWidths
,
you can set this value to the string "*" to divide the usable space evenly between titles and fields.titleWidth
- the title widthpublic void setTitleWidth(java.lang.String titleWidth)
colWidths
,
you can set this value to the string "*" to divide the usable space evenly between titles and fields.titleWidth
- the title widthpublic void setErrorOrientation(FormErrorOrientation errorOrientation)
May be overridden at the item level via FormItem.setErrorOrientation(com.smartgwt.client.types.FormErrorOrientation)
.
errorOrientation
- the error orientationpublic void focusInItem(int itemNumber)
itemNumber
- the item numberpublic void focusInItem(java.lang.String itemName)
itemName
- the item namepublic void focusInItem(FormItem formItem)
formItem
- the form itempublic void setErrors(java.util.Map errors, boolean showErrors)
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 calling
showErrors()
Note: When the errors are shown, handleHiddenValidationErrors() will be fired for errors
on hidden fields, or with no associated formItem.public java.util.Map getErrors()
public void setFieldErrors(java.lang.String fieldName, java.lang.String error, boolean showErrors)
showFieldErrors(java.lang.String)
will display the errors for this field.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 displaypublic void setFieldErrors(java.lang.String fieldName, java.lang.String[] errors, boolean showErrors)
showFieldErrors(java.lang.String)
will display the errors for this field.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 displaypublic java.lang.String[] getFieldErrors(java.lang.String fieldName)
fieldName
- the field namepublic com.google.gwt.core.client.JavaScriptObject rememberValues()
public void setItemHoverFormatter(FormItemHoverFormatter hoverFormatter)
hoverFormatter
- the hover formatterpublic void setItemTitleHoverFormatter(FormItemHoverFormatter hoverFormatter)
FormItemHoverFormatter
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.hoverFormatter
- the hover formattertitleClipped(com.smartgwt.client.widgets.form.fields.FormItem)
public void setItemValueHoverFormatter(FormItemHoverFormatter hoverFormatter)
FormItemHoverFormatter
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.hoverFormatter
- the hover formatterFormItem.valueClipped()
public void setDataSource(DataSource dataSource, FormItem... fields)
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().
dataSource
- fields
- public static void setSkipConversionOnMapping(java.lang.Boolean convert)
convert
- Whether the mapDisplayTovalue() method should skip conversion of its return value to a native Java Mappublic static java.lang.Boolean getSkipConversionOnMapping()
setSkipConversionOnMapping(java.lang.Boolean)
public DynamicForm setDataPageSize(int dataPageSize)
DataBoundComponent
data
paging
, how many records to fetch at a time. If set to a positive integer,
dataPageSize
will override the default resultSize
for ResultSets
automatically created when you call fetchData()
(and similarly for
the resultSize
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 as showAllRecords:true
, drawAllMaxCells
and drawAheadRatio
can cause
more rows than the configured dataPageSize
to be fetched.
setDataPageSize
in interface DataBoundComponent
dataPageSize
- dataPageSize Default value is 0DataBoundComponent
instance, for chaining setter callsDatabinding overview and related methods
public int getDataPageSize()
DataBoundComponent
data
paging
, how many records to fetch at a time. If set to a positive integer,
dataPageSize
will override the default resultSize
for ResultSets
automatically created when you call fetchData()
(and similarly for
the resultSize
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 as showAllRecords:true
, drawAllMaxCells
and drawAheadRatio
can cause
more rows than the configured dataPageSize
to be fetched.
getDataPageSize
in interface DataBoundComponent
Databinding overview and related methods
public DynamicForm setUseAllDataSourceFields(java.lang.Boolean useAllDataSourceFields)
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.
setUseAllDataSourceFields
in interface DataBoundComponent
useAllDataSourceFields
- useAllDataSourceFields Default value is falseDataBoundComponent
instance, for chaining setter callspublic java.lang.Boolean getUseAllDataSourceFields()
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.
getUseAllDataSourceFields
in interface DataBoundComponent
public DynamicForm setSparseFieldState(java.lang.Boolean sparseFieldState)
DataBoundComponent
ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
will omit state
information for hidden fields by default.setSparseFieldState
in interface DataBoundComponent
sparseFieldState
- sparseFieldState Default value is falseDataBoundComponent
instance, for chaining setter callspublic java.lang.Boolean getSparseFieldState()
DataBoundComponent
ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
will omit state
information for hidden fields by default.getSparseFieldState
in interface DataBoundComponent
public DynamicForm setShowHiddenFields(java.lang.Boolean showHiddenFields)
DataBoundComponent
hidden:true
when a DataBoundComponent is given a
DataSource but no component.fields
.
The hidden
property is used on DataSource fields to mark fields that are
never of meaning to an end user.
setShowHiddenFields
in interface DataBoundComponent
showHiddenFields
- showHiddenFields Default value is falseDataBoundComponent
instance, for chaining setter callspublic java.lang.Boolean getShowHiddenFields()
DataBoundComponent
hidden:true
when a DataBoundComponent is given a
DataSource but no component.fields
.
The hidden
property is used on DataSource fields to mark fields that are
never of meaning to an end user.
getShowHiddenFields
in interface DataBoundComponent
public DynamicForm setShowComplexFields(java.lang.Boolean showComplexFields)
DataBoundComponent
component.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
setShowComplexFields
in interface DataBoundComponent
showComplexFields
- showComplexFields Default value is trueDataBoundComponent
instance, for chaining setter callspublic java.lang.Boolean getShowComplexFields()
DataBoundComponent
component.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.
getShowComplexFields
in interface DataBoundComponent
public DynamicForm setFetchOperation(java.lang.String fetchOperation)
DataBoundComponent
setFetchOperation
in interface DataBoundComponent
fetchOperation
- fetchOperation Default value is nullDataBoundComponent
instance, for chaining setter callspublic java.lang.String getFetchOperation()
DataBoundComponent
getFetchOperation
in interface DataBoundComponent
public DynamicForm setUpdateOperation(java.lang.String updateOperation)
DataBoundComponent
operationId
this component
should use when performing update operations.setUpdateOperation
in interface DataBoundComponent
updateOperation
- Default value is nullDataBoundComponent
instance, for chaining setter callsOperations overview and related methods
public java.lang.String getUpdateOperation()
DataBoundComponent
operationId
this component
should use when performing update operations.getUpdateOperation
in interface DataBoundComponent
Operations overview and related methods
public DynamicForm setAddOperation(java.lang.String addOperation)
DataBoundComponent
operationId
this component
should use when performing add operations.setAddOperation
in interface DataBoundComponent
addOperation
- Default value is nullDataBoundComponent
instance, for chaining setter callsOperations overview and related methods
public java.lang.String getAddOperation()
DataBoundComponent
operationId
this component
should use when performing add operations.getAddOperation
in interface DataBoundComponent
Operations overview and related methods
public DynamicForm setRemoveOperation(java.lang.String removeOperation)
DataBoundComponent
operationId
this component
should use when performing remove operations.setRemoveOperation
in interface DataBoundComponent
removeOperation
- Default value is nullDataBoundComponent
instance, for chaining setter callsOperations overview and related methods
public java.lang.String getRemoveOperation()
DataBoundComponent
operationId
this component
should use when performing remove operations.getRemoveOperation
in interface DataBoundComponent
Operations overview and related methods
public DynamicForm setExportFields(java.lang.String[] exportFields)
DataBoundComponent
If exportFields is not provided, the exported output includes all visible fields from this component, sorted as they appear.
setExportFields
in interface DataBoundComponent
exportFields
- exportFields Default value is nullDataBoundComponent
instance, for chaining setter callspublic java.lang.String[] getExportFields()
DataBoundComponent
If exportFields is not provided, the exported output includes all visible fields from this component, sorted as they appear.
getExportFields
in interface DataBoundComponent
public DynamicForm setExportAll(java.lang.Boolean exportAll)
DataBoundComponent
fields
.
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.
setExportAll
in interface DataBoundComponent
exportAll
- exportAll Default value is falseDataBoundComponent
instance, for chaining setter callspublic java.lang.Boolean getExportAll()
DataBoundComponent
fields
.
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.
getExportAll
in interface DataBoundComponent
public DynamicForm setExportIncludeSummaries(java.lang.Boolean exportIncludeSummaries)
DataBoundComponent
setExportIncludeSummaries
in interface DataBoundComponent
exportIncludeSummaries
- exportIncludeSummaries Default value is trueDataBoundComponent
instance, for chaining setter callspublic java.lang.Boolean getExportIncludeSummaries()
DataBoundComponent
getExportIncludeSummaries
in interface DataBoundComponent
public DynamicForm setPreventDuplicates(java.lang.Boolean preventDuplicates) throws java.lang.IllegalStateException
DataBoundComponent
DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent)
.
When a duplicate transfer is detected,
a dialog will appear showing the duplicateDragMessage
.
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.
setPreventDuplicates
in interface DataBoundComponent
preventDuplicates
- preventDuplicates Default value is nullDataBoundComponent
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getPreventDuplicates()
DataBoundComponent
DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent)
.
When a duplicate transfer is detected,
a dialog will appear showing the duplicateDragMessage
.
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.
getPreventDuplicates
in interface DataBoundComponent
public DynamicForm setDuplicateDragMessage(java.lang.String duplicateDragMessage) throws java.lang.IllegalStateException
DataBoundComponent
preventDuplicates
is enabled. If set to null, duplicates will not be reported and the dragged duplicates will not be saved.setDuplicateDragMessage
in interface DataBoundComponent
duplicateDragMessage
- duplicateDragMessage Default value is "Duplicates not allowed"DataBoundComponent
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getDuplicateDragMessage()
DataBoundComponent
preventDuplicates
is enabled. If set to null, duplicates will not be reported and the dragged duplicates will not be saved.getDuplicateDragMessage
in interface DataBoundComponent
public DynamicForm setAddDropValues(java.lang.Boolean addDropValues)
DataBoundComponent
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
setAddDropValues
in interface DataBoundComponent
addDropValues
- addDropValues Default value is trueDataBoundComponent
instance, for chaining setter callspublic java.lang.Boolean getAddDropValues()
DataBoundComponent
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
getAddDropValues
in interface DataBoundComponent
public DynamicForm setDropValues(java.util.Map dropValues)
DataBoundComponent
addDropValues
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
setDropValues
in interface DataBoundComponent
dropValues
- dropValues Default value is nullDataBoundComponent
instance, for chaining setter callspublic java.util.Map getDropValues()
DataBoundComponent
addDropValues
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
getDropValues
in interface DataBoundComponent
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:
addDropValues
is falseYou can override this method if you need more complex setting of drop values than can be provided by simply supplying a dropValues object.
public DynamicForm setProgressiveLoading(java.lang.Boolean progressiveLoading)
progressively
progressiveLoading
- DataBoundComponent
instance, for chaining setter callsProgressiveLoading
,
DataSource.setProgressiveLoading(java.lang.Boolean)
public java.lang.Boolean getProgressiveLoading()
progressively
ProgressiveLoading
,
DataSource.getProgressiveLoading()
public DynamicForm setUseFlatFields(java.lang.Boolean useFlatFields) throws java.lang.IllegalStateException
DataBoundComponent
useFlatFields
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>Setting
useFlatFields
on a DynamicForm
that is bound to this input
message schema would result in 5 FormItem
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 a
WebService
, these values can be automatically
mapped to the structure of the input message for a web service operation by setting
useFlatFields
(for use with WebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback)
) or by setting
useFlatFields
(for use with a DataSource
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.
setUseFlatFields
in interface DataBoundComponent
useFlatFields
- useFlatFields Default value is nullDataBoundComponent
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getUseFlatFields()
DataBoundComponent
useFlatFields
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>Setting
useFlatFields
on a DynamicForm
that is bound to this input
message schema would result in 5 FormItem
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 a
WebService
, these values can be automatically
mapped to the structure of the input message for a web service operation by setting
useFlatFields
(for use with WebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback)
) or by setting
useFlatFields
(for use with a DataSource
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.
getUseFlatFields
in interface DataBoundComponent
public DynamicForm setHiliteProperty(java.lang.String hiliteProperty)
DataBoundComponent
id
for a hilite defined on this component.setHiliteProperty
in interface DataBoundComponent
hiliteProperty
- hiliteProperty Default value is "_hilite"DataBoundComponent
instance, for chaining setter callspublic java.lang.String getHiliteProperty()
DataBoundComponent
id
for a hilite defined on this component.getHiliteProperty
in interface DataBoundComponent
public void editFields()
public void editHilites()
DataBoundComponent
editHilites
in interface DataBoundComponent
public java.lang.String getHiliteState()
DataBoundComponent
getHiliteState
in interface DataBoundComponent
public DynamicForm setHiliteState(java.lang.String hiliteState)
DataBoundComponent
setHiliteState
in interface DataBoundComponent
hiliteState
- hilites state encoded as a StringDataBoundComponent
instance, for chaining setter callspublic DynamicForm setHilites(Hilite[] hilites)
DataBoundComponent
getHilites
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.
setHilites
in interface DataBoundComponent
hilites
- array of hilite objectsDataBoundComponent
instance, for chaining setter callspublic Hilite[] getHilites()
DataBoundComponent
getHilites
in interface DataBoundComponent
public DynamicForm setDragDataAction(DragDataAction dragDataAction)
DataBoundComponent
setDragDataAction
in interface DataBoundComponent
dragDataAction
- dragDataAction Default value is Canvas.MOVEDataBoundComponent
instance, for chaining setter callspublic DragDataAction getDragDataAction()
DataBoundComponent
getDragDataAction
in interface DataBoundComponent
public DynamicForm setDragTrackerStyle(java.lang.String dragTrackerStyle)
DataBoundComponent
setDragTrackerStyle
in interface DataBoundComponent
dragTrackerStyle
- dragTrackerStyle Default value is "gridDragTracker"DataBoundComponent
instance, for chaining setter callspublic java.lang.String getDragTrackerStyle()
DataBoundComponent
getDragTrackerStyle
in interface DataBoundComponent
public DynamicForm setCanAddFormulaFields(java.lang.Boolean canAddFormulaFields)
DataBoundComponent
com.smartgwt.client..FormulaBuilder
.
User-added formula fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
setCanAddFormulaFields
in interface DataBoundComponent
canAddFormulaFields
- canAddFormulaFields Default value is falseDataBoundComponent
instance, for chaining setter callspublic void addSummaryField()
DataBoundComponent
com.smartgwt.client..SummaryBuilder
to create a new Summary Field. This
is equivalent to calling DataBoundComponentGen#editSummaryField
with
no parameter.
addSummaryField
in interface DataBoundComponent
public void addFormulaField()
DataBoundComponent
com.smartgwt.client..FormulaBuilder
to create a new Formula Field. This
is equivalent to calling DataBoundComponentGen#editFormulaField
with
no parameter.
addFormulaField
in interface DataBoundComponent
public java.lang.Boolean getCanAddFormulaFields()
DataBoundComponent
com.smartgwt.client..FormulaBuilder
.
User-added formula fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
getCanAddFormulaFields
in interface DataBoundComponent
public DynamicForm setAddFormulaFieldText(java.lang.String addFormulaFieldText)
DataBoundComponent
setAddFormulaFieldText
in interface DataBoundComponent
addFormulaFieldText
- addFormulaFieldText Default value is "Add formula column..."DataBoundComponent
instance, for chaining setter callspublic java.lang.String getAddFormulaFieldText()
DataBoundComponent
getAddFormulaFieldText
in interface DataBoundComponent
public DynamicForm setEditFormulaFieldText(java.lang.String editFormulaFieldText)
DataBoundComponent
setEditFormulaFieldText
in interface DataBoundComponent
editFormulaFieldText
- editFormulaFieldText Default value is "Edit formula..."DataBoundComponent
instance, for chaining setter callspublic java.lang.String getEditFormulaFieldText()
DataBoundComponent
getEditFormulaFieldText
in interface DataBoundComponent
public DynamicForm setCanAddSummaryFields(java.lang.Boolean canAddSummaryFields)
DataBoundComponent
com.smartgwt.client..SummaryBuilder
.
User-added summary fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
setCanAddSummaryFields
in interface DataBoundComponent
canAddSummaryFields
- canAddSummaryFields Default value is falseDataBoundComponent
instance, for chaining setter callspublic java.lang.Boolean getCanAddSummaryFields()
DataBoundComponent
com.smartgwt.client..SummaryBuilder
.
User-added summary fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
getCanAddSummaryFields
in interface DataBoundComponent
public DynamicForm setAddSummaryFieldText(java.lang.String addSummaryFieldText)
DataBoundComponent
setAddSummaryFieldText
in interface DataBoundComponent
addSummaryFieldText
- addSummaryFieldText Default value is "Add summary column..."DataBoundComponent
instance, for chaining setter callspublic java.lang.String getAddSummaryFieldText()
DataBoundComponent
getAddSummaryFieldText
in interface DataBoundComponent
public DynamicForm setEditSummaryFieldText(java.lang.String editSummaryFieldText)
DataBoundComponent
setEditSummaryFieldText
in interface DataBoundComponent
editSummaryFieldText
- editSummaryFieldText Default value is "Edit summary format..."DataBoundComponent
instance, for chaining setter callspublic java.lang.String getEditSummaryFieldText()
DataBoundComponent
getEditSummaryFieldText
in interface DataBoundComponent
public DynamicForm setSavedSearchId(java.lang.String savedSearchId)
DataBoundComponent
By default
SavedSearches
are associated with a component via its
local ID
and
DataSource 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 explicit
Canvas.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.
setSavedSearchId
in interface DataBoundComponent
savedSearchId
- New savedSearchId value. Default value is nullDataBoundComponent
instance, for chaining setter callspublic java.lang.String getSavedSearchId()
DataBoundComponent
By default
SavedSearches
are associated with a component via its
local ID
and
DataSource 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 explicit
Canvas.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.
getSavedSearchId
in interface DataBoundComponent
public DynamicForm setShowSavedSearchesByDS(boolean showSavedSearchesByDS) throws java.lang.IllegalStateException
DataBoundComponent
DataSource
of a component when a
savedSearchId
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
setShowSavedSearchesByDS
in interface DataBoundComponent
showSavedSearchesByDS
- New showSavedSearchesByDS value. Default value is trueDataBoundComponent
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has
been createdpublic boolean getShowSavedSearchesByDS()
DataBoundComponent
DataSource
of a component when a
savedSearchId
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.
getShowSavedSearchesByDS
in interface DataBoundComponent
public Record[] findAll(AdvancedCriteria adCriteria)
adCriteria
- AdvancedCriteria to use to filter resultspublic Record find(AdvancedCriteria adCriteria)
adCriteria
- AdvancedCriteria to use to filter resultspublic int findIndex(AdvancedCriteria adCriteria)
adCriteria
- AdvancedCriteria to use to filter resultspublic int findNextIndex(int startIndex, AdvancedCriteria adCriteria, int endIndex)
RecordList.findIndex(java.util.Map)
, but considering the startIndex and endIndex parameters.startIndex
- first index to consideradCriteria
- AdvancedCriteria to use to filter resultsendIndex
- last index to considerpublic int findNextIndex(int startIndex, AdvancedCriteria adCriteria)
RecordList.findIndex(java.util.Map)
, but considering the startIndex parameter.startIndex
- first index to consideradCriteria
- AdvancedCriteria to use to filter resultspublic void selectRecord(Record record)
DataBoundComponent
Record
passed in explicitly, or by index.selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectpublic void selectRecord(int record)
DataBoundComponent
Record
passed in explicitly, or by index.selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectpublic void selectRecord(int record, boolean newState)
DataBoundComponent
Record
passed in explicitly, or by index.selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectnewState
- new selection state (if null, defaults to true)public void selectRecord(Record record, boolean newState)
DataBoundComponent
Record
passed in explicitly, or by index.selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectnewState
- new selection state (if null, defaults to true)public void selectRecords(int[] records)
DataBoundComponent
Record
s passed in explicitly, or by index.selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectpublic void selectRecords(int[] records, boolean newState)
DataBoundComponent
Record
s passed in explicitly, or by index.selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectnewState
- new selection statepublic void selectRecords(Record[] records)
DataBoundComponent
Record
s passed in explicitly, or by index.selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectpublic void selectRecords(Record[] records, boolean newState)
DataBoundComponent
Record
s passed in explicitly, or by index.selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectnewState
- new selection state (if null, defaults to true)public void deselectRecord(Record record)
DataBoundComponent
Record
passed in explicitly, or by index. Synonym for
selectRecord(record, false)
deselectRecord
in interface DataBoundComponent
record
- record (or row number) to deselectpublic void deselectRecord(int record)
DataBoundComponent
Record
passed in explicitly, or by index. Synonym for
selectRecord(record, false)
deselectRecord
in interface DataBoundComponent
record
- record (or row number) to deselectpublic void deselectRecords(int[] records)
DataBoundComponent
Record
s passed in explicitly, or by index. Synonym
for selectRecords(records, false)
deselectRecords
in interface DataBoundComponent
records
- records (or row numbers) to deselectpublic void deselectRecords(Record[] records)
DataBoundComponent
Record
s passed in explicitly, or by index. Synonym
for selectRecords(records, false)
deselectRecords
in interface DataBoundComponent
records
- records (or row numbers) to deselectpublic void selectAllRecords()
DataBoundComponent
selectAllRecords
in interface DataBoundComponent
public void deselectAllRecords()
DataBoundComponent
deselectAllRecords
in interface DataBoundComponent
public java.lang.Boolean anySelected()
DataBoundComponent
anySelected
in interface DataBoundComponent
public void enableHilite(java.lang.String hiliteID)
DataBoundComponent
hilites
enableHilite
in interface DataBoundComponent
hiliteID
- ID of hilite to enablepublic void enableHilite(java.lang.String hiliteID, boolean enable)
DataBoundComponent
hilites
enableHilite
in interface DataBoundComponent
hiliteID
- ID of hilite to enableenable
- new enabled state to apply - if null, defaults to truepublic void disableHilite(java.lang.String hiliteID)
DataBoundComponent
disableHilite
in interface DataBoundComponent
hiliteID
- ID of hilite to disablepublic void enableHiliting()
DataBoundComponent
enableHiliting
in interface DataBoundComponent
public void enableHiliting(boolean enable)
DataBoundComponent
enableHiliting
in interface DataBoundComponent
enable
- new enabled state to apply - if null, defaults to truepublic void disableHiliting()
DataBoundComponent
disableHiliting
in interface DataBoundComponent
public Record[] getDragData()
DataBoundComponent
This method is consulted by
ListGrid.willAcceptDrop()
.
getDragData
in interface DataBoundComponent
Record
s that are currently selected.public void transferSelectedData(DataBoundComponent source)
DataBoundComponent
DataBoundComponent.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 the drop()
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, use addDropCompleteHandler
.
See the Dragging
documentation for an overview of list grid drag/drop data transfer.
transferSelectedData
in interface DataBoundComponent
source
- source component from which the records will be tranferredpublic void transferSelectedData(DataBoundComponent source, int index)
DataBoundComponent
DataBoundComponent.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 the drop()
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, use addDropCompleteHandler
.
See the Dragging
documentation for an overview of list grid drag/drop data transfer.
transferSelectedData
in interface DataBoundComponent
source
- source component from which the records will be transferredindex
- target index (drop position) of the rows within this grid.public int getRecordIndex(Record record)
DataBoundComponent
Override in subclasses to provide more specific behaviour, for instance, when data holds a large number of records
getRecordIndex
in interface DataBoundComponent
record
- the record whose index is to be retrievedpublic java.lang.String getTitleFieldValue(Record record)
DataBoundComponent
Override in subclasses
getTitleFieldValue
in interface DataBoundComponent
record
- the record whose index is to be retrievedpublic DynamicForm setTitleField(java.lang.String titleField)
DataBoundComponent
setTitleField
in interface DataBoundComponent
DataBoundComponent
instance, for chaining setter callspublic java.lang.String getTitleField()
DataBoundComponent
titleField
for databound
components."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.
getTitleField
in interface DataBoundComponent
public DataSource getDataSource()
DataBoundComponent
DataSource requests
.getDataSource
in interface DataBoundComponent
public DynamicForm setAutoFetchData(java.lang.Boolean autoFetchData) throws java.lang.IllegalStateException
DataBoundComponent
DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
depending on
DataBoundComponent.getAutoFetchAsFilter()
. Criteria for this fetch may be picked up from initialCriteria
and textMatchStyle may be specified via DataBoundComponent.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.
setAutoFetchData
in interface DataBoundComponent
autoFetchData
- autoFetchDataDataBoundComponent
instance, for chaining setter callsjava.lang.IllegalStateException
public java.lang.Boolean getAutoFetchData()
DataBoundComponent
DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
depending on
DataBoundComponent.getAutoFetchAsFilter()
. Criteria for this fetch may be picked up from initialCriteria
and textMatchStyle may be specified via DataBoundComponent.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.
getAutoFetchData
in interface DataBoundComponent
public DynamicForm setAutoFetchTextMatchStyle(TextMatchStyle autoFetchTextMatchStyle) throws java.lang.IllegalStateException
DataBoundComponent
autoFetchData
is true
, this attribute allows the developer to specify a textMatchStyle
for the initial DataBoundComponent.fetchData()
call.setAutoFetchTextMatchStyle
in interface DataBoundComponent
DataBoundComponent
instance, for chaining setter callsjava.lang.IllegalStateException
public TextMatchStyle getAutoFetchTextMatchStyle()
DataBoundComponent
autoFetchData
is true
, this attribute allows the developer to specify a textMatchStyle
for the initial DataBoundComponent.fetchData()
call.getAutoFetchTextMatchStyle
in interface DataBoundComponent
public DynamicForm setAutoFetchAsFilter(java.lang.Boolean autoFetchAsFilter) throws java.lang.IllegalStateException
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
setAutoFetchAsFilter
in interface DataBoundComponent
autoFetchAsFilter
- autoFetchAsFilterDataBoundComponent
instance, for chaining setter callsjava.lang.IllegalStateException
public java.lang.Boolean getAutoFetchAsFilter()
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
getAutoFetchAsFilter
in interface DataBoundComponent
public DynamicForm setInitialCriteria(Criteria initialCriteria) throws java.lang.IllegalStateException
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is used.setInitialCriteria
in interface DataBoundComponent
initialCriteria
- the initial criteriaDataBoundComponent
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic Criteria getInitialCriteria()
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is used.getInitialCriteria
in interface DataBoundComponent
public DynamicForm setImplicitCriteria(Criteria implicitCriteria)
DataBoundComponent
DataBoundComponent.initialCriteria
,
DataBoundComponent.setCriteria()
etc.setImplicitCriteria
in interface DataBoundComponent
implicitCriteria
- New implicitCriteria value. Default value is nullDataBoundComponent
instance, for chaining setter callspublic java.lang.Boolean setImplicitCriteria(Criteria implicitCriteria, DSCallback callback)
public java.lang.Boolean setImplicitCriteria(Criteria criteria, DSCallback callback, java.lang.Boolean initialFetch)
public Criteria getImplicitCriteria()
DataBoundComponent
DataBoundComponent.initialCriteria
,
DataBoundComponent.setCriteria()
etc.getImplicitCriteria
in interface DataBoundComponent
public void fetchData()
DataBoundComponent
When fetchData()
is first called, if data has not already been provided via
setData()
, this method will create a ResultSet
, which will be
configured based on component settings such as fetchOperation
and dataPageSize
, as well
as the general purpose dataProperties
. 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 to fetchData()
- this may result in two DSRequests to fetch data. Use
either autoFetchData
and setAutoFetchCriteria()
or a manual call to fetchData()
passing criteria.
Whether a ResultSet was automatically created or provided via setData()
, subsequent
calls to fetchData() will simply call resultSet.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 using invalidateCache()
there is no need to also call fetchData()
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 use
resultSet.willFetchData()
to determine whether or not a server
fetch will occur when fetchData()
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.
fetchData
in interface DataBoundComponent
public void fetchData(Criteria criteria)
DataBoundComponent
When fetchData()
is first called, if data has not already been provided via
setData()
, this method will create a ResultSet
, which will be
configured based on component settings such as fetchOperation
and dataPageSize
, as well
as the general purpose dataProperties
. 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 to fetchData()
- this may result in two DSRequests to fetch data. Use
either autoFetchData
and setAutoFetchCriteria()
or a manual call to fetchData()
passing criteria.
Whether a ResultSet was automatically created or provided via setData()
, subsequent
calls to fetchData() will simply call resultSet.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 using invalidateCache()
there is no need to also call fetchData()
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 use
resultSet.willFetchData()
to determine whether or not a server
fetch will occur when fetchData()
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.
fetchData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling getValuesAsCriteria()
public void fetchData(Criteria criteria, DSCallback callback)
DataBoundComponent
When fetchData()
is first called, if data has not already been provided via
setData()
, this method will create a ResultSet
, which will be
configured based on component settings such as fetchOperation
and dataPageSize
, as well
as the general purpose dataProperties
. 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 to fetchData()
- this may result in two DSRequests to fetch data. Use
either autoFetchData
and setAutoFetchCriteria()
or a manual call to fetchData()
passing criteria.
Whether a ResultSet was automatically created or provided via setData()
, subsequent
calls to fetchData() will simply call resultSet.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 using invalidateCache()
there is no need to also call fetchData()
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 use
resultSet.willFetchData()
to determine whether or not a server
fetch will occur when fetchData()
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.
fetchData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires only
if server contact was requiredpublic void fetchData(Criteria criteria, DSCallback callback, DSRequest requestProperties)
DataBoundComponent
When fetchData()
is first called, if data has not already been provided via
setData()
, this method will create a ResultSet
, which will be
configured based on component settings such as fetchOperation
and dataPageSize
, as well
as the general purpose dataProperties
. 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 to fetchData()
- this may result in two DSRequests to fetch data. Use
either autoFetchData
and setAutoFetchCriteria()
or a manual call to fetchData()
passing criteria.
Whether a ResultSet was automatically created or provided via setData()
, subsequent
calls to fetchData() will simply call resultSet.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 using invalidateCache()
there is no need to also call fetchData()
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 use
resultSet.willFetchData()
to determine whether or not a server
fetch will occur when fetchData()
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.
fetchData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object,
will be derived by calling getValuesAsCriteria()
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 issuedpublic void filterData()
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
public void filterData(Criteria criteria)
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling getValuesAsCriteria()
public void filterData(Criteria criteria, DSCallback callback)
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object,
will be derived by calling getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires
only if server contact was required; see
DataBoundComponent.fetchData()
for detailspublic void filterData(Criteria criteria, DSCallback callback, DSRequest requestProperties)
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object,
will be derived by calling getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires
only if server contact was required; see
DataBoundComponent.fetchData()
for detailsrequestProperties
- for databound components only - optional additional
properties to set on the DSRequest that will be issuedpublic void invalidateCache()
DataBoundComponent
invalidateCache()
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 - see ResultSet
for details. If automatic
cache synchronization isn't working, troubleshoot the problem using the steps suggested
in the FAQ rather than just calling invalidateCache(). Calling
invalidateCache()
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, call
ResultSet.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.
invalidateCache
in interface DataBoundComponent
ListGrid.refreshData()
,
DataBoundComponentMethods
overview and related methods
public ResultSet getResultSet()
DataBoundComponent
ResultSet
.
Note that this method should only be called after initial data has been fetched by this DataBoundComponent.
getResultSet
in interface DataBoundComponent
DataBoundComponent.fetchData()
public RecordList getRecordList()
DataBoundComponent
RecordList
.
Depending on the component configuration, the actual JavaScript instance of the returned RecordList may be one of several types:
DataSource
,
the instance is generally an Array of Record
.ResultSet
.Tree
.
To access the ungrouped record list regardless of grouping status, use
isGrouped() ? getOriginalRecordList() : getRecordList()
TreeGrid
,
the instance is a ResultTree.getRecordList
in interface DataBoundComponent
public com.google.gwt.core.client.JavaScriptObject getDataAsJSList()
getDataAsJSList
in interface DataBoundComponent
public void exportData()
DataBoundComponent
exportData
in interface DataBoundComponent
public void exportData(DSRequest requestProperties)
DataBoundComponent
exportData
in interface DataBoundComponent
public void exportData(DSRequest requestProperties, RPCCallback callback)
DataBoundComponent
DataSource
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
and
exportFilename
, affect the
exporting process: see
exportResults
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
.
exportData
in interface DataBoundComponent
requestProperties
- additional properties to set on DSRequest that will be issuedcallback
- Optional callback. Note that this parameter only applies if you specify
exportToClient
: false in
the request properties, because file downloads don't provide ordinary framework callbacksDataBoundComponentMethods
overview and related methods
public com.google.gwt.event.shared.HandlerRegistration addFetchDataHandler(FetchDataHandler handler)
Notification function fired on fetchData() or filterData()
addFetchDataHandler
in interface HasFetchDataHandlers
handler
- the filterData handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addDropCompleteHandler(DropCompleteHandler handler)
com.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
).addDropCompleteHandler
in interface HasDropCompleteHandlers
handler
- the DropCompleteHandlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addDragCompleteHandler(DragCompleteHandler handler)
com.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
).addDragCompleteHandler
in interface HasDragCompleteHandlers
handler
- the DropCompleteHandlerHandlerRegistration
used to remove this handlerpublic Alignment[] getFieldAlignments()
DataBoundComponent
getFieldAlignments
in interface DataBoundComponent
public java.lang.Boolean getDeepCloneOnEdit()
DataBoundComponent
DataSource.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 with DataSourceField.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, using Canvas.setDataPath(java.lang.String)
getDeepCloneOnEdit
in interface DataBoundComponent
public DynamicForm setDeepCloneOnEdit(java.lang.Boolean deepCloneOnEdit)
DataBoundComponent
DataSource.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 with DataSourceField.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, using Canvas.setDataPath(java.lang.String)
setDeepCloneOnEdit
in interface DataBoundComponent
DataBoundComponent
instance, for chaining setter callspublic DynamicForm setFields(com.google.gwt.core.client.JavaScriptObject... fields)
DataBoundComponent
setFields(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.
setFields
in interface DataBoundComponent
fields
- the component fieldsDataBoundComponent
instance, for chaining setter callspublic com.google.gwt.core.client.JavaScriptObject[] getFieldsAsJavaScriptObjects()
DataBoundComponent
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 the DynamicForm
has been
created.getFieldsAsJavaScriptObjects
in interface DataBoundComponent
public int getFieldCount()
DataBoundComponent
getFieldCount
in interface DataBoundComponent
public void transferRecords(Record[] records, Record targetRecord, java.lang.Integer index, Canvas sourceWidget, TransferRecordsCallback callback)
DataBoundComponent
Record
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 as ListGrid
or com.smartgwt.client.widgets.tile.TileGridTileGrid
. Notably, it does not apply to
TreeGrid
; the equivalent for treeGrids is
transferNodes
.
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 the
dropRecords
(the default record drop behavior is simply to call
transferRecords()
, 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()
transferRecords
in interface DataBoundComponent
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 componentpublic DynamicForm setDragDataCustomizer(DragDataCustomizer customizer)
This method is consulted by
willAcceptDrop()
.
DragDataCustomizer
- customizerDataBoundComponent
instance, for chaining setter callspublic SortSpecifier[] getSort()
DataBoundComponent
SortSpecifiers
for
this component. Will return null if this component has never been sorted, or the
underlying SmartClient widget does not exist.getSort
in interface DataBoundComponent
public DynamicForm setSort(SortSpecifier... sortSpecifiers)
DataBoundComponent
Pass in an array of SortSpecifier
s to have the
component's data sorted by the fields in each
specifier.property
and
in the directions specified. The component can be sorted by any combination of fields,
including fields specified in the fields array and
unused 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 a
DataSource
has been set, this will result in data being fetched.
setSort
in interface DataBoundComponent
sortSpecifiers
- Array of SortSpecifier
objectspublic com.smartgwt.logicalstructure.core.LogicalStructureObject setLogicalStructure(com.smartgwt.logicalstructure.widgets.form.DynamicFormLogicalStructure s)
LogicalStructure
interface,
which supports Eclipse's logical structure debugging facility.public com.smartgwt.logicalstructure.core.LogicalStructureObject getLogicalStructure()
LogicalStructure
interface,
which supports Eclipse's logical structure debugging facility.getLogicalStructure
in interface LogicalStructure
getLogicalStructure
in class Canvas