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 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
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, id, isElementSet, 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 . |
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 |
exportClientData()
Exports this component's data with client-side formatters applied, so is suitable for
direct display to users.
|
void |
exportClientData(DSRequest requestProperties)
Exports this component's data with client-side formatters applied, so is suitable for
direct display to users.
|
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 |
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 |
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()
Operation ID 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. |
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
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
DynamicForm.cancel |
java.lang.String |
getCancelParamValue()
The value of the special field sent to the server as part of
DynamicForm.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
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 |
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 |
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) |
java.lang.String[] |
getFieldErrors(java.lang.String fieldName)
Returns any validation errors for some field in this valuesManager.
|
FormItem[] |
getFields()
Return thhe form fields
|
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() |
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.
|
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.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) . |
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
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()
Operation ID 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 prepended to the title of every required item in this form if highlightRequiredFields 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 highlightRequiredFields is true and the
titleOrientation property is set to "right".
|
java.lang.String |
getRequiredTitlePrefix()
The string prepended to the title of every required item in this form if highlightRequiredFields is true.
|
java.lang.String |
getRequiredTitleSuffix()
The string appended to the title of every required item in this form if highlightRequiredFields is true.
|
ResultSet |
getResultSet()
Return the underlying data of this DataBoundComponent as a
ResultSet . |
java.lang.String |
getRightTitlePrefix()
The string prepended 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 DynamicForm.submit
method. |
DSOperationType |
getSaveOperationType()
Default
DSOperationType to be performed when DynamicForm.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 DynamicForm.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 DynamicForm.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
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 |
getShowTitlesWithErrorMessages()
Indicates whether on validation failure, the error message displayed to the user should be prepended with the
title for the item.
|
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
DynamicForm.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 prepended 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()
Operation ID 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()
Returns the current set of values 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 |
getWrapItemTitles()
Whether titles for form items should wrap.
|
java.lang.Boolean |
hasErrors()
Return whether this form currently has any validation errors.
Validation errors are set up automatically by validation, or may be explicitly set via DynamicForm.setErrors or DynamicForm.setFieldErrors . |
java.lang.Boolean |
hasFieldErrors(java.lang.String fieldName)
Does this form currently h ave any validation errors on the field passed in?
Validation errors are set up automatically by validation, or may be explicitly set via DynamicForm.setErrors or DynamicForm.setFieldErrors . |
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
this.data.invalidateCache() . |
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
DynamicForm.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
DynamicForm.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)
Operation ID 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 |
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
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
DynamicForm.cancel |
void |
setCancelParamValue(java.lang.String cancelParamValue)
The value of the special field sent to the server as part of
DynamicForm.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
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)
Bind to a DataSource.
|
void |
setDataSource(DataSource dataSource,
FormItem... fields)
Bind to a DataSource.
|
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 . |
static void |
setDefaultProperties(DynamicForm dynamicFormProperties)
Class level method to set the default properties of this class.
|
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 |
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 |
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. |
void |
setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj) |
com.smartgwt.logicalstructure.core.LogicalStructureObject |
setLogicalStructure(com.smartgwt.logicalstructure.widgets.form.DynamicFormLogicalStructure s) |
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 |
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 |
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 |
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
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)
Operation ID 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 prepended to the title of every required item in this form if highlightRequiredFields 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 highlightRequiredFields is true and the
titleOrientation property is set to "right".
|
void |
setRequiredTitlePrefix(java.lang.String requiredTitlePrefix)
The string prepended to the title of every required item in this form if highlightRequiredFields is true.
|
void |
setRequiredTitleSuffix(java.lang.String requiredTitleSuffix)
The string appended to the title of every required item in this form if highlightRequiredFields is true.
|
void |
setRightTitlePrefix(java.lang.String rightTitlePrefix)
The string prepended 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 DynamicForm.submit
method. |
void |
setSaveOperationType(DSOperationType saveOperationType)
Default
DSOperationType to be performed when DynamicForm.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 DynamicForm.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 DynamicForm.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
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 |
setShowTitlesWithErrorMessages(java.lang.Boolean showTitlesWithErrorMessages)
Indicates whether on validation failure, the error message displayed to the user should be prepended with the
title for the item.
|
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
DynamicForm.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 prepended 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)
Operation ID 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)
et the values for this DynamicForm.
|
void |
setValuesAsCriteria(Criterion criteria)
This method will display the specified criteria in this form for editing.
|
void |
setValuesManager(ValuesManager valuesManager)
If set at init time, this dynamicForm will be created as a member form for the specified valuesManager.
|
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(boolean) . |
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 |
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.
|
void |
validateData()
Perform validation on the client and the server.
|
void |
validateData(DSCallback callback) |
void |
validateData(DSCallback callback,
DSRequest requestProperties)
Perform validation on the client and the server.
|
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
DynamicForm.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, addScrolledHandler, addShowContextMenuHandler, addStyleName, addVisibilityChangedHandler, adjustForContent, 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, asSGWTComponent, blur, bringToFront, clear, clickMaskUp, clickMaskUp, contains, contains, containsEvent, containsFocus, containsPoint, containsPoint, deparent, depeer, disable, enable, focus, focusInNextTabElement, focusInPreviousTabElement, getAbsoluteLeft, getAbsoluteTop, getAccessKey, getAnimateAcceleration, getAnimateFadeTime, getAnimateHideAcceleration, getAnimateHideTime, getAnimateMoveAcceleration, getAnimateMoveTime, getAnimateRectAcceleration, getAnimateRectTime, getAnimateResizeAcceleration, getAnimateResizeTime, getAnimateScrollAcceleration, getAnimateScrollTime, getAnimateShowAcceleration, getAnimateShowEffect, getAnimateShowTime, getAnimateTime, getAppImgDir, getAriaRole, getAutoDraw, getAutoShowParent, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorder, getBottom, getById, getByJSObject, getByLocalId, getCanAcceptDrop, getCanDrag, getCanDragReposition, getCanDragResize, getCanDragScroll, getCanDrop, getCanDropBefore, getCanHover, getCanSelectText, getCanvasAutoChild, getCanvasItem, getChildren, getChildrenSnapResizeToGrid, getChildrenSnapToGrid, getClassName, getContentElement, getContents, getContextMenu, getCursor, getDataPath, getDefaultHeight, getDefaultWidth, getDestroyed, getDestroying, getDisabled, getDisabledCursor, getDoubleClickDelay, getDragAppearance, getDragIntersectStyle, getDragOpacity, getDragRepositionAppearance, getDragRepositionCursor, getDragResizeAppearance, getDragScrollDelay, getDragStartDistance, getDragTarget, getDragType, getDropTypes, getDynamicContents, getEdgeBackgroundColor, getEdgeCenterBackgroundColor, getEdgeImage, getEdgeMarginSize, getEdgeOffset, getEdgeOpacity, getEdgeShowCenter, getEdgeSize, 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, getHtmlPosition, getImage, getImgURL, getImgURL, getInnerContentHeight, getInnerContentWidth, getInnerHeight, getInnerWidth, getIsGroup, getKeepInParentRect, getLayoutAlign, getLeft, getLeftAsString, getLocateChildrenBy, getLocateChildrenType, getLocatePeersBy, getLocatePeersType, getMargin, getMasterElement, getMatchElement, getMaxHeight, getMaxWidth, getMenuConstructor, getMinHeight, getMinWidth, getMouseStillDownDelay, getMouseStillDownInitialDelay, getNextZIndex, getNoDoubleClicks, getOffsetHeight, getOffsetWidth, getOffsetX, getOffsetY, getOpacity, getOuterElement, getOverflow, getPadding, getPageBottom, getPageLeft, getPageRect, getPageRight, getPageTop, getParentElement, getPeers, getPercentBox, getPercentSource, getPosition, getPrefix, getPrintChildrenAbsolutelyPositioned, getPrintHTML, getPrintHTML, getPrompt, getRect, getRedrawOnResize, getResizeBarTarget, getResizeFrom, getRight, getScrollbarSize, getScrollBottom, getScrollHeight, getScrollLeft, getScrollRight, getScrollTop, getScrollWidth, getShadowDepth, getShadowImage, getShadowOffset, getShadowSoftness, getShouldPrint, getShowCustomScrollbars, getShowDragShadow, getShowEdges, getShowHover, getShowHoverComponents, getShowResizeBar, getShowShadow, getSkinImgDir, getSnapAxis, getSnapEdge, getSnapHDirection, getSnapHGap, getSnapOffsetLeft, getSnapOffsetTop, getSnapOnDrop, getSnapResizeToGrid, getSnapTo, getSnapToGrid, getSnapVDirection, getSnapVGap, getStyleName, getTabIndex, getTestInstance, getTitle, getTooltip, getTop, getTopAsString, getTopElement, getUseBackMask, getUseOpacityFilter, getViewportHeight, getViewportWidth, getVisibility, getVisibleHeight, getVisibleWidth, getVSnapOrigin, getVSnapOrigin, getVSnapPosition, getVSnapPosition, getWidth, getWidthAsString, getZIndex, handleHover, hide, hideClickMask, hideClickMask, 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, parentResized, printComponents, redraw, redraw, removeChild, removeChild, removePeer, removePeer, resizeBy, resizeTo, resizeTo, scrollBy, scrollByPercent, scrollTo, scrollTo, scrollTo, scrollToBottom, scrollToLeft, scrollToPercent, scrollToRight, scrollToTop, sendToBack, setAccessKey, setAlign, setAllowExternalFilters, setAnimateAcceleration, setAnimateFadeTime, setAnimateHideAcceleration, setAnimateHideTime, setAnimateMoveAcceleration, setAnimateMoveTime, setAnimateRectAcceleration, setAnimateRectTime, setAnimateResizeAcceleration, setAnimateResizeTime, setAnimateScrollAcceleration, setAnimateScrollTime, setAnimateShowAcceleration, setAnimateShowEffect, setAnimateShowTime, setAnimateTime, setAppImgDir, setAriaRole, setAriaState, setAutoChildConstructor, setAutoChildProperties, setAutoChildProperties, setAutoChildVisibility, setAutoDraw, setAutoHeight, setAutoShowParent, setAutoWidth, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBottom, setCanAcceptDrop, setCanDrag, setCanDragReposition, setCanDragResize, setCanDragScroll, setCanDrop, setCanDropBefore, setCanHover, setCanSelectText, setCanvasItem, setChildren, setChildrenSnapResizeToGrid, setChildrenSnapToGrid, setContents, setContextMenu, setCursor, setDataPath, setDefaultHeight, setDefaultProperties, setDefaultWidth, setDisabled, setDisabledCursor, setDoubleClickDelay, setDragAppearance, setDragIntersectStyle, setDragOpacity, setDragRepositionAppearance, setDragRepositionCursor, setDragResizeAppearance, setDragScrollDelay, setDragStartDistance, setDragTarget, setDragType, setDropTypes, setDynamicContents, setEdgeBackgroundColor, setEdgeCenterBackgroundColor, setEdgeImage, setEdgeMarginSize, setEdgeOffset, setEdgeOpacity, setEdgeShowCenter, setEdgeSize, setExtraSpace, setFacetId, setGroupBorderCSS, setGroupLabelBackgroundColor, setGroupLabelStyleName, setGroupTitle, setHeight, setHeight, setHeight100, setHideUsingDisplayNone, setHoverAlign, setHoverAutoDestroy, setHoverDelay, setHoverHeight, setHoverMoveWithMouse, setHoverOpacity, setHoverStyle, setHoverVAlign, setHoverWidth, setHoverWrap, setHtmlPosition, setImage, setImage, setIsGroup, setKeepInParentRect, setKeepInParentRect, setKeepInParentRect, setLayoutAlign, setLayoutAlign, setLeft, setLeft, setLocateChildrenBy, setLocateChildrenType, setLocatePeersBy, setLocatePeersType, setLogicalStructure, setMargin, setMatchElement, setMaxHeight, setMaxWidth, setMenuConstructor, setMinHeight, setMinWidth, setMouseStillDownDelay, setMouseStillDownInitialDelay, setNeverUseFilters, setNoDoubleClicks, setOpacity, setOverflow, setPadding, setPageLeft, setPageTop, setParentElement, setPeers, setPercentBox, setPercentSource, setPosition, setPrefix, setPrintChildrenAbsolutelyPositioned, setPrompt, setRect, setRect, setRedrawOnResize, setResizeBarTarget, setResizeFrom, setResizeFrom, setRight, setScrollbarConstructor, setScrollbarSize, setShadowDepth, setShadowImage, setShadowOffset, setShadowSoftness, setShouldPrint, setShowCustomScrollbars, setShowDragShadow, setShowEdges, setShowHover, setShowHoverComponents, setShowResizeBar, setShowShadow, setSkinImgDir, setSmoothFade, setSnapAxis, setSnapEdge, setSnapHDirection, setSnapHGap, setSnapOffsetLeft, setSnapOffsetTop, setSnapOnDrop, setSnapResizeToGrid, setSnapTo, setSnapToGrid, setSnapVDirection, setSnapVGap, setStyleName, setTabIndex, setTitle, setTooltip, setTop, setTop, setUseBackMask, setUseOpacityFilter, setVisibility, setVisible, setWidth, setWidth, setWidth100, setZIndex, shouldDragScroll, show, showClickMask, showNextTo, showNextTo, showNextTo, showNextTo, showPrintPreview, showPrintPreview, showPrintPreview, showPrintPreview, showRecursively, updateHover, updateHover, updateShadow, visibleAtPoint, willAcceptDrop
addDrawHandler, destroy, doAddHandler, doInit, doOnRender, draw, equals, error, errorIfNotCreated, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDateArray, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsFloatArray, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getConfig, getDOM, getElement, getElement, getHandlerCount, getID, getInnerHTML, getJsObj, getOrCreateJsObj, getRef, getScClassName, hashCode, initNativeObject, internalSetID, internalSetID, isConfigOnly, isCreated, onBind, onDestroy, onDraw, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setDragTracker, setElement, setHtmlElement, setID, 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
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents
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 void setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)
setJavaScriptObject
in class Canvas
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.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.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. See String
. 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.
String
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. See allowExpressions
for
details.
allowExpressions
- 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. See allowExpressions
for
details.
public void setAutoFocus(java.lang.Boolean autoFocus)
dynamicForm.focusInItem(itemName)
autoFocus
- 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
- 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)
browserSpellCheck
Notes:
- this property only applies to text based items such as TextItem and
TextAreaItem.
- this property is not supported on all browsers.
browserSpellCheck
- browserSpellCheck Default value is trueFormItem.setBrowserSpellCheck(java.lang.Boolean)
public java.lang.Boolean getBrowserSpellCheck()
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)
DynamicForm.cancel
cancelParamName
- . See String
. Default value is "org.apache.struts.taglib.html.CANCEL"public java.lang.String getCancelParamName()
DynamicForm.cancel
String
public void setCancelParamValue(java.lang.String cancelParamValue)
DynamicForm.cancel
cancelParamValue
- . See String
. Default value is "cancel"public java.lang.String getCancelParamValue()
DynamicForm.cancel
String
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
.
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
.
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 fields
array, that property will be
respected in preference to the canEditAttribute value. (See canEdit
, 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
- . See String
. 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 fields
array, that property will be
respected in preference to the canEditAttribute value. (See canEdit
, canEdit
). Also note that individual dataBoundComponents may
have additional logic around whether a field can be edited - for example ListGrid.canEditCell
may be overridden.
String
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
- 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)
DynamicForm.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
- canSubmit Default value is falseSubmitting overview and related methods
public java.lang.Boolean getCanSubmit()
DynamicForm.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 canTabToHeader
If unset, section headers will
be focusable if setScreenReaderMode has been called. See Accessibility
.
Note : This is an advanced setting
canTabToSectionHeaders
- 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 canTabToHeader
If unset, section headers will
be focusable if setScreenReaderMode has been called. See Accessibility
.
public void setCellBorder(int cellBorder)
cellBorder
- cellBorder Default value is 0FormLayout overview and related methods
public int getCellBorder()
FormLayout overview and related methods
public void setCellPadding(int cellPadding)
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 clipTitle
.
clipItemTitles
- clipItemTitles Default value is falsepublic boolean getClipItemTitles()
Can be overridden for
individual items via clipTitle
.
public void setClipStaticValue(java.lang.Boolean clipStaticValue) throws java.lang.IllegalStateException
clipStaticValue
setting for items in
this form. When unset, this is equivalent to false
.clipStaticValue
- clipStaticValue Default value is nulljava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getClipStaticValue()
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 DynamicForm.fetchData
. If a pre-existing ResultSet is passed to
setData() instead, it's existing setting for fetchMode
applies.
setDataFetchMode
in interface DataBoundComponent
dataFetchMode
- 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 DynamicForm.fetchData
. If a pre-existing ResultSet is passed to
setData() instead, it's existing setting for fetchMode
applies.
getDataFetchMode
in interface DataBoundComponent
Databinding overview and related methods
public 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, dateFormatter
and 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
- 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, dateFormatter
and 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, dateFormatter
and 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
- 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, dateFormatter
and 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 setDisableValidation(java.lang.Boolean disableValidation)
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 setEncoding(Encoding encoding)
Note : This is an advanced setting
encoding
- 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
- . See String
. 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.String
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
- . See HTMLString
. Default value is "The following errors were found:"java.lang.IllegalStateException
- this property cannot be changed after the component has been createdValidation 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
- 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
- . See String
. 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.String
public void setHiliteRequiredFields(java.lang.Boolean hiliteRequiredFields)
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
- 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
- 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
- implicitSaveOnBlur Default value is falsepublic java.lang.Boolean getImplicitSaveOnBlur()
public void setItemHoverAlign(Alignment itemHoverAlign)
itemHoverAlign
- itemHoverAlign Default value is nullFormItem.setHoverAlign(com.smartgwt.client.types.Alignment)
public Alignment getItemHoverAlign()
FormItem.getHoverAlign()
public void setItemHoverDelay(int itemHoverDelay)
itemHoverDelay
- itemHoverDelay Default value is 500FormItem.setHoverDelay(java.lang.Integer)
public int getItemHoverDelay()
FormItem.getHoverDelay()
public void setItemHoverHeight(java.lang.Integer itemHoverHeight)
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
- itemHoverOpacity Default value is nullFormItem.setHoverOpacity(java.lang.Integer)
public java.lang.Integer getItemHoverOpacity()
FormItem.getHoverOpacity()
public void setItemHoverStyle(java.lang.String itemHoverStyle)
itemHoverStyle
- . See 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
- 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
- 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
- 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
- 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
- . See String
. Default value is "textArea"Appearance overview and related methods
public java.lang.String getLongTextEditorType()
String
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
- minColWidth Default value is 20FormLayout overview and related methods
public int getMinColWidth()
FormLayout overview and related methods
public void setNumCols(int numCols)
numCols
- numCols Default value is 2FormLayout overview and related methods
public int getNumCols()
FormLayout overview and related methods
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 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 readOnlyDisplay
on individual form items.
public void setReadOnlyTextBoxStyle(java.lang.String readOnlyTextBoxStyle)
readOnlyTextBoxStyle
setting
for items in this form.readOnlyTextBoxStyle
- . See FormItemBaseStyle
. Default value is "staticTextItem"public java.lang.String getReadOnlyTextBoxStyle()
readOnlyTextBoxStyle
setting
for items in this form.FormItemBaseStyle
public void setRejectInvalidValueOnChange(java.lang.Boolean rejectInvalidValueOnChange)
Note : This is an advanced setting
rejectInvalidValueOnChange
- rejectInvalidValueOnChange Default value is nullpublic java.lang.Boolean getRejectInvalidValueOnChange()
public void setRequiredMessage(java.lang.String requiredMessage)
requiredMessage
- . See HTMLString
. Default value is nullFormTitles overview and related methods
public java.lang.String getRequiredMessage()
HTMLString
FormTitles overview and related methods
public void setRequiredRightTitlePrefix(java.lang.String requiredRightTitlePrefix)
requiredRightTitlePrefix
- . See HTMLString
. Default value is "<b>: "FormTitles overview and related methods
public java.lang.String getRequiredRightTitlePrefix()
HTMLString
FormTitles overview and related methods
public void setRequiredRightTitleSuffix(java.lang.String requiredRightTitleSuffix)
requiredRightTitleSuffix
- . See HTMLString
. Default value is "</b>"FormTitles overview and related methods
public java.lang.String getRequiredRightTitleSuffix()
HTMLString
FormTitles overview and related methods
public void setRequiredTitlePrefix(java.lang.String requiredTitlePrefix)
requiredTitlePrefix
- . See HTMLString
. Default value is "<b>"FormTitles overview and related methods
public java.lang.String getRequiredTitlePrefix()
HTMLString
FormTitles overview and related methods
public void setRequiredTitleSuffix(java.lang.String requiredTitleSuffix)
requiredTitleSuffix
- . See HTMLString
. Default value is " :</b>"FormTitles overview and related methods
public java.lang.String getRequiredTitleSuffix()
HTMLString
FormTitles overview and related methods
public void setRightTitlePrefix(java.lang.String rightTitlePrefix)
rightTitlePrefix
- . See 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
- . See 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 DynamicForm.submit
method.saveOnEnter
- 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 DynamicForm.submit
method.Submitting overview and related methods
public void setSaveOperationType(DSOperationType saveOperationType)
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.
If this method is called after the component has been drawn/initialized:
Setter for the default DSOperationType
when DynamicForm.saveData
is called. Note that this property can also be set by calling DynamicForm.editRecord
or DynamicForm.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 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.
DSOperationType
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. This attribute is
automatically set via calls to data binding methods such as DynamicForm.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
- 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 DynamicForm.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 selectOnClick
.
selectOnClick
- selectOnClick Default value is falseFocus overview and related methods
public java.lang.Boolean getSelectOnClick()
TextItem
, TextAreaItem
) is
given focus - whether programmatically (see DynamicForm.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 selectOnClick
.
Focus overview and related methods
public void setSelectOnFocus(java.lang.Boolean selectOnFocus)
TextItem
, TextAreaItem
) is
given focus programmatically (see DynamicForm.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 selectOnFocus
.
selectOnFocus
- selectOnFocus Default value is falseFocus overview and related methods
public java.lang.Boolean getSelectOnFocus()
TextItem
, TextAreaItem
) is
given focus programmatically (see DynamicForm.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 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
- 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
showDeletions
setting for items in
this form.
Note : This is an advanced setting
showDeletions
- showDeletions Default value is nulljava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getShowDeletions()
showDeletions
setting for items in
this form.public void setShowDetailFields(java.lang.Boolean showDetailFields) throws java.lang.IllegalStateException
setShowDetailFields
in interface DataBoundComponent
showDetailFields
- 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 errorIconSrc
, errorIconWidth
and errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The
attribute showTitlesWithErrorMessages
may be set to prefix error messages with the form item's title + ":"
(may be
desired if the item has showTitle
set to false).
errorOrientation
controls where the error
HTML should appear relative to form items. Therefore the combination of showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
In addition to this, showErrorStyle
determines whether fields with validation errors should have special styling applied to them. See FormItemBaseStyle for
a discussion for how error styling is calculated.
showErrorIcons
- 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 errorIconSrc
, errorIconWidth
and errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The
attribute showTitlesWithErrorMessages
may be set to prefix error messages with the form item's title + ":"
(may be
desired if the item has showTitle
set to false).
errorOrientation
controls where the error
HTML should appear relative to form items. Therefore the combination of showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
In addition to this, showErrorStyle
determines whether fields with validation errors should have special styling applied to them. See FormItemBaseStyle for
a discussion for how error styling is calculated.
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 errorIconSrc
, errorIconWidth
and errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The
attribute showTitlesWithErrorMessages
may be set to prefix error messages with the form item's title + ":"
(may be
desired if the item has showTitle
set to false).
errorOrientation
controls where the error
HTML should appear relative to form items. Therefore the combination of showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
In addition to this, showErrorStyle
determines whether fields with validation errors should have special styling applied to them. See FormItemBaseStyle for
a discussion for how error styling is calculated.
showErrorStyle
- 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 errorIconSrc
, errorIconWidth
and errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The
attribute showTitlesWithErrorMessages
may be set to prefix error messages with the form item's title + ":"
(may be
desired if the item has showTitle
set to false).
errorOrientation
controls where the error
HTML should appear relative to form items. Therefore the combination of showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
In addition to this, showErrorStyle
determines whether fields with validation errors should have special styling applied to them. See FormItemBaseStyle for
a discussion for how error styling is calculated.
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 errorIconSrc
, errorIconWidth
and errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The
attribute showTitlesWithErrorMessages
may be set to prefix error messages with the form item's title + ":"
(may be
desired if the item has showTitle
set to false).
errorOrientation
controls where the error
HTML should appear relative to form items. Therefore the combination of showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
In addition to this, showErrorStyle
determines whether fields with validation errors should have special styling applied to them. See FormItemBaseStyle for
a discussion for how error styling is calculated.
showErrorText
- 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 errorIconSrc
, errorIconWidth
and errorIconHeight
showErrorText
determines whether the text of the validation error should be displayed next to fields which have validation errors. The
attribute showTitlesWithErrorMessages
may be set to prefix error messages with the form item's title + ":"
(may be
desired if the item has showTitle
set to false).
errorOrientation
controls where the error
HTML should appear relative to form items. Therefore the combination of showErrorText
:false
and errorOrientation
:"left"
creates a compact
validation error display consisting of just an icon, to the left of the item with the error message available via a
hover (similar appearance to ListGrid validation error display).
In addition to this, showErrorStyle
determines whether fields with validation errors should have special styling applied to them. See FormItemBaseStyle for
a discussion for how error styling is calculated.
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 DynamicForm.showErrors
.
showInlineErrors
- 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 DynamicForm.showErrors
.
Validation overview and related methods
public void setShowTitlesWithErrorMessages(java.lang.Boolean showTitlesWithErrorMessages)
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 validateOnExit
is automatically enabled. If there
are server-based validators on this item, setting this property also implies that synchronousValidation
is forced on.
stopOnError
- stopOnError Default value is nulljava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getStopOnError()
Enabling this property also implies validateOnExit
is automatically enabled. If there
are server-based validators on this item, setting this property also implies that synchronousValidation
is forced on.
public void setSuppressValidationErrorCallback(java.lang.Boolean suppressValidationErrorCallback)
DynamicForm.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 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 willHandle error is specified on the request. Note that this is the historical behavior for Smart GWT builds 8.0 and earlier SmartGWT builds 4.0 and earlier
Note : This is an advanced setting
suppressValidationErrorCallback
- suppressValidationErrorCallback Default value is falsepublic java.lang.Boolean getSuppressValidationErrorCallback()
DynamicForm.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 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 willHandle error is specified on the request. Note that this is the historical behavior for Smart GWT builds 8.0 and earlier 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
- 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. See String
. 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
.
String
Submitting overview and related methods
public void setTimeFormatter(TimeDisplayFormat timeFormatter)
TimeDisplayFormat
for type:"time"
field values displayed in this form. Note that
if specified, dateFormatter
and 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
- timeFormatter Default value is nullpublic TimeDisplayFormat getTimeFormatter()
TimeDisplayFormat
for type:"time"
field values displayed in this form. Note that
if specified, dateFormatter
and 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 DynamicForm.getTitleAlign
titleAlign
- titleAlign Default value is nullpublic Alignment getTitleAlign()
text direction
as described in DynamicForm.getTitleAlign
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
- . See 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
- . See 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
- . See 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
- 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
- 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
- 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 DynamicForm.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
- . See String
. Default value is nullsaveData()
,
submit()
,
Validation overview and related methods
public java.lang.String getValidationURL()
If set, calling DynamicForm.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.
String
saveData()
,
submit()
,
Validation overview and related methods
public void setWrapItemTitles(java.lang.Boolean wrapItemTitles)
wrapTitle
wrapItemTitles
- wrapItemTitles Default value is nullFormTitles overview and related methods
public java.lang.Boolean getWrapItemTitles()
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 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 DynamicForm.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 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 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()
May be null.
Focus overview and related methods
public AdvancedCriteria getValuesAsAdvancedCriteria()
Similar to DynamicForm.getValuesAsCriteria
, except the returned
criteria object is guaranteed to be an AdvancedCriteria object, even if none of the form's fields has a specified operator
AdvancedCriteria
based on the form's current valuesCriteriaEditing overview and related methods
public AdvancedCriteria getValuesAsAdvancedCriteria(TextMatchStyle textMatchStyle)
Similar to DynamicForm.getValuesAsCriteria
, except the returned
criteria object is guaranteed to be an AdvancedCriteria object, even if none of the form's fields has a specified 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
from this method to suppress that behavior.
addHiddenValidationErrorsHandler
in interface HasHiddenValidationErrorsHandlers
handler
- the hiddenValidationErrors handlerHandlerRegistration
used to remove this handlerpublic java.lang.Boolean hasErrors()
DynamicForm.setErrors
or DynamicForm.setFieldErrors
.Errors overview and related methods
public java.lang.Boolean hasFieldErrors(java.lang.String fieldName)
DynamicForm.setErrors
or DynamicForm.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 isNewRecord()
saveOperationType
is currently
"add". See saveOperationType
.public java.lang.Boolean isPendingAsyncValidation()
DynamicForm.validate
is called on a component with server-side
validators for some field(s), until the server responds. Note that the notification method DynamicForm.handleAsyncValidationReply
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()
DynamicForm.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
${isc.DocUtils.linkForRef('method:DynamicForm.getValues','the form's values')} as data. The 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.handleHiddenValidationErrors
or ValuesManager.handleHiddenValidationErrors
.
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 willHandleError
via the requestProperties
parameter
to force your callback to be invoked. However, first consider:
built-in
modes
and DynamicForm.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)
DynamicForm#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
${isc.DocUtils.linkForRef('method:DynamicForm.getValues','the form's values')} as data. The 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.handleHiddenValidationErrors
or ValuesManager.handleHiddenValidationErrors
.
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 willHandleError
via the requestProperties
parameter
to force your callback to be invoked. However, first consider:
built-in
modes
and DynamicForm.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.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.DynamicForm.getValuesAsCriteria
is called.criteria
- criteria to edit.CriteriaEditing overview and related methods
public void showFieldErrors(java.lang.String fieldName)
DynamicForm.setFieldErrors
/
DynamicForm.addFieldErrors
/ DynamicForm.clearFieldErrors
.DynamicForm.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 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, DynamicForm.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 DynamicForm.submitForm
.
The parameters to submit()
apply only if submit()
will be calling
DynamicForm.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)
DynamicForm#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, DynamicForm.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 DynamicForm.submitForm
.
The parameters to submit()
apply only if submit()
will be calling
DynamicForm.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 defaultValue
set. This is analogous to <input
type="hidden"> in HTML forms. 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(boolean validateHiddenFields)
DynamicForm.handleHiddenValidationErrors
If this form has any fields which require server-side validation (see
serverCondition
) this will also be initialized. Such
validation will occur asynchronously. Developers can use DynamicForm.isPendingAsyncValidation
and DynamicForm.handleAsyncValidationReply
to detect and respond to asynchronous validation.
validateHiddenFields
- Should validators be processed for non-visible fields such as dataSource fields with no associated item or
fields with visibility set to "hidden"
?Validation overview and related methods
,
Type Examplepublic void validateData()
public void validateData(DSCallback callback)
DynamicForm#validateData()}
public void validateData(DSCallback callback, DSRequest requestProperties)
callback
- callback to invoke on completionrequestProperties
- additional properties to set on the DSRequest that will be issuedValidation 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()
DynamicForm.rememberValues
method.
rememberValues()
runs when the form is initialized and on every call to DynamicForm.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 effect 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.
dynamicFormProperties
- properties that should be used as new defaults when instances of this class are createdprotected void onInit_DynamicForm()
public void showErrors()
setErrors(java.util.Map, boolean)
or
validate(boolean)
.
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 void setValues(java.util.Map values)
values
- the valuespublic java.util.Map getValues()
public 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()
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 boolean validate()
com.smartgwt.client.widgets.form.DynamicForm#handleHiddenValidationErrors
If this form has any fields which require server-side validation
this will also be initialized. Such validation will
occur asynchronously.
Developers can use isPendingAsyncValidation()
and
addAsyncValidationReplyHandler(com.smartgwt.client.widgets.form.events.AsyncValidationReplyHandler)
to detect and respond to asynchronous validation.
public void editNewRecord()
public void editNewRecord(java.util.Map initialValues)
initialValues
- initial set of values for the editor as a map of field names to their corresponding valuespublic void editNewRecord(Record initialValues)
initialValues
- initial set of values for the editor as a Record
of attributes whose names correspond to form values.public 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 editRecord(Record record)
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 valuespublic 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 boolean valuesAreValid(boolean validateHiddenFields)
Unlike DynamicForm.validate() this method will not store the errors on the DynamicForm or display them to the user.
validateHiddenFields
- Should validators be processed for non-visible fields such as dataSource fields with no
associated item or fields with visibility set to "hidden"?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 void setDataPageSize(int dataPageSize)
DataBoundComponent
ResultSet
object for this
component. In effect, this gives you control over the resultSize
attribute for this component.
Note that regardless of the dataPageSize
setting, a component will always fetch
all of data that it needs to draw. Settings such as
showAllRecords
,
drawAllMaxCells
and
drawAheadRatio
can cause more rows than the configured
dataPageSize
to be fetched.
setDataPageSize
in interface DataBoundComponent
dataPageSize
- dataPageSize Default value is 75public int getDataPageSize()
DataBoundComponent
ResultSet
object for this
component. In effect, this gives you control over the resultSize
attribute for this component.
Note that regardless of the dataPageSize
setting, a component will always fetch
all of data that it needs to draw. Settings such as
showAllRecords
,
drawAllMaxCells
and
drawAheadRatio
can cause more rows than the configured
dataPageSize
to be fetched.
getDataPageSize
in interface DataBoundComponent
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
setUpdateOperation
in interface DataBoundComponent
updateOperation
- updateOperation Default value is nullpublic java.lang.String getUpdateOperation()
DataBoundComponent
getUpdateOperation
in interface DataBoundComponent
public void setAddOperation(java.lang.String addOperation)
DataBoundComponent
setAddOperation
in interface DataBoundComponent
addOperation
- addOperation Default value is nullpublic java.lang.String getAddOperation()
DataBoundComponent
getAddOperation
in interface DataBoundComponent
public void setRemoveOperation(java.lang.String removeOperation)
DataBoundComponent
setRemoveOperation
in interface DataBoundComponent
removeOperation
- removeOperation Default value is nullpublic java.lang.String getRemoveOperation()
DataBoundComponent
getRemoveOperation
in interface DataBoundComponent
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 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 tranferredindex
- 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 void setDataSource(DataSource dataSource)
DataBoundComponent
When binding a previously-bound componenet 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, you may be able to refer to setDataSource(dataSource, fields) as an alternative method if the widget has an implementation of it.
setDataSource
in interface DataBoundComponent
dataSource
- DataSource to bind to. Default value is nullpublic 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
this.data.invalidateCache()
. If necessary, this will cause a new fetch to
be performed with the current set of criteria for this component.
Has no effect if this component is not showing a set of filtered data.
invalidateCache
in interface DataBoundComponent
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()
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 void exportClientData()
DataBoundComponent
To export unformatted data from this component's dataSource, see
exportData
which does not include client-side formatters,
but relies on both the SmartClient server and server-side DataSources.
exportClientData
in interface DataBoundComponent
DataSource.exportClientData(java.lang.Object[], com.smartgwt.client.data.DSRequest)
public void exportClientData(DSRequest requestProperties)
DataBoundComponent
To export unformatted data from this component's dataSource, see
exportData
which does not include client-side formatters,
but relies on both the SmartClient server and server-side DataSources.
exportClientData
in interface DataBoundComponent
requestProperties
- Request properties for the exportDataSource.exportClientData(java.lang.Object[], com.smartgwt.client.data.DSRequest)
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 com.smartgwt.logicalstructure.core.LogicalStructureObject setLogicalStructure(com.smartgwt.logicalstructure.widgets.form.DynamicFormLogicalStructure s)
public com.smartgwt.logicalstructure.core.LogicalStructureObject getLogicalStructure()
getLogicalStructure
in interface LogicalStructure
getLogicalStructure
in class Canvas