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
.
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 |
cancel()
This method exists for clean integration with existing server frameworks that have a 'cancel'
feature which typically clears session state associated with the form.
|
void |
cancel(DSRequest requestProperties)
This method exists for clean integration with existing server frameworks that have a 'cancel'
feature which typically clears session state associated with the form.
|
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()
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 |
exportData(DSRequest requestProperties)
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.String |
getCancelParamName()
The name of the special field sent to the server as part of
cancel() |
java.lang.String |
getCancelParamValue()
The value of the special field sent to the server as part of
cancel() |
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 |
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 |
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. |
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.String |
getFetchOperation()
Operation ID this component should use when performing fetch operations.
|
FormItem |
getField(java.lang.String 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.
|
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.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()
Warning to display to the user if an attempt to
natively
submit a form is unable to submit to the server. |
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
next two properties, 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.
|
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. |
FormItem |
getItem(java.lang.String name) |
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.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.Integer |
getItemHoverWidth()
A default width for hovers shown for items
|
FormLayoutType |
getItemLayout()
Layout style to use with this form.
|
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
operator has been set for any FormItem in this form, what logical operator should be applied across
the ${isc.DocUtils.linkForRef('object:Criterion','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.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 , and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
java.lang.Boolean |
getShowErrorStyle()
showErrorIcons , showErrorText , and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
java.lang.Boolean |
getShowErrorText()
showErrorIcons , showErrorText , and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
java.lang.Boolean |
getShowHiddenFields()
Whether to show fields marked
hidden:true when a DataBoundComponent is given a
DataSource but no component.fields .
|
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 |
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.
|
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 |
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 and 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. |
void |
setAction(java.lang.String action)
The URL to which the form will submit its values.
|
void |
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.
|
void |
setAddFormulaFieldText(java.lang.String addFormulaFieldText)
Text for a menu item allowing users to add a formula field
|
void |
setAddOperation(java.lang.String addOperation)
operationId this component
should use when performing add operations. |
void |
setAddSummaryFieldText(java.lang.String addSummaryFieldText)
Text for a menu item allowing users to add a formula field
|
void |
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. |
void |
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. |
void |
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() |
void |
setAutoFetchData(java.lang.Boolean autoFetchData)
If true, when this component is first drawn, automatically call
DataBoundComponent.fetchData() or DataBoundComponent.filterData() depending on
DataBoundComponent.getAutoFetchAsFilter() . |
void |
setAutoFetchTextMatchStyle(TextMatchStyle autoFetchTextMatchStyle)
If
autoFetchData is true , this attribute allows the developer to specify a textMatchStyle
for the initial DataBoundComponent.fetchData() call. |
void |
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) |
void |
setAutoFocusOnError(java.lang.Boolean autoFocusOnError)
If true, when
validation fails focus will automatically be
put into the first focusable field which failed validation. |
void |
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 |
void |
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 .
|
void |
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 .
|
void |
setCancelParamName(java.lang.String cancelParamName)
The name of the special field sent to the server as part of
cancel() |
void |
setCancelParamValue(java.lang.String cancelParamValue)
The value of the special field sent to the server as part of
cancel() |
void |
setCanEdit(java.lang.Boolean canEdit)
If set to
false , the form will be marked read-only. |
void |
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.
|
void |
setCanFocus(java.lang.Boolean canFocus)
DynamicForms are considered to have focus if any of their form items have focus.
|
void |
setCanSubmit(java.lang.Boolean canSubmit)
Governs whether this form will be used to perform a standard HTML form submission.
|
void |
setCanTabToSectionHeaders(java.lang.Boolean canTabToSectionHeaders)
If true, the headers for any
SectionItems will
be included in the page's tab order for accessibility. |
void |
setCellBorder(int cellBorder)
Width of border for the table that form is drawn in.
|
void |
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 |
void |
setClipItemTitles(boolean clipItemTitles)
Should the titles for form items be clipped if they are too large for the available space?
|
void |
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.
|
void |
setDataFetchMode(FetchMode dataFetchMode)
How to fetch and manage records retrieve from the server.
|
void |
setDataPageSize(int dataPageSize)
When using
data
paging , how many records to fetch at a time. |
void |
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.
|
void |
setDataSource(java.lang.String dataSource)
The DataSource that this component should bind to for default fields and for performing
DataSource requests . |
void |
setDateFormatter(DateDisplayFormat dateFormatter)
Default
DateDisplayFormat for Date type values displayed in this form. |
void |
setDatetimeFormatter(DateDisplayFormat datetimeFormatter)
Default
DateDisplayFormat for Date type values displayed in this form in fields of
type datetime . |
void |
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.
|
void |
setDefaultSearchOperator(OperatorId defaultSearchOperator)
Default
search operator to use for fields in a form that produces AdvancedCriteria . |
void |
setDisableValidation(java.lang.Boolean disableValidation)
If set to true, client-side validators will not run on the form when validate() is called.
|
void |
setDragDataAction(DragDataAction dragDataAction)
Indicates what to do with data dragged into another DataBoundComponent.
|
void |
setDragTrackerStyle(java.lang.String dragTrackerStyle)
CSS Style to apply to the drag tracker when dragging occurs on this component.
|
void |
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. |
void |
setDuplicateDragMessage(java.lang.String duplicateDragMessage)
Message to show when a user attempts to transfer duplicate records into this component, and
preventDuplicates
is enabled. |
void |
setEditFormulaFieldText(java.lang.String editFormulaFieldText)
Text for a menu item allowing users to edit a formula field
|
void |
setEditProxyConstructor(java.lang.String editProxyConstructor)
Default class used to construct the
EditProxy for this component when the component is
first placed into edit mode . |
void |
setEditSummaryFieldText(java.lang.String editSummaryFieldText)
Text for a menu item allowing users to edit the formatter for a field
|
void |
setEncoding(Encoding encoding)
encoding for the form, use MULTIPART_ENCODING for file upload forms
|
void |
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.
|
void |
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. |
void |
setExportAll(java.lang.Boolean exportAll)
Setting exportAll to true prevents the component from passing its list of fields to the
export call.
|
void |
setExportFields(java.lang.String[] exportFields)
The list of field-names to export.
|
void |
setFetchOperation(java.lang.String fetchOperation)
Operation ID this component should use when performing fetch operations.
|
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.
|
void |
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. |
void |
setFixedColWidths(java.lang.Boolean fixedColWidths)
If true, we ensure that column widths are at least as large as you specify them.
|
void |
setFormSubmitFailedWarning(java.lang.String formSubmitFailedWarning)
Warning to display to the user if an attempt to
natively
submit a form is unable to submit to the server. |
void |
setHiliteProperty(java.lang.String hiliteProperty)
Marker that can be set on a record to flag that record as hilited.
|
void |
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
next two properties, instead of the standard prefix and suffix.
|
void |
setHilites(Hilite[] hilites)
Accepts an array of hilite objects and applies them to this DataBoundComponent.
|
void |
setHiliteState(java.lang.String hiliteState)
Set the current hilites based on a hiliteState String previously returned from getHilitesState.
|
void |
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. |
void |
setImplicitSaveDelay(int implicitSaveDelay)
When
implicitSave is true, this attribute dictates
the millisecond delay after which form items are automatically saved during editing. |
void |
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.
|
void |
setInitialCriteria(Criteria initialCriteria)
Criteria to use when
DataBoundComponent.setAutoFetchData(Boolean) is used. |
void |
setItemHoverAlign(Alignment itemHoverAlign)
Text alignment for hovers shown for items
|
void |
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.
|
void |
setItemHoverHeight(java.lang.Integer itemHoverHeight)
A default height for hovers shown for items
|
void |
setItemHoverOpacity(java.lang.Integer itemHoverOpacity)
Opacity for hovers shown for items
|
void |
setItemHoverStyle(java.lang.String itemHoverStyle)
CSS Style for hovers shown for items
|
void |
setItemHoverVAlign(java.lang.Integer itemHoverVAlign)
Vertical text alignment for hovers shown for items
|
void |
setItemHoverWidth(java.lang.Integer itemHoverWidth)
A default width for hovers shown for items
|
void |
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. |
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. |
void |
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. |
void |
setLongTextEditorType(java.lang.String longTextEditorType)
Name of the Form Item class to use for text fields which exceed the longTextEditorThreshold for this form.
|
void |
setMethod(FormMethod method)
The mechanism by which form data is sent to the action URL.
|
void |
setMinColWidth(int minColWidth)
Minimum width of a form column.
|
void |
setMinHintWidth(java.lang.Integer minHintWidth)
Minimum horizontal space made available for
FormItem.hint text. |
void |
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
|
void |
setNumCols(int numCols)
The number of columns of titles and items in this form's layout grid.
|
void |
setOperator(OperatorId operator)
When
operator has been set for any FormItem in this form, what logical operator should be applied across
the ${isc.DocUtils.linkForRef('object:Criterion','criteria')} produced by the form items? Only applicable to
forms that have a dataSource . |
void |
setOriginalValueMessage(java.lang.String originalValueMessage)
Default template HTML string when an item does not set its own
FormItem.originalValueMessage . |
void |
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) . |
void |
setProgressiveLoading(java.lang.Boolean progressiveLoading)
Indicates whether or not this component will load its data
progressively |
void |
setReadOnlyDisplay(ReadOnlyDisplayAppearance readOnlyDisplay)
If
canEdit is set to false , how should the
items in this form be displayed to the user? |
void |
setReadOnlyTextBoxStyle(java.lang.String readOnlyTextBoxStyle)
Default
FormItem.readOnlyTextBoxStyle
setting for items in this form. |
void |
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.
|
void |
setRemoveOperation(java.lang.String removeOperation)
operationId this component
should use when performing remove operations. |
void |
setRequiredMessage(java.lang.String requiredMessage)
The required message for required field errors.
|
void |
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". |
void |
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". |
void |
setRequiredTitlePrefix(java.lang.String requiredTitlePrefix)
The string pre-pended to the title of every required item in this form if
hiliteRequiredFields is true. |
void |
setRequiredTitleSuffix(java.lang.String requiredTitleSuffix)
The string appended to the title of every required item in this form if
hiliteRequiredFields is true. |
void |
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. |
void |
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".
|
void |
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".
|
void |
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. |
void |
setSaveOperationType(DSOperationType saveOperationType)
Default
DSOperationType to be performed when saveData() is called. |
void |
setSectionVisibilityMode(VisibilityMode sectionVisibilityMode)
If the form has sections, [implemented as
SectionItem s], this attribute
controls whether multiple sections can be expanded at once. |
void |
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. |
void |
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. |
void |
setShowComplexFields(java.lang.Boolean showComplexFields)
Whether to show fields of non-atomic types when a DataBoundComponent is given a
DataSource but no
component.fields .
|
void |
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. |
void |
setShowDeletions(java.lang.Boolean showDeletions)
Default
FormItem.showDeletions setting for
items in this form. |
void |
setShowDetailFields(java.lang.Boolean showDetailFields)
For databound forms, whether to show fields marked as detail fields.
|
void |
setShowErrorIcons(java.lang.Boolean showErrorIcons)
showErrorIcons , showErrorText , and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
void |
setShowErrorStyle(java.lang.Boolean showErrorStyle)
showErrorIcons , showErrorText , and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
void |
setShowErrorText(java.lang.Boolean showErrorText)
showErrorIcons , showErrorText , and showErrorStyle control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). |
void |
setShowHiddenFields(java.lang.Boolean showHiddenFields)
Whether to show fields marked
hidden:true when a DataBoundComponent is given a
DataSource but no component.fields .
|
void |
setShowInlineErrors(java.lang.Boolean showInlineErrors)
If true, field errors are written into the form next to the item(s) where the errors occurred.
|
void |
setShowOldValueInHover(java.lang.Boolean showOldValueInHover)
Default setting for the form items'
FormItem.showOldValueInHover setting. |
void |
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.
|
void |
setStopOnError(java.lang.Boolean stopOnError)
Indicates that if validation fails, the user should not be allowed to exit the field - focus will be forced back into
the field until the error is corrected.
|
void |
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. |
void |
setSynchronousValidation(java.lang.Boolean synchronousValidation)
If enabled, whenever validation is triggered and a request to the server is required, user interactivity will be blocked
until the request returns.
|
void |
setTarget(java.lang.String target)
The name of a window or frame that will receive the results returned by the form's action.
|
void |
setTimeFormatter(TimeDisplayFormat timeFormatter)
Default
TimeDisplayFormat for type:"time" field values displayed in this form. |
void |
setTitleAlign(Alignment titleAlign)
Default alignment for item titles.
|
void |
setTitleField(java.lang.String titleField)
Sets the best field to use for a user-visible title for an individual record from this component.
|
void |
setTitleOrientation(TitleOrientation titleOrientation)
Default orientation for titles for items in this form.
|
void |
setTitlePrefix(java.lang.String titlePrefix)
The string pre-pended to the title of every item in this form.
|
void |
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.
|
void |
setUnknownErrorMessage(java.lang.String unknownErrorMessage)
The error message for a failed validator that does not specify its own errorMessage.
|
void |
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.
|
void |
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.
|
void |
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. |
void |
setUserTask(UserTask userTask)
Associated userTask if current dynamic form used along with workflow.
|
void |
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.
|
void |
setValidateOnExit(java.lang.Boolean validateOnExit)
If true, form items will be validated when each item's "editorExit" handler is fired as well as when the entire form is
submitted or validated.
|
void |
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 and 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.
|
void |
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.
|
void |
setValuesManager(ValuesManager valuesManager)
Adds this DynamicForm as a member of the specified valuesManager.
|
void |
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 . |
void |
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.
|
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 |
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. |
addChild, addChild, addChild, addChild, addChild, 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, animateMove, animateMove, animateMove, animateMove, animateRect, animateRect, animateRect, animateRect, animateResize, animateResize, animateResize, animateResize, animateScroll, animateScroll, animateScroll, animateScroll, animateScroll, animateScroll, animateShow, animateShow, animateShow, animateShow, animateShow, animateShow, asSGWTComponent, blur, bringToFront, clear, clickMaskUp, clickMaskUp, contains, contains, containsEvent, containsFocus, containsPoint, containsPoint, deparent, depeer, disable, enable, encloses, focusInNextTabElement, focusInPreviousTabElement, getAbsoluteLeft, getAbsoluteTop, getAccessKey, getAdaptiveHeightPriority, getAdaptiveWidthPriority, getAlwaysShowScrollbars, getAnimateAcceleration, getAnimateFadeTime, getAnimateHideAcceleration, getAnimateHideTime, getAnimateMoveAcceleration, getAnimateMoveTime, getAnimateRectAcceleration, getAnimateRectTime, getAnimateResizeAcceleration, getAnimateResizeTime, getAnimateScrollAcceleration, getAnimateScrollTime, getAnimateShowAcceleration, getAnimateShowEffect, getAnimateShowTime, getAnimateTime, getAppImgDir, getAriaRole, getAutoDraw, getAutoMaskComponents, getAutoParent, getAutoShowParent, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorder, getBottom, getByLocalId, getCanAcceptDrop, getCanAdaptHeight, getCanAdaptWidth, getCanDrag, getCanDragReposition, getCanDragResize, getCanDragScroll, getCanDrop, getCanDropBefore, getCanHover, getCanSelectText, getCanvasAutoChild, getCanvasItem, getChildren, getChildrenResizeSnapAlign, getChildrenSnapAlign, getChildrenSnapCenterAlign, getChildrenSnapEdgeAlign, getChildrenSnapResizeToGrid, getChildrenSnapToGrid, getClassName, getComponentMask, getComponentMaskDefaults, getContentElement, getContents, getContextMenu, getCursor, getDataPath, getDefaultHeight, getDefaultWidth, getDestroyed, getDestroying, getDisabled, getDisabledCursor, getDisableTouchScrollingForDrag, getDoubleClickDelay, getDragAppearance, getDragIntersectStyle, getDragMaskType, getDragMaxHeight, getDragMaxWidth, getDragMinHeight, getDragMinWidth, getDragOpacity, getDragRepositionAppearance, getDragRepositionCursor, getDragResizeAppearance, getDragScrollDelay, getDragStartDistance, getDragTarget, getDragType, getDropTypes, getDropTypesAsString, getDynamicContents, getEdgeBackgroundColor, getEdgeCenterBackgroundColor, getEdgeImage, getEdgeMarginSize, getEdgeOffset, getEdgeOpacity, getEdgeShowCenter, getEdgeSize, getEditNode, getEditProxy, getElement, getElement, getEnableWhen, getEventEdge, getEventEdge, getExtraSpace, getFacetId, getFormItemAutoChild, getFullDataPath, getGroupBorderCSS, getGroupLabelBackgroundColor, getGroupLabelStyleName, getGroupTitle, getHeight, getHeightAsString, getHideUsingDisplayNone, getHoverAlign, getHoverAutoDestroy, getHoverComponent, getHoverDelay, getHoverHeight, getHoverHTML, getHoverMoveWithMouse, getHoverOpacity, getHoverStyle, getHoverVAlign, getHoverWidth, getHoverWrap, getHSnapOrigin, getHSnapOrigin, getHSnapPosition, getHSnapPosition, getHtmlElement, getHtmlPosition, getImage, getImgURL, getImgURL, getInnerContentHeight, getInnerContentWidth, getInnerHeight, getInnerWidth, getIsGroup, getIsPrinting, getIsRuleScope, getIsSnapAlignCandidate, getKeepInParentRect, getLayoutAlign, getLeavePageSpace, getLeft, getLeftAsString, getLocalId, getLocateChildrenBy, getLocateChildrenType, getLocatePeersBy, getLocatePeersType, getMargin, getMasterCanvas, getMasterElement, getMatchElement, getMaxHeight, getMaxWidth, getMenuConstructor, getMinHeight, getMinNonEdgeSize, getMinWidth, getMomentumScrollMinSpeed, getMouseStillDownDelay, getMouseStillDownInitialDelay, getNextZIndex, getNoDoubleClicks, getNoDropCursor, getOffsetHeight, getOffsetWidth, getOffsetX, getOffsetY, getOpacity, getOuterElement, getOverflow, getPadding, getPageBottom, getPageLeft, getPageRect, getPageRight, getPageTop, getPanelContainer, getParentCanvas, getParentElement, getPeers, getPercentBox, getPercentSource, getPosition, getPrefix, getPrintChildrenAbsolutelyPositioned, getPrintHTML, getPrintHTML, getPrompt, getProportionalResizeModifiers, getProportionalResizing, getRect, getRedrawOnResize, getResizeBarTarget, getResizeFrom, getRight, getRuleContext, getRuleContext, getRuleScope, getScrollbarSize, getScrollBottom, getScrollHeight, getScrollLeft, getScrollRight, getScrollTop, getScrollWidth, getShadowDepth, getShadowImage, getShadowOffset, getShadowSoftness, getShouldPrint, getShowCustomScrollbars, getShowDragShadow, getShowEdges, getShowHover, getShowHoverComponents, getShowResizeBar, getShowShadow, getShowSnapGrid, getShrinkElementOnHide, getSkinImgDir, getSnapAlignCandidates, getSnapAlignCenterLineStyle, getSnapAlignEdgeLineStyle, getSnapAxis, getSnapEdge, getSnapHDirection, getSnapHGap, getSnapOffsetLeft, getSnapOffsetTop, getSnapOnDrop, getSnapPosition, getSnapPosition, getSnapResizeToAlign, getSnapResizeToGrid, getSnapTo, getSnapToAlign, getSnapToCenterAlign, getSnapToEdgeAlign, getSnapToGrid, getSnapVDirection, getSnapVGap, getStyleName, getTabIndex, getTestInstance, getTitle, getTooltip, getTop, getTopAsString, getTopElement, getUseBackMask, getUseDragMask, getUseNativeDrag, getUseOpacityFilter, getUseTouchScrolling, getViewportHeight, getViewportWidth, getVisibility, getVisibleHeight, getVisibleWhen, getVisibleWidth, getVSnapOrigin, getVSnapOrigin, getVSnapPosition, getVSnapPosition, getWidth, getWidthAsString, getZIndex, getZIndex, handleHover, hide, hideClickMask, hideClickMask, hideComponentMask, hideComponentMask, hideContextMenu, imgHTML, imgHTML, imgHTML, intersects, isDirty, isDisabled, isDrawn, isVisible, keyUp, layoutChildren, linkHTML, linkHTML, linkHTML, linkHTML, linkHTML, linkHTML, markForDestroy, markForRedraw, markForRedraw, moveAbove, moveBelow, moveBy, moveTo, onAttach, onDetach, pageScrollDown, pageScrollUp, parentResized, placeNear, placeNear, placeNear, printComponents, provideRuleContext, provideRuleContext, redraw, redraw, removeChild, removeChild, removePeer, removePeer, removeSnapAlignCandidate, resizeBy, resizeControls, resizeFonts, resizeFonts, resizeTo, resizeTo, revealChild, revealChild, scrollBy, scrollByPercent, scrollTo, scrollTo, scrollTo, scrollToBottom, scrollToLeft, scrollToPercent, scrollToRight, scrollToTop, sendToBack, setAccessKey, setAdaptHeightByCustomizer, setAdaptiveHeightPriority, setAdaptiveWidthPriority, setAdaptWidthByCustomizer, setAlign, setAllowExternalFilters, setAlwaysShowScrollbars, setAnimateAcceleration, setAnimateFadeTime, setAnimateHideAcceleration, setAnimateHideTime, setAnimateMoveAcceleration, setAnimateMoveTime, setAnimateRectAcceleration, setAnimateRectTime, setAnimateResizeAcceleration, setAnimateResizeTime, setAnimateScrollAcceleration, setAnimateScrollTime, setAnimateShowAcceleration, setAnimateShowEffect, setAnimateShowTime, setAnimateTime, setAppImgDir, setAriaRole, setAriaState, setAutoChildConstructor, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildVisibility, setAutoDraw, setAutoHeight, setAutoMaskComponents, setAutoParent, setAutoShowParent, setAutoWidth, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBottom, setCanAcceptDrop, setCanAdaptHeight, setCanAdaptWidth, setCanDrag, setCanDragReposition, setCanDragResize, setCanDragScroll, setCanDrop, setCanDropBefore, setCanHover, setCanSelectText, setChildren, setChildrenResizeSnapAlign, setChildrenSnapAlign, setChildrenSnapCenterAlign, setChildrenSnapEdgeAlign, setChildrenSnapResizeToGrid, setChildrenSnapToGrid, setComponentMaskDefaults, setContents, setContextMenu, setCursor, setDataPath, setDefaultHeight, setDefaultPageSpace, setDefaultProperties, setDefaultWidth, setDisabled, setDisabledCursor, setDisableTouchScrollingForDrag, setDoubleClickDelay, setDragAppearance, setDragIntersectStyle, setDragMaskType, setDragMaxHeight, setDragMaxWidth, setDragMinHeight, setDragMinWidth, setDragOpacity, setDragRepositionAppearance, setDragRepositionCursor, setDragResizeAppearance, setDragScrollDelay, setDragStartDistance, setDragTarget, setDragType, setDropTypes, setDropTypes, setDynamicContents, setEdgeBackgroundColor, setEdgeCenterBackgroundColor, setEdgeImage, setEdgeMarginSize, setEdgeOffset, setEdgeOpacity, setEdgeShowCenter, setEdgeSize, setEditMode, setEditMode, setEditMode, setElement, setEnableWhen, setExtraSpace, setFacetId, setGroupBorderCSS, setGroupLabelBackgroundColor, setGroupLabelStyleName, setGroupTitle, setHeight, setHeight, setHeight, setHeight100, setHideUsingDisplayNone, setHoverAlign, setHoverAutoDestroy, setHoverDelay, setHoverHeight, setHoverMoveWithMouse, setHoverOpacity, setHoverStyle, setHoverVAlign, setHoverWidth, setHoverWrap, setHtmlElement, setHtmlPosition, setImage, setImage, setInitHandler, setIsGroup, setIsRuleScope, setIsSnapAlignCandidate, setKeepInParentRect, setKeepInParentRect, setKeepInParentRect, setLayoutAlign, setLayoutAlign, setLeavePageSpace, setLeft, setLeft, setLocateChildrenBy, setLocateChildrenType, setLocatePeersBy, setLocatePeersType, setLogicalStructure, setMargin, setMatchElement, setMaxHeight, setMaxWidth, setMenuConstructor, setMinHeight, setMinNonEdgeSize, setMinWidth, setMomentumScrollMinSpeed, setMouseStillDownDelay, setMouseStillDownInitialDelay, setNeverUseFilters, setNoDoubleClicks, setNoDropCursor, setOpacity, setOverflow, setPadding, setPageLeft, setPageTop, setParentCanvas, setParentElement, setPeers, setPercentBox, setPercentSource, setPosition, setPrefix, setPrintChildrenAbsolutelyPositioned, setPrompt, setProportionalResizeModifiers, setProportionalResizing, setRect, setRect, setRedrawOnResize, setResizeBarTarget, setResizeFrom, setResizeFrom, setRight, setRuleScope, setScrollbarConstructor, setScrollbarSize, setShadowDepth, setShadowImage, setShadowOffset, setShadowSoftness, setShouldPrint, setShowCustomScrollbars, setShowDragShadow, setShowEdges, setShowHover, setShowHoverComponents, setShowResizeBar, setShowShadow, setShowSnapGrid, setShrinkElementOnHide, setSkinImgDir, setSmoothFade, setSnapAlignCandidates, setSnapAlignCenterLineStyle, setSnapAlignEdgeLineStyle, setSnapAxis, setSnapEdge, setSnapHDirection, setSnapHGap, setSnapOffsetLeft, setSnapOffsetTop, setSnapOnDrop, setSnapResizeToAlign, setSnapResizeToGrid, setSnapTo, setSnapToAlign, setSnapToCenterAlign, setSnapToEdgeAlign, setSnapToGrid, setSnapVDirection, setSnapVGap, setStyleName, setTabIndex, setTitle, setTooltip, setTop, setTop, setUseBackMask, setUseDragMask, setUseNativeDrag, setUseOpacityFilter, setUseTouchScrolling, setVisibility, setVisible, setVisibleWhen, setWidth, setWidth, setWidth, setWidth100, setZIndex, shouldDragScroll, show, showClickMask, showComponentMask, showComponentMask, showNextTo, showNextTo, showNextTo, showNextTo, showPrintPreview, showPrintPreview, showPrintPreview, showPrintPreview, showRecursively, updateEditNode, updateHover, updateHover, updateShadow, visibleAtPoint, willAcceptDrop
addDrawHandler, applyFactoryProperties, completeCreation, destroy, doAddHandler, doInit, doOnRender, draw, equals, error, errorIfNotCreated, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDateArray, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsFloatArray, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getById, getByJSObject, getConfig, getDOM, getHandlerCount, getID, getInnerHTML, getJsObj, getOrCreateJsObj, getRef, getScClassName, hasAutoAssignedID, hashCode, initNativeObject, internalSetID, internalSetID, isConfigOnly, isCreated, 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 void 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 "#"RPCManager
,
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
,
Submitting overview and related methods
public void 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
- Default value is nullpublic 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.
public void 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
- Default value is "none"FormItem.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 void setAutoFocus(java.lang.Boolean autoFocus)
dynamicForm.focusInItem(itemName)
autoFocus
- Default value is falsefocusInItem(int)
,
Focus overview and related methods
public java.lang.Boolean getAutoFocus()
dynamicForm.focusInItem(itemName)
focusInItem(int)
,
Focus overview and related methods
public void setAutoFocusOnError(java.lang.Boolean autoFocusOnError)
validation
fails focus will automatically be
put into the first focusable field which failed validation.autoFocusOnError
- Default value is trueFocus overview and related methods
public java.lang.Boolean getAutoFocusOnError()
validation
fails focus will automatically be
put into the first focusable field which failed validation.Focus overview and related methods
public void 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
- Default value is trueFormItem.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 void setCancelParamName(java.lang.String cancelParamName)
cancel()
cancelParamName
- Default value is "org.apache.struts.taglib.html.CANCEL"public java.lang.String getCancelParamName()
cancel()
public void setCancelParamValue(java.lang.String cancelParamValue)
cancel()
cancelParamValue
- Default value is "cancel"public java.lang.String getCancelParamValue()
cancel()
public void 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 nullsetReadOnlyDisplay(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 void 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
- Default value is "canEdit"java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic 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.
public void 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
- Default value is trueFocus overview and related methods
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 overview and related methods
public void 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
- Default value is falseSubmitting 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 void 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 isc.setScreenReaderMode()
has been
called. See Accessibility
.
Note : This is an advanced setting
canTabToSectionHeaders
- Default value is nulljava.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 isc.setScreenReaderMode()
has been
called. See Accessibility
.
public void setCellBorder(int cellBorder)
cellBorder
- Default value is 0FormLayout overview and related methods
public int getCellBorder()
FormLayout overview and related methods
public void setCellPadding(int cellPadding)
cellPadding
- Default value is 2FormLayout overview and related methods
public int getCellPadding()
FormLayout overview and related methods
public void setClipItemTitles(boolean clipItemTitles)
Can be overridden for
individual items via FormItem.clipTitle
.
clipItemTitles
- Default value is falsepublic boolean getClipItemTitles()
Can be overridden for
individual items via FormItem.clipTitle
.
public void 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
- Default value is nulljava.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 void 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
- Default value is "paged"Databinding overview and related methods
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 overview and related methods
public void 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
- Default value is nullDatabinding overview and related methods
,
DataSource fields Examplepublic void 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
- Default value is nullDatabinding overview and related methods
,
DataSource fields Examplepublic void 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
- Default value is nullpublic 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 void 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
- Default value is nullpublic 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 void 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
- Default value is nulljava.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 void setDisableValidation(java.lang.Boolean disableValidation)
disableValidation
- Default value is nullsaveData()
,
submit()
,
Validation overview and related methods
public java.lang.Boolean getDisableValidation()
saveData()
,
submit()
,
Validation overview and related methods
public void 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
- java.lang.IllegalStateException
- this property cannot be changed after the component has been createdSCClassName . Default value is "FormEditProxy"
public java.lang.String getEditProxyConstructor()
EditProxy
for this component when the component is
first placed into edit mode
.getEditProxyConstructor
in class Canvas
SCClassName
public void setEncoding(Encoding encoding)
Note : This is an advanced setting
encoding
- Default value is DynamicForm.NORMALSubmitting overview and related methods
public Encoding getEncoding()
Submitting overview and related methods
public void 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
- Default value is "formCellError"java.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 void 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
- java.lang.IllegalStateException
- this property cannot be changed after the component has been createdHTMLString . Default value is "The following errors were found:"
,
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 void 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
- Default value is falseFormLayout overview and related methods
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.
FormLayout overview and related methods
public void setFormSubmitFailedWarning(java.lang.String formSubmitFailedWarning)
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
- Default value is "Form was unable to be submitted. The most likely cause for this is an invalid value in an upload field."public java.lang.String getFormSubmitFailedWarning()
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 void setHiliteRequiredFields(java.lang.Boolean hiliteRequiredFields)
hiliteRequiredFields
- Default value is trueFormTitles overview and related methods
public java.lang.Boolean getHiliteRequiredFields()
FormTitles overview and related methods
public void 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
- Default value is falsepublic 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 void setImplicitSaveDelay(int implicitSaveDelay)
implicitSave
is true, this attribute dictates
the millisecond delay after which form items are automatically saved during editing.implicitSaveDelay
- Default value is 2000public int getImplicitSaveDelay()
implicitSave
is true, this attribute dictates
the millisecond delay after which form items are automatically saved during editing.public void setImplicitSaveOnBlur(java.lang.Boolean implicitSaveOnBlur)
implicitSaveOnBlur
- Default value is falsepublic java.lang.Boolean getImplicitSaveOnBlur()
public void setItemHoverAlign(Alignment itemHoverAlign)
itemHoverAlign
- Default value is nullFormItem.setHoverAlign(com.smartgwt.client.types.Alignment)
public Alignment getItemHoverAlign()
FormItem.getHoverAlign()
public void setItemHoverDelay(int itemHoverDelay)
itemHoverDelay
- Default value is 500FormItem.setHoverDelay(java.lang.Integer)
public int getItemHoverDelay()
FormItem.getHoverDelay()
public void setItemHoverHeight(java.lang.Integer itemHoverHeight)
itemHoverHeight
- Default value is nullFormItem.setHoverHeight(java.lang.Integer)
public java.lang.Integer getItemHoverHeight()
FormItem.getHoverHeight()
public void setItemHoverOpacity(java.lang.Integer itemHoverOpacity)
itemHoverOpacity
- Default value is nullFormItem.setHoverOpacity(java.lang.Integer)
public java.lang.Integer getItemHoverOpacity()
FormItem.getHoverOpacity()
public void setItemHoverStyle(java.lang.String itemHoverStyle)
itemHoverStyle
- CSSStyleName . Default value is "formHover"
,
FormItem.setHoverStyle(java.lang.String)
public java.lang.String getItemHoverStyle()
CSSStyleName
,
FormItem.getHoverStyle()
public void setItemHoverVAlign(java.lang.Integer itemHoverVAlign)
itemHoverVAlign
- Default value is nullFormItem.setHoverVAlign(com.smartgwt.client.types.VerticalAlignment)
public java.lang.Integer getItemHoverVAlign()
FormItem.getHoverVAlign()
public void setItemHoverWidth(java.lang.Integer itemHoverWidth)
itemHoverWidth
- Default value is nullFormItem.setHoverWidth(java.lang.Integer)
,
Hovers Examplepublic java.lang.Integer getItemHoverWidth()
FormItem.getHoverWidth()
,
Hovers Examplepublic void 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
- Default value is "table"FormLayout overview and related methods
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. FormLayout overview and related methods
public void setLongTextEditorThreshold(int longTextEditorThreshold)
this.longTextEditorType
(a TextAreaItem by default), rather than a simple
text item. Overridden by explicitly specifying editorType
for the field.longTextEditorThreshold
- Default value is 255Appearance 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 void setLongTextEditorType(java.lang.String longTextEditorType)
longTextEditorType
- Default value is "textArea"Appearance overview and related methods
public java.lang.String getLongTextEditorType()
Appearance overview and related methods
public void 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.POSTSubmitting 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 void setMinColWidth(int minColWidth)
minColWidth
- Default value is 20FormLayout overview and related methods
public int getMinColWidth()
FormLayout overview and related methods
public void 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
- Default value is 80java.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 void setNoErrorDetailsMessage(java.lang.String noErrorDetailsMessage)
noErrorDetailsMessage
- Default value is "Error during validation; no error details were provided"Validation overview and related methods
public java.lang.String getNoErrorDetailsMessage()
Validation overview and related methods
public void setNumCols(int numCols)
numCols
- Default value is 2FormLayout overview and related methods
public int getNumCols()
FormLayout overview and related methods
public void 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
- HTMLString . Default value is "Original value: $value"
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 void 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"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.
public void setReadOnlyTextBoxStyle(java.lang.String readOnlyTextBoxStyle)
FormItem.readOnlyTextBoxStyle
setting for items in this form.readOnlyTextBoxStyle
- FormItemBaseStyle . Default value is "staticTextItem"
public java.lang.String getReadOnlyTextBoxStyle()
FormItem.readOnlyTextBoxStyle
setting for items in this form.FormItemBaseStyle
public void setRejectInvalidValueOnChange(java.lang.Boolean rejectInvalidValueOnChange)
Note : This is an advanced setting
rejectInvalidValueOnChange
- Default value is nullpublic java.lang.Boolean getRejectInvalidValueOnChange()
public void setRequiredMessage(java.lang.String requiredMessage)
requiredMessage
- HTMLString . Default value is null
,
FormTitles overview and related methods
public java.lang.String getRequiredMessage()
HTMLString
,
FormTitles overview and related methods
public void setRequiredRightTitlePrefix(java.lang.String requiredRightTitlePrefix)
hiliteRequiredFields
is true and the TitleOrientation
property is set to "right".requiredRightTitlePrefix
- HTMLString . Default value is "<b>: "
,
FormTitles overview and related methods
public java.lang.String getRequiredRightTitlePrefix()
hiliteRequiredFields
is true and the TitleOrientation
property is set to "right".HTMLString
,
FormTitles overview and related methods
public void setRequiredRightTitleSuffix(java.lang.String requiredRightTitleSuffix)
hiliteRequiredFields
is true and the TitleOrientation
property is set to "right".requiredRightTitleSuffix
- HTMLString . Default value is "</b>"
,
FormTitles overview and related methods
public java.lang.String getRequiredRightTitleSuffix()
hiliteRequiredFields
is true and the TitleOrientation
property is set to "right".HTMLString
,
FormTitles overview and related methods
public void setRequiredTitlePrefix(java.lang.String requiredTitlePrefix)
hiliteRequiredFields
is true.requiredTitlePrefix
- HTMLString . Default value is "<b>"
,
FormTitles overview and related methods
public java.lang.String getRequiredTitlePrefix()
hiliteRequiredFields
is true.HTMLString
,
FormTitles overview and related methods
public void setRequiredTitleSuffix(java.lang.String requiredTitleSuffix)
hiliteRequiredFields
is true.requiredTitleSuffix
- HTMLString . Default value is " :</b>"
,
FormTitles overview and related methods
public java.lang.String getRequiredTitleSuffix()
hiliteRequiredFields
is true.HTMLString
,
FormTitles overview and related methods
public void setRevertValueKey(KeyIdentifier revertValueKey) throws java.lang.IllegalStateException
resetValues()
were called.revertValueKey
- Default value is nulljava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic KeyIdentifier getRevertValueKey()
resetValues()
were called.public void setRightTitlePrefix(java.lang.String rightTitlePrefix)
rightTitlePrefix
- HTMLString . Default value is ": "
,
FormTitles overview and related methods
public java.lang.String getRightTitlePrefix()
HTMLString
,
FormTitles overview and related methods
public void setRightTitleSuffix(java.lang.String rightTitleSuffix)
rightTitleSuffix
- HTMLString . Default value is ""
,
FormTitles overview and related methods
public java.lang.String getRightTitleSuffix()
HTMLString
,
FormTitles overview and related methods
public void 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
- Default value is falseSubmitting 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 void 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 nullpublic 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()
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. This attribute is
automatically set via calls to data binding methods such as editNewRecord()
, or it may be set explicitly.
If no
explicit saveOperationType is specified for this form, the system will look at the current values for the form. If the
form has no value for the primaryKey field
, or that field
is editable and has been modified we assume an add operation, otherwise an update. If the form is a member of a ValuesManager
, the primary key field value will be derived from the valuesManager's
values object.
public void setSectionVisibilityMode(VisibilityMode sectionVisibilityMode)
SectionItem
s], this attribute
controls whether multiple sections can be expanded at once.sectionVisibilityMode
- Default value is "multiple"VisibilityMode
,
SectionItem
,
FormLayout overview and related methods
public VisibilityMode getSectionVisibilityMode()
SectionItem
s], this attribute
controls whether multiple sections can be expanded at once.VisibilityMode
,
SectionItem
,
FormLayout overview and related methods
public void 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
- Default value is falseFocus overview and related methods
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 overview and related methods
public void 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
- Default value is falseFocus overview and related methods
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 overview and related methods
public void 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
- Default value is nulljava.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 void setShowDeletions(java.lang.Boolean showDeletions) throws java.lang.IllegalStateException
FormItem.showDeletions
setting for
items in this form.
Note : This is an advanced setting
showDeletions
- Default value is nulljava.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 void setShowDetailFields(java.lang.Boolean showDetailFields) throws java.lang.IllegalStateException
setShowDetailFields
in interface DataBoundComponent
showDetailFields
- Default value is truejava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getShowDetailFields()
getShowDetailFields
in interface DataBoundComponent
public void setShowErrorIcons(java.lang.Boolean showErrorIcons)
showErrorIcons
, showErrorText
, and showErrorStyle
control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors
:false.
showErrorIcons
, showErrorText
and showErrorStyle
are all boolean properties, and
can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.
The HTML displayed
next to a form item with errors is generated by FormItem.getErrorHTML()
. The default implementation of that method respects showErrorIcons
and
showErrorText
as follows:
showErrorIcons
, or showErrorIcon
at the FormItem
level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance
is governed by 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).
errorOrientation
controls where the
error HTML should appear relative to form items. Therefore the combination of showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
In addition to this, showErrorStyle
determines whether fields with validation errors should have special styling applied to them. 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
- Default value is trueValidation overview and related methods
public java.lang.Boolean getShowErrorIcons()
showErrorIcons
, showErrorText
, and showErrorStyle
control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors
:false.
showErrorIcons
, showErrorText
and showErrorStyle
are all boolean properties, and
can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.
The HTML displayed
next to a form item with errors is generated by FormItem.getErrorHTML()
. The default implementation of that method respects showErrorIcons
and
showErrorText
as follows:
showErrorIcons
, or showErrorIcon
at the FormItem
level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance
is governed by 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).
errorOrientation
controls where the
error HTML should appear relative to form items. Therefore the combination of showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
In addition to this, showErrorStyle
determines whether fields with validation errors should have special styling applied to them. 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 void setShowErrorStyle(java.lang.Boolean showErrorStyle)
showErrorIcons
, showErrorText
, and showErrorStyle
control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors
:false.
showErrorIcons
, showErrorText
and showErrorStyle
are all boolean properties, and
can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.
The HTML displayed
next to a form item with errors is generated by FormItem.getErrorHTML()
. The default implementation of that method respects showErrorIcons
and
showErrorText
as follows:
showErrorIcons
, or showErrorIcon
at the FormItem
level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance
is governed by 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).
errorOrientation
controls where the
error HTML should appear relative to form items. Therefore the combination of showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
In addition to this, showErrorStyle
determines whether fields with validation errors should have special styling applied to them. 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
- Default value is trueValidation overview and related methods
public java.lang.Boolean getShowErrorStyle()
showErrorIcons
, showErrorText
, and showErrorStyle
control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors
:false.
showErrorIcons
, showErrorText
and showErrorStyle
are all boolean properties, and
can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.
The HTML displayed
next to a form item with errors is generated by FormItem.getErrorHTML()
. The default implementation of that method respects showErrorIcons
and
showErrorText
as follows:
showErrorIcons
, or showErrorIcon
at the FormItem
level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance
is governed by 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).
errorOrientation
controls where the
error HTML should appear relative to form items. Therefore the combination of showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
In addition to this, showErrorStyle
determines whether fields with validation errors should have special styling applied to them. 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 void setShowErrorText(java.lang.Boolean showErrorText)
showErrorIcons
, showErrorText
, and showErrorStyle
control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors
:false.
showErrorIcons
, showErrorText
and showErrorStyle
are all boolean properties, and
can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.
The HTML displayed
next to a form item with errors is generated by FormItem.getErrorHTML()
. The default implementation of that method respects showErrorIcons
and
showErrorText
as follows:
showErrorIcons
, or showErrorIcon
at the FormItem
level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance
is governed by 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).
errorOrientation
controls where the
error HTML should appear relative to form items. Therefore the combination of showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
In addition to this, showErrorStyle
determines whether fields with validation errors should have special styling applied to them. 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
- Default value is falseValidation overview and related methods
public java.lang.Boolean getShowErrorText()
showErrorIcons
, showErrorText
, and showErrorStyle
control how validation errors are
displayed when they are displayed inline in the form (next to the form item where there is a validation error). To
instead display all errors at the top of the form, set showInlineErrors
:false.
showErrorIcons
, showErrorText
and showErrorStyle
are all boolean properties, and
can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.
The HTML displayed
next to a form item with errors is generated by FormItem.getErrorHTML()
. The default implementation of that method respects showErrorIcons
and
showErrorText
as follows:
showErrorIcons
, or showErrorIcon
at the FormItem
level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance
is governed by 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).
errorOrientation
controls where the
error HTML should appear relative to form items. Therefore the combination of showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
In addition to this, showErrorStyle
determines whether fields with validation errors should have special styling applied to them. 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 void 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
- Default value is trueValidation 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 void setShowOldValueInHover(java.lang.Boolean showOldValueInHover)
FormItem.showOldValueInHover
setting.
Note : This is an advanced setting
showOldValueInHover
- Default value is nullpublic java.lang.Boolean getShowOldValueInHover()
FormItem.showOldValueInHover
setting.public void setShowTitlesWithErrorMessages(java.lang.Boolean showTitlesWithErrorMessages)
showTitlesWithErrorMessages
- Default value is falseValidation overview and related methods
public java.lang.Boolean getShowTitlesWithErrorMessages()
Validation overview and related methods
public void 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
- Default value is nulljava.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 void 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
- Default value is falsepublic 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 void 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
- Default value is falsejava.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 void 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 nullSubmitting 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 void 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
- Default value is nullpublic 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 void setTitleAlign(Alignment titleAlign)
text direction
as described in getTitleAlign()
titleAlign
- Default value is nullpublic Alignment getTitleAlign()
text direction
as described in getTitleAlign()
FormItem.titleAlign
is specified, it will be
respectedthis.titleAlign
is set, it will be respectedtext direction
, with this method returning "right"
if text
direction is LTR, or "left"
if text direction is RTL. public void setTitleOrientation(TitleOrientation titleOrientation)
TitleOrientation
lists valid
options. Note that titles on the left or right take up a cell in tabular form layouts
, but titles on top do not.
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"FormTitles overview and related methods
,
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.
FormTitles overview and related methods
,
Titles Examplepublic void setTitlePrefix(java.lang.String titlePrefix)
titlePrefix
- HTMLString . Default value is ""
,
FormTitles overview and related methods
public java.lang.String getTitlePrefix()
HTMLString
,
FormTitles overview and related methods
public void setTitleSuffix(java.lang.String titleSuffix)
titleSuffix
- HTMLString . Default value is " :"
,
FormTitles overview and related methods
public java.lang.String getTitleSuffix()
HTMLString
,
FormTitles overview and related methods
public void setUnknownErrorMessage(java.lang.String unknownErrorMessage)
unknownErrorMessage
- HTMLString . Default value is "Invalid value"
,
Validation overview and related methods
public java.lang.String getUnknownErrorMessage()
HTMLString
,
Validation overview and related methods
public void setUserTask(UserTask userTask) throws java.lang.IllegalStateException
userTask
for more details.userTask
- Default value is nulljava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic UserTask getUserTask()
userTask
for more details.public void 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
- Default value is falseFormItem.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 void 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
- Default value is falseFormItem.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 void 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.
See the Struts examples
in [webroot]/examples/struts
for usage examples.
validationURL
- Default value is nullsaveData()
,
submit()
,
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.
See the Struts examples
in [webroot]/examples/struts
for usage examples.
saveData()
,
submit()
,
Validation overview and related methods
public void 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 nullpublic 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.public void 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
- Default value is truejava.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 void setWrapItemTitles(java.lang.Boolean wrapItemTitles)
FormItem.wrapTitle
wrapItemTitles
- Default value is nullFormTitles overview and related methods
public java.lang.Boolean getWrapItemTitles()
FormItem.wrapTitle
FormTitles overview and related methods
public void cancel()
cancelParamName
with the value
cancelParamValue
.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, call this method like this:
dynamicFormInstance.cancel({ignoreTimeout: true, target: null});
public void cancel(DSRequest requestProperties)
cancelParamName
with the value
cancelParamValue
.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, call this method like this:
dynamicFormInstance.cancel({ignoreTimeout: true, 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.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()
,
DataBoundComponentMethods overview and related 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()
,
DataBoundComponentMethods overview and related 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()
,
DataBoundComponentMethods overview and related 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 schemaDataBoundComponentMethods overview and related 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 issuedDataBoundComponentMethods overview and related 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 identifierEditing overview and related methods
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 identifierEditing overview and related methods
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 identifierEditing overview and related methods
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.
focus
in class Canvas
Focus overview and related methods
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.
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 ContainerItem, this method will return the parent ContainerItem, not the sub-item.
isFocused()
,
FormItem.isFocused()
,
Focus overview and related methods
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 valuesCriteriaEditing overview and related methods
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 valuesCriteriaEditing overview and related methods
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. public 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. callback
- callback to invoke on completionrequestProperties
- additional properties to set on the DSRequest that will be issuedDataBoundComponentMethods overview and related 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.CriteriaEditing overview and related methods
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 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.
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
,
DataBoundComponentMethods overview and related 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.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 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 void 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 nulljava.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 setOperator(OperatorId operator) throws java.lang.IllegalStateException
operator
has been set for any FormItem
in this form, what logical operator should be applied across
the ${isc.DocUtils.linkForRef('object:Criterion','criteria')} produced by the form items? Only applicable to
forms that have a dataSource
.operator
- operator Default value is "and"java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic OperatorId getOperator()
operator
has been set for any FormItem
in this form, what logical operator should be applied across
the ${isc.DocUtils.linkForRef('object:Criterion','criteria')} produced by the form items? Only applicable to
forms that have a dataSource
.public 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 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.
public FormItem getItem(java.lang.String name)
public FormItem getField(java.lang.String name)
public 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 void 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 0Databinding 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 void 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 falsepublic 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 void 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 falsepublic 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 void 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 truepublic 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 void setFetchOperation(java.lang.String fetchOperation)
DataBoundComponent
setFetchOperation
in interface DataBoundComponent
fetchOperation
- fetchOperation Default value is nullpublic java.lang.String getFetchOperation()
DataBoundComponent
getFetchOperation
in interface DataBoundComponent
public void setUpdateOperation(java.lang.String updateOperation)
DataBoundComponent
operationId
this component
should use when performing update operations.setUpdateOperation
in interface DataBoundComponent
updateOperation
- Default value is nullOperations 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 void setAddOperation(java.lang.String addOperation)
DataBoundComponent
operationId
this component
should use when performing add operations.setAddOperation
in interface DataBoundComponent
addOperation
- Default value is nullOperations 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 void setRemoveOperation(java.lang.String removeOperation)
DataBoundComponent
operationId
this component
should use when performing remove operations.setRemoveOperation
in interface DataBoundComponent
removeOperation
- Default value is nullOperations 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 void 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 nullpublic 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 void 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 falsepublic 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 void 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 nulljava.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 void 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"java.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 void 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 truepublic 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 void 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 nullpublic 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 void setProgressiveLoading(java.lang.Boolean progressiveLoading)
progressively
progressiveLoading
- ProgressiveLoading
,
DataSource.setProgressiveLoading(java.lang.Boolean)
public java.lang.Boolean getProgressiveLoading()
progressively
ProgressiveLoading
,
DataSource.getProgressiveLoading()
public void 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 nulljava.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 void setHiliteProperty(java.lang.String hiliteProperty)
DataBoundComponent
id
for a hilite defined on this component.setHiliteProperty
in interface DataBoundComponent
hiliteProperty
- hiliteProperty Default value is "_hilite"public java.lang.String getHiliteProperty()
DataBoundComponent
id
for a hilite defined on this component.getHiliteProperty
in interface DataBoundComponent
public void editFields()
public void editHilites()
editHilites
in interface DataBoundComponent
public java.lang.String getHiliteState()
getHiliteState
in interface DataBoundComponent
public void setHiliteState(java.lang.String hiliteState)
setHiliteState
in interface DataBoundComponent
hiliteState
- hilites state encoded as a Stringpublic void setHilites(Hilite[] hilites)
getHilites
for a method of
retrieving the hilite array for storage, including hilites manually added by the user.setHilites
in interface DataBoundComponent
hilites
- array of hilite objectspublic Hilite[] getHilites()
getHilites
in interface DataBoundComponent
public void setDragDataAction(DragDataAction dragDataAction)
DataBoundComponent
setDragDataAction
in interface DataBoundComponent
dragDataAction
- dragDataAction Default value is Canvas.MOVEpublic DragDataAction getDragDataAction()
DataBoundComponent
getDragDataAction
in interface DataBoundComponent
public void setDragTrackerStyle(java.lang.String dragTrackerStyle)
DataBoundComponent
setDragTrackerStyle
in interface DataBoundComponent
dragTrackerStyle
- dragTrackerStyle Default value is "gridDragTracker"public java.lang.String getDragTrackerStyle()
DataBoundComponent
getDragTrackerStyle
in interface DataBoundComponent
public void 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 falsepublic 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 void setAddFormulaFieldText(java.lang.String addFormulaFieldText)
DataBoundComponent
setAddFormulaFieldText
in interface DataBoundComponent
addFormulaFieldText
- addFormulaFieldText Default value is "Add formula column..."public java.lang.String getAddFormulaFieldText()
DataBoundComponent
getAddFormulaFieldText
in interface DataBoundComponent
public void setEditFormulaFieldText(java.lang.String editFormulaFieldText)
DataBoundComponent
setEditFormulaFieldText
in interface DataBoundComponent
editFormulaFieldText
- editFormulaFieldText Default value is "Edit formula..."public java.lang.String getEditFormulaFieldText()
DataBoundComponent
getEditFormulaFieldText
in interface DataBoundComponent
public void 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 falsepublic 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 void setAddSummaryFieldText(java.lang.String addSummaryFieldText)
DataBoundComponent
setAddSummaryFieldText
in interface DataBoundComponent
addSummaryFieldText
- addSummaryFieldText Default value is "Add summary column..."public java.lang.String getAddSummaryFieldText()
DataBoundComponent
getAddSummaryFieldText
in interface DataBoundComponent
public void setEditSummaryFieldText(java.lang.String editSummaryFieldText)
DataBoundComponent
setEditSummaryFieldText
in interface DataBoundComponent
editSummaryFieldText
- editSummaryFieldText Default value is "Edit summary format..."public java.lang.String getEditSummaryFieldText()
DataBoundComponent
getEditSummaryFieldText
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 void setTitleField(java.lang.String titleField)
DataBoundComponent
setTitleField
in interface DataBoundComponent
public 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 void 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
- autoFetchDatajava.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 void 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
java.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 void 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
- autoFetchAsFilterjava.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 void setInitialCriteria(Criteria initialCriteria) throws java.lang.IllegalStateException
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is used.setInitialCriteria
in interface DataBoundComponent
initialCriteria
- the initial criteriajava.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 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
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
DataBoundComponentMethods overview and related methods
public void exportData(DSRequest requestProperties)
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 the DSRequest that will be issuedDataBoundComponentMethods 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 void 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
public void 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 fieldspublic 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 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