|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.smartgwt.client.widgets.BaseWidget
com.smartgwt.client.widgets.Canvas
com.smartgwt.client.widgets.form.DynamicForm
public class DynamicForm
The DynamicForm manages a collection of FormItems which represent user input controls. The
DynamicForm provides layout, value management, validation and
databinding for the controls it manages.
To create a DynamicForm, create several FormItems 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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.smartgwt.client.widgets.BaseWidget |
|---|
config, configOnly, id, isElementSet, nativeObject, scClassName |
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
DynamicForm()
|
|
DynamicForm(JavaScriptObject jsObj)
|
|
| Method Summary | |
|---|---|
HandlerRegistration |
addAsyncValidationReplyHandler(AsyncValidationReplyHandler handler)
Add a asyncValidationReply handler. |
HandlerRegistration |
addDragCompleteHandler(DragCompleteHandler handler)
Add a com.smartgwt.client.widgets.DragCompleteHandler. |
HandlerRegistration |
addDropCompleteHandler(DropCompleteHandler handler)
Add a com.smartgwt.client.widgets.DropCompleteHandler. |
HandlerRegistration |
addFetchDataHandler(FetchDataHandler handler)
Add a fetchData handler. |
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. |
HandlerRegistration |
addHiddenValidationErrorsHandler(HiddenValidationErrorsHandler handler)
Add a hiddenValidationErrors handler. |
HandlerRegistration |
addItemChangedHandler(ItemChangedHandler handler)
Add a itemChanged handler. |
HandlerRegistration |
addItemChangeHandler(ItemChangeHandler handler)
Add a itemChange handler. |
HandlerRegistration |
addItemKeyPressHandler(ItemKeyPressHandler handler)
Add a itemKeyPress handler. |
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. |
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. |
void |
clearErrors(boolean show)
Clears all errors for this DynamicForm. |
void |
clearFieldErrors(String fieldName,
boolean show)
Clear any validation errors on the field passed in. |
void |
clearValue(String fieldName)
Clears the value for some field via a call 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 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 Records passed in explicitly, or by index. |
void |
deselectRecords(Record[] records)
Deselect a list of Records passed in explicitly, or by index. |
void |
disableHilite(String hiliteID)
Disable a hilite |
void |
disableHiliting()
Disable all hilites. |
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(Map initialValues)
Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified). |
void |
editRecord(Record record)
Edit an existing record. |
void |
editSelectedData(ListGrid selectionComponent)
Edit the record selected in the specified ListGrid. |
void |
editSelectedData(String listGridID)
Edit the record selected in the specified ListGrid. |
void |
enableHilite(String hiliteID)
Enable / disable a hilites
|
void |
enableHilite(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. |
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(String itemName)
Move the keyboard focus into a particular item. |
String |
getAction()
The URL to which the form will submit its values. |
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. |
String |
getAddFormulaFieldText()
Text for a menu item allowing users to add a formula field |
String |
getAddOperation()
Operation ID this component should use when performing add operations. |
String |
getAddSummaryFieldText()
Text for a menu item allowing users to add a formula field |
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. |
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() |
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. |
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) |
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 |
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.
|
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.
|
String |
getCancelParamName()
The name of the special field sent to the server as part of DynamicForm.cancel |
String |
getCancelParamValue()
The value of the special field sent to the server as part of DynamicForm.cancel |
Boolean |
getCanEdit()
If set to false, the form will be marked read-only. |
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. |
Boolean |
getCanFocus()
DynamicForms are considered to have focus if any of their form items have focus. |
Boolean |
getCanSubmit()
Governs whether this form will be used to perform a standard HTML form submission. |
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 |
Map |
getChangedValues()
Returns all values within this DynamicForm that have changed since DynamicForm.rememberValues last ran. |
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. |
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. |
String |
getDragTrackerStyle()
CSS Style to apply to the drag tracker when dragging occurs on this component. |
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. |
String |
getDuplicateDragMessage()
Message to show when a user attempts to transfer duplicate records into this component, and preventDuplicates
is enabled. |
String |
getEditFormulaFieldText()
Text for a menu item allowing users to edit a formula field |
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 |
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. |
Map |
getErrors()
Returns the set of errors. |
String |
getErrorsPreamble()
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 an introductory string rendered out before the individual error messages. |
FormItem |
getEventItem()
If the current mouse event occurred over an item in this dynamicForm, returns that item. |
FormItemEventInfo |
getEventItemInfo(String fieldName)
If the current mouse event occurred over an item, or the title of an item in this dynamicForm, return details about where the event occurred. |
Boolean |
getExportAll()
Setting exportAll to true prevents the component from passing its list of fields to the export call. |
String[] |
getExportFields()
The list of field-names to export. |
String |
getFetchOperation()
Operation ID this component should use when performing fetch operations. |
FormItem |
getField(String name)
|
String[] |
getFieldErrors(String fieldName)
Returns any validation errors for some field in this valuesManager. |
FormItem[] |
getFields()
Return thhe form fields |
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. |
String |
getFormSubmitFailedWarning()
Warning to display to the user if an attempt to natively
submit a form is unable to submit to the server. |
String |
getHiliteProperty()
Marker that can be set on a record to flag that record as hilited. |
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. |
String |
getHiliteState()
Get the current hilites encoded as a String, for saving. |
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. |
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(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? |
Integer |
getItemHoverHeight()
A default height for hovers shown for items |
Integer |
getItemHoverOpacity()
Opacity for hovers shown for items |
String |
getItemHoverStyle()
CSS Style for hovers shown for items |
Integer |
getItemHoverVAlign()
Vertical text alignment for hovers shown for items |
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. |
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. |
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(JavaScriptObject jsObj)
|
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). |
int |
getRecordIndex(Record record)
Get the index of the provided record. |
RecordList |
getRecordList()
Return the underlying data of this DataBoundComponent as a RecordList. |
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. |
String |
getRemoveOperation()
Operation ID this component should use when performing remove operations. |
String |
getRequiredMessage()
The required message for required field errors. |
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". |
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". |
String |
getRequiredTitlePrefix()
The string prepended to the title of every required item in this form if highlightRequiredFields is true. |
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. |
String |
getRightTitlePrefix()
The string prepended to the title of an item in this form if its titleOrientation property is set to "right". |
String |
getRightTitleSuffix()
The string appended to the title of an item in this form if its titleOrientation property is set to "right". |
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 SectionItems], this attribute
controls whether multiple sections can be expanded at once. |
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. |
Boolean |
getShowComplexFields()
Whether to show fields of non-atomic types when a DataBoundComponent is given a DataSource but no component.fields.
|
Boolean |
getShowComplexFieldsRecursively()
If set, this DynamicForm will set both showComplexFields and
showComplexFieldsRecursively on any nested component used for showing/editing a complex field. |
Boolean |
getShowDetailFields()
For databound forms, whether to show fields marked as detail fields. |
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). |
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). |
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). |
Boolean |
getShowHiddenFields()
Whether to show fields marked hidden:true when a DataBoundComponent is given a
DataSource but no component.fields.
|
Boolean |
getShowInlineErrors()
If true, field errors are written into the form next to the item(s) where the errors occurred. |
Boolean |
getShowTitlesWithErrorMessages()
Indicates whether on validation failure, the error message displayed to the user should be prepended with the title for the item. |
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. |
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. |
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. |
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. |
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". |
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. |
String |
getTitlePrefix()
The string prepended to the title of every item in this form. |
String |
getTitleSuffix()
The string appended to the title of every item in this form. |
String |
getUnknownErrorMessage()
The error message for a failed validator that does not specify its own errorMessage. |
String |
getUpdateOperation()
Operation ID this component should use when performing update operations. |
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.
|
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. |
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. |
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. |
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. |
Object |
getValue(String fieldName)
|
String |
getValueAsString(String fieldName)
|
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. |
Boolean |
getWrapItemTitles()
Whether titles for form items should wrap. |
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. |
Boolean |
hasFieldErrors(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(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(). |
Boolean |
isNewRecord()
Returns true if saveOperationType is currently
"add". |
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()
|
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()
|
void |
saveData(DSCallback callback)
|
void |
saveData(DSCallback callback,
DSRequest requestProperties)
|
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 Records passed in explicitly, or by index. |
void |
selectRecords(int[] records,
boolean newState)
Select/deselect a list of Records passed in explicitly, or by index. |
void |
selectRecords(Record[] records)
Select/deselect a list of Records passed in explicitly, or by index. |
void |
selectRecords(Record[] records,
boolean newState)
Select/deselect a list of Records passed in explicitly, or by index. |
void |
setAction(String action)
The URL to which the form will submit its values. |
void |
setAddDropValues(Boolean addDropValues)
Indicates whether to add "drop values" to items dropped on this component, if both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key. |
void |
setAddFormulaFieldText(String addFormulaFieldText)
Text for a menu item allowing users to add a formula field |
void |
setAddOperation(String addOperation)
Operation ID this component should use when performing add operations. |
void |
setAddSummaryFieldText(String addSummaryFieldText)
Text for a menu item allowing users to add a formula field |
void |
setAllowExpressions(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(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(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(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 |
setBrowserSpellCheck(Boolean browserSpellCheck)
If this browser has a 'spellCheck' feature for text-based form item elements, should it be used for items in this form? Can be overridden at the item level via browserSpellCheck |
void |
setCanAddFormulaFields(Boolean canAddFormulaFields)
Adds an item to the header context menu allowing users to launch a dialog to define a new field based on values present in other fields, using the com.smartgwt.client..FormulaBuilder.
|
void |
setCanAddSummaryFields(Boolean canAddSummaryFields)
Adds an item to the header context menu allowing users to launch a dialog to define a new text field that can contain both user-defined text and the formatted values present in other fields, using the com.smartgwt.client..SummaryBuilder.
|
void |
setCancelParamName(String cancelParamName)
The name of the special field sent to the server as part of DynamicForm.cancel |
void |
setCancelParamValue(String cancelParamValue)
The value of the special field sent to the server as part of DynamicForm.cancel |
void |
setCanEdit(Boolean canEdit)
If set to false, the form will be marked read-only. |
void |
setCanEditFieldAttribute(String canEditFieldAttribute)
If this component is bound to a dataSource, this attribute may be specified to customize what fields from the dataSource may be edited by default. |
void |
setCanFocus(Boolean canFocus)
DynamicForms are considered to have focus if any of their form items have focus. |
void |
setCanSubmit(Boolean canSubmit)
Governs whether this form will be used to perform a standard HTML form submission. |
void |
setCanTabToSectionHeaders(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 |
setColWidths(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(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(String dragTrackerStyle)
CSS Style to apply to the drag tracker when dragging occurs on this component. |
void |
setDropValues(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(String duplicateDragMessage)
Message to show when a user attempts to transfer duplicate records into this component, and preventDuplicates
is enabled. |
void |
setEditFormulaFieldText(String editFormulaFieldText)
Text for a menu item allowing users to edit a formula field |
void |
setEditSummaryFieldText(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(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(Map errors,
boolean showErrors)
Setter for validation errors on this form. |
void |
setErrorsPreamble(String errorsPreamble)
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 an introductory string rendered out before the individual error messages. |
void |
setExportAll(Boolean exportAll)
Setting exportAll to true prevents the component from passing its list of fields to the export call. |
void |
setExportFields(String[] exportFields)
The list of field-names to export. |
void |
setFetchOperation(String fetchOperation)
Operation ID this component should use when performing fetch operations. |
void |
setFieldErrors(String fieldName,
String[] errors,
boolean showErrors)
Set field validation errors for some field. |
void |
setFieldErrors(String fieldName,
String error,
boolean showErrors)
Set field validation error for some field. |
void |
setFields(FormItem... fields)
An array of field objects, specifying the order, layout, and types of each field in the DynamicForm. |
void |
setFixedColWidths(Boolean fixedColWidths)
If true, we ensure that column widths are at least as large as you specify them. |
void |
setFormSubmitFailedWarning(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(String hiliteProperty)
Marker that can be set on a record to flag that record as hilited. |
void |
setHiliteRequiredFields(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(String hiliteState)
Set the current hilites based on a hiliteState String previously returned from getHilitesState. |
void |
setImplicitSave(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(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(Integer itemHoverHeight)
A default height for hovers shown for items |
void |
setItemHoverOpacity(Integer itemHoverOpacity)
Opacity for hovers shown for items |
void |
setItemHoverStyle(String itemHoverStyle)
CSS Style for hovers shown for items |
void |
setItemHoverVAlign(Integer itemHoverVAlign)
Vertical text alignment for hovers shown for items |
void |
setItemHoverWidth(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)
Synonym for setFields(com.smartgwt.client.widgets.form.fields.FormItem[]). |
void |
setItemTitleHoverFormatter(FormItemHoverFormatter hoverFormatter)
The FormItemHoverFormatter should return the HTML to display in a hover canvas when the user holds the mousepointer over the item's title. |
void |
setJavaScriptObject(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(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(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 |
setRejectInvalidValueOnChange(Boolean rejectInvalidValueOnChange)
If validateOnChange is true, and validation fails for an item on change, with no suggested value, should we revert to the previous value, or continue to display the bad value entered by the user. |
void |
setRemoveOperation(String removeOperation)
Operation ID this component should use when performing remove operations. |
void |
setRequiredMessage(String requiredMessage)
The required message for required field errors. |
void |
setRequiredRightTitlePrefix(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(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(String requiredTitlePrefix)
The string prepended to the title of every required item in this form if highlightRequiredFields is true. |
void |
setRequiredTitleSuffix(String requiredTitleSuffix)
The string appended to the title of every required item in this form if highlightRequiredFields is true. |
void |
setRightTitlePrefix(String rightTitlePrefix)
The string prepended to the title of an item in this form if its titleOrientation property is set to "right". |
void |
setRightTitleSuffix(String rightTitleSuffix)
The string appended to the title of an item in this form if its titleOrientation property is set to "right". |
void |
setSaveOnEnter(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 SectionItems], this attribute
controls whether multiple sections can be expanded at once. |
void |
setSelectOnFocus(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(Boolean showComplexFields)
Whether to show fields of non-atomic types when a DataBoundComponent is given a DataSource but no component.fields.
|
void |
setShowComplexFieldsRecursively(Boolean showComplexFieldsRecursively)
If set, this DynamicForm will set both showComplexFields and
showComplexFieldsRecursively on any nested component used for showing/editing a complex field. |
void |
setShowDetailFields(Boolean showDetailFields)
For databound forms, whether to show fields marked as detail fields. |
void |
setShowErrorIcons(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(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(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(Boolean showHiddenFields)
Whether to show fields marked hidden:true when a DataBoundComponent is given a
DataSource but no component.fields.
|
void |
setShowInlineErrors(Boolean showInlineErrors)
If true, field errors are written into the form next to the item(s) where the errors occurred. |
void |
setShowTitlesWithErrorMessages(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(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(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(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(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(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(String titlePrefix)
The string prepended to the title of every item in this form. |
void |
setTitleSuffix(String titleSuffix)
The string appended to the title of every item in this form. |
void |
setTitleWidth(int titleWidth)
The width in pixels allocated to the title of every item in this form. |
void |
setTitleWidth(String titleWidth)
The width in pixels allocated to the title of every item in this form. |
void |
setUnknownErrorMessage(String unknownErrorMessage)
The error message for a failed validator that does not specify its own errorMessage. |
void |
setUpdateOperation(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(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(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(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(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(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(String fieldName,
boolean value)
Set the value for some field. |
void |
setValue(String fieldName,
DataClass value)
Set the value for some field. |
void |
setValue(String fieldName,
DataClass[] value)
Set the value for some field. |
void |
setValue(String fieldName,
Date value)
Set the value for some field. |
void |
setValue(String fieldName,
double value)
Set the value for some field. |
void |
setValue(String fieldName,
int[] value)
Set the value for some field. |
void |
setValue(String fieldName,
JavaScriptObject value)
Set the value for some field. |
void |
setValue(String fieldName,
Map value)
Set the value for some field. |
void |
setValue(String fieldName,
Record value)
Set the value for some field. |
void |
setValue(String fieldName,
Record[] value)
Set the value for some field. |
void |
setValue(String fieldName,
RelativeDate value)
Set the value for some field. |
void |
setValue(String fieldName,
String value)
Sets the value for some field |
void |
setValue(String fieldName,
String[] value)
Set the value for some field. |
void |
setValues(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(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(String fieldName)
If this form has any outstanding validation errors for the field passed in, show them now. |
void |
showItem(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)
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,
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()
Submits the form to the URL defined by action,
identically to how a plain HTML <form> element would submit data, as either an HTTP GET or POST as specified by
method. |
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. |
boolean |
valuesAreValid(boolean validateHiddenFields)
Method to determine whether the current form values would pass validation. |
Boolean |
valuesHaveChanged()
Compares the current set of values with the values stored by the call to the DynamicForm.rememberValues method. |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.smartgwt.client.widgets.DataBoundComponent |
|---|
getOrCreateJsObj |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Constructor Detail |
|---|
public DynamicForm()
public DynamicForm(JavaScriptObject jsObj)
| Method Detail |
|---|
public static DynamicForm getOrCreateRef(JavaScriptObject jsObj)
public void setJavaScriptObject(JavaScriptObject jsObj)
setJavaScriptObject in class Canvasprotected JavaScriptObject create()
create in class Canvaspublic void setAction(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 methodspublic 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.
StringRPCManager,
Submitting overview and related methodspublic void setAllowExpressions(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 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(Boolean autoFocus)
dynamicForm.focusInItem(itemName)
autoFocus - autoFocus Default value is falsefocusInItem(int),
Focus overview and related methodspublic Boolean getAutoFocus()
dynamicForm.focusInItem(itemName)
focusInItem(int),
Focus overview and related methodspublic void setBrowserSpellCheck(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 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(String cancelParamName)
DynamicForm.cancel
cancelParamName - . See String. Default value is "org.apache.struts.taglib.html.CANCEL"public String getCancelParamName()
DynamicForm.cancel
Stringpublic void setCancelParamValue(String cancelParamValue)
DynamicForm.cancel
cancelParamValue - . See String. Default value is "cancel"public String getCancelParamValue()
DynamicForm.cancel
Stringpublic void setCanEdit(Boolean canEdit)
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 components 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 nullpublic Boolean getCanEdit()
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 components 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.
public void setCanEditFieldAttribute(String canEditFieldAttribute)
throws 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"
IllegalStateException - this property cannot be changed after the component has been createdpublic 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.
Stringpublic void setCanFocus(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 CanvascanFocus - canFocus Default value is trueFocus overview and related methodspublic 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 CanvasFocus overview and related methodspublic void setCanSubmit(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 methodspublic 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(Boolean canTabToSectionHeaders)
throws 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 null
IllegalStateException - this property cannot be changed after the component has been createdpublic 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 methodspublic int getCellBorder()
FormLayout overview and related methodspublic void setCellPadding(int cellPadding)
cellPadding - cellPadding Default value is 2FormLayout overview and related methodspublic int getCellPadding()
FormLayout overview and related methodspublic 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 DataBoundComponentdataFetchMode - dataFetchMode Default value is "paged"Databinding overview and related methodspublic 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 DataBoundComponentDatabinding overview and related methodspublic 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(Boolean disableValidation)
disableValidation - disableValidation Default value is nullsaveData(),
submit(),
Validation overview and related methodspublic Boolean getDisableValidation()
saveData(),
submit(),
Validation overview and related methodspublic void setEncoding(Encoding encoding)
Note : This is an advanced setting
encoding - encoding Default value is DynamicForm.NORMALSubmitting overview and related methodspublic Encoding getEncoding()
Submitting overview and related methods
public void setErrorItemCellStyle(String errorItemCellStyle)
throws 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"
IllegalStateException - this property cannot be changed after the component has been createdValidation overview and related methodspublic String getErrorItemCellStyle()
showInlineErrors is false we show all errors
for the form item in a single item rendered at the top of the form.
StringValidation overview and related methods
public void setErrorsPreamble(String errorsPreamble)
throws IllegalStateException
showInlineErrors is false we show all errors
for the form item in a single item rendered at the top of the form.
errorsPreamble - . See HTMLString. Default value is "The following errors were found"
IllegalStateException - this property cannot be changed after the component has been createdValidation overview and related methodspublic String getErrorsPreamble()
showInlineErrors is false we show all errors
for the form item in a single item rendered at the top of the form.
HTMLStringValidation overview and related methodspublic void setFixedColWidths(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 methodspublic 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 methodspublic void setFormSubmitFailedWarning(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 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.
Stringpublic void setHiliteRequiredFields(Boolean hiliteRequiredFields)
hiliteRequiredFields - hiliteRequiredFields Default value is trueFormTitles overview and related methodspublic Boolean getHiliteRequiredFields()
FormTitles overview and related methodspublic void setImplicitSave(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 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(Boolean implicitSaveOnBlur)
implicitSaveOnBlur - implicitSaveOnBlur Default value is falsepublic 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(Integer itemHoverHeight)
itemHoverHeight - itemHoverHeight Default value is nullFormItem.setHoverHeight(java.lang.Integer)public Integer getItemHoverHeight()
FormItem.getHoverHeight()public void setItemHoverOpacity(Integer itemHoverOpacity)
itemHoverOpacity - itemHoverOpacity Default value is nullFormItem.setHoverOpacity(java.lang.Integer)public Integer getItemHoverOpacity()
FormItem.getHoverOpacity()public void setItemHoverStyle(String itemHoverStyle)
itemHoverStyle - . See CSSStyleName. Default value is "formHover"FormItem.setHoverStyle(java.lang.String)public String getItemHoverStyle()
CSSStyleNameFormItem.getHoverStyle()public void setItemHoverVAlign(Integer itemHoverVAlign)
itemHoverVAlign - itemHoverVAlign Default value is nullFormItem.setHoverVAlign(com.smartgwt.client.types.VerticalAlignment)public Integer getItemHoverVAlign()
FormItem.getHoverVAlign()public void setItemHoverWidth(Integer itemHoverWidth)
itemHoverWidth - itemHoverWidth Default value is nullFormItem.setHoverWidth(java.lang.Integer),
Hovers Examplepublic 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 methodspublic 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 methodspublic 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 methodspublic 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 methodspublic void setLongTextEditorType(String longTextEditorType)
longTextEditorType - . See String. Default value is "textArea"Appearance overview and related methodspublic String getLongTextEditorType()
StringAppearance overview and related methodspublic 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 methodspublic 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 methodspublic void setMinColWidth(int minColWidth)
minColWidth - minColWidth Default value is 20FormLayout overview and related methodspublic int getMinColWidth()
FormLayout overview and related methodspublic void setNumCols(int numCols)
numCols - numCols Default value is 2FormLayout overview and related methodspublic int getNumCols()
FormLayout overview and related methodspublic void setRejectInvalidValueOnChange(Boolean rejectInvalidValueOnChange)
Note : This is an advanced setting
rejectInvalidValueOnChange - rejectInvalidValueOnChange Default value is nullpublic Boolean getRejectInvalidValueOnChange()
public void setRequiredMessage(String requiredMessage)
requiredMessage - . See HTMLString. Default value is nullFormTitles overview and related methodspublic String getRequiredMessage()
HTMLStringFormTitles overview and related methodspublic void setRequiredRightTitlePrefix(String requiredRightTitlePrefix)
requiredRightTitlePrefix - . See HTMLString. Default value is ": "FormTitles overview and related methodspublic String getRequiredRightTitlePrefix()
HTMLStringFormTitles overview and related methodspublic void setRequiredRightTitleSuffix(String requiredRightTitleSuffix)
requiredRightTitleSuffix - . See HTMLString. Default value is ""FormTitles overview and related methodspublic String getRequiredRightTitleSuffix()
HTMLStringFormTitles overview and related methodspublic void setRequiredTitlePrefix(String requiredTitlePrefix)
requiredTitlePrefix - . See HTMLString. Default value is ""FormTitles overview and related methodspublic String getRequiredTitlePrefix()
HTMLStringFormTitles overview and related methodspublic void setRequiredTitleSuffix(String requiredTitleSuffix)
requiredTitleSuffix - . See HTMLString. Default value is " :"FormTitles overview and related methodspublic String getRequiredTitleSuffix()
HTMLStringFormTitles overview and related methodspublic void setRightTitlePrefix(String rightTitlePrefix)
rightTitlePrefix - . See HTMLString. Default value is ": "FormTitles overview and related methodspublic String getRightTitlePrefix()
HTMLStringFormTitles overview and related methodspublic void setRightTitleSuffix(String rightTitleSuffix)
rightTitleSuffix - . See HTMLString. Default value is ""FormTitles overview and related methodspublic String getRightTitleSuffix()
HTMLStringFormTitles overview and related methodspublic void setSaveOnEnter(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 methodspublic 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 methodspublic 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)
SectionItems], this attribute
controls whether multiple sections can be expanded at once.
sectionVisibilityMode - sectionVisibilityMode Default value is "multiple"VisibilityMode,
SectionItem,
FormLayout overview and related methodspublic VisibilityMode getSectionVisibilityMode()
SectionItems], this attribute
controls whether multiple sections can be expanded at once.
VisibilityMode,
SectionItem,
FormLayout overview and related methodspublic void setSelectOnFocus(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 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 methodspublic 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 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(Boolean showComplexFieldsRecursively)
throws 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 null
IllegalStateException - this property cannot be changed after the component has been createdpublic 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 setShowDetailFields(Boolean showDetailFields)
throws IllegalStateException
setShowDetailFields in interface DataBoundComponentshowDetailFields - showDetailFields Default value is true
IllegalStateException - this property cannot be changed after the component has been createdpublic Boolean getShowDetailFields()
getShowDetailFields in interface DataBoundComponentpublic void setShowErrorIcons(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 methodspublic 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 methodspublic void setShowErrorStyle(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 methodspublic 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 methodspublic void setShowErrorText(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 methodspublic 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 methodspublic void setShowInlineErrors(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 methodspublic 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 methodspublic void setShowTitlesWithErrorMessages(Boolean showTitlesWithErrorMessages)
showTitlesWithErrorMessages - showTitlesWithErrorMessages Default value is falseValidation overview and related methodspublic Boolean getShowTitlesWithErrorMessages()
Validation overview and related methods
public void setStopOnError(Boolean stopOnError)
throws 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 null
IllegalStateException - this property cannot be changed after the component has been createdpublic 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(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 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(Boolean synchronousValidation)
throws 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 false
IllegalStateException - this property cannot be changed after the component has been createdpublic 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(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 methodspublic 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.
StringSubmitting overview and related methodspublic 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(String titlePrefix)
titlePrefix - . See HTMLString. Default value is ""FormTitles overview and related methodspublic String getTitlePrefix()
HTMLStringFormTitles overview and related methodspublic void setTitleSuffix(String titleSuffix)
titleSuffix - . See HTMLString. Default value is " :"FormTitles overview and related methodspublic String getTitleSuffix()
HTMLStringFormTitles overview and related methodspublic void setUnknownErrorMessage(String unknownErrorMessage)
unknownErrorMessage - . See HTMLString. Default value is "Invalid value"Validation overview and related methodspublic String getUnknownErrorMessage()
HTMLStringValidation overview and related methods
public void setUserTask(UserTask userTask)
throws IllegalStateException
userTask for more details.
userTask - userTask Default value is null
IllegalStateException - this property cannot be changed after the component has been createdpublic UserTask getUserTask()
userTask for more details.
public void setValidateOnChange(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 methodspublic 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 methodspublic void setValidateOnExit(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 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(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 methodspublic 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.
StringsaveData(),
submit(),
Validation overview and related methodspublic void setWrapItemTitles(Boolean wrapItemTitles)
wrapTitle
wrapItemTitles - wrapItemTitles Default value is nullFormTitles overview and related methodspublic Boolean getWrapItemTitles()
wrapTitle
FormTitles overview and related methodspublic 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 methodspublic void cancelEditing()
public void clearErrors(boolean show)
show - If true, redraw the form to clear any visible error messages.
public void clearFieldErrors(String fieldName,
boolean show)
fieldName - field to clear errors fromshow - If true this method will fall through to DynamicForm.showFieldErrors to update the displaypublic void clearValue(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 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 HasFormSubmitFailedHandlershandler - the formSubmitFailed handler
HandlerRegistration used to remove this handlerpublic FormItem getEventItem()
public FormItem getFocusItem()
May be null.
Focus overview and related methodspublic 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 methodspublic 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 methodspublic HandlerRegistration addAsyncValidationReplyHandler(AsyncValidationReplyHandler handler)
Notification fired when an asynchronous validation completes.
addAsyncValidationReplyHandler in interface HasAsyncValidationReplyHandlershandler - the asyncValidationReply handler
HandlerRegistration used to remove this handlerpublic 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 HasHiddenValidationErrorsHandlershandler - the hiddenValidationErrors handler
HandlerRegistration used to remove this handlerpublic Boolean hasErrors()
DynamicForm.setErrors or DynamicForm.setFieldErrors.
Errors overview and related methodspublic Boolean hasFieldErrors(String fieldName)
DynamicForm.setErrors or DynamicForm.setFieldErrors.
fieldName - field to test for validation errors
Errors overview and related methodspublic void hideItem(String itemName)
FormItem.hide
itemName - Name of the item to showpublic Boolean isNewRecord()
saveOperationType is currently
"add". See saveOperationType.
public 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 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 HasItemChangeHandlershandler - the itemChange handler
HandlerRegistration used to remove this handlerpublic 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 HasItemChangedHandlershandler - the itemChanged handler
HandlerRegistration used to remove this handlerpublic 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 HasItemKeyPressHandlershandler - the itemKeyPress handler
HandlerRegistration 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 setValue(String fieldName,
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.public void showFieldErrors(String fieldName)
DynamicForm.setFieldErrors /
DynamicForm.addFieldErrors / DynamicForm.clearFieldErrors.DynamicForm.showErrors.
fieldName - field to show errors forpublic void showItem(String itemName)
FormItem.show
itemName - Name of the item to showpublic 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 trueHiddenItem with a defaultValue set. This is analogous to <input
type="hidden"> in HTML forms.
public HandlerRegistration addSubmitValuesHandler(SubmitValuesHandler handler)
Triggered when a SubmitItem is included in the form is submitted and gets pressed.
addSubmitValuesHandler in interface HasSubmitValuesHandlershandler - the submitValues handler
HandlerRegistration used to remove this handlerpublic 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 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()
onInit in class Canvasprotected 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 IllegalStateException
valuesManager.addMember(form) and
valuesManager.removeMember(form) Note : This is an advanced setting
setValuesManager in class CanvasvaluesManager - valuesManager Default value is null
IllegalStateException - this property cannot be changed after the component has been createdpublic ValuesManager getValuesManager()
getValuesManager in class Canvas
public void setCellSpacing(int cellSpacing)
throws IllegalStateException
setCellPadding(int) instead
cellSpacing - the cellSpacing
IllegalStateException - this property cannot be changed after the component has been createdpublic int getCellSpacing()
getCellPadding() instead
public void setUseAllDataSourceFields(boolean useAllDataSourceFields)
useAllDataSourceFields - useAllDataSourceFieldspublic void setValues(Map values)
values - the valuespublic Map getValues()
public 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 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(String fieldName,
double value)
fieldName - Name of the field being updatedvalue - New value.
public void setValue(String fieldName,
boolean value)
fieldName - Name of the field being updatedvalue - New value.
public void setValue(String fieldName,
int[] value)
fieldName - Name of the field being updatedvalue - New value.
public void setValue(String fieldName,
Date value)
fieldName - Name of the field being updatedvalue - New value.
public void setValue(String fieldName,
String[] value)
fieldName - Name of the field being updatedvalue - New value.
public void setValue(String fieldName,
Map value)
fieldName - Name of the field being updatedvalue - New value.
public void setValue(String fieldName,
JavaScriptObject value)
fieldName - Name of the field being updatedvalue - New value.
public void setValue(String fieldName,
Record value)
fieldName - Name of the field being updatedvalue - New value.
public void setValue(String fieldName,
DataClass value)
fieldName - Name of the field being updatedvalue - New value.
public void setValue(String fieldName,
Record[] value)
fieldName - Name of the field being updatedvalue - New value.
public void setValue(String fieldName,
DataClass[] value)
fieldName - Name of the field being updatedvalue - New value.
public void setValue(String fieldName,
RelativeDate value)
fieldName - Name of the field being updatedvalue - New value.public void setItems(FormItem... items)
setFields(com.smartgwt.client.widgets.form.fields.FormItem[]).
items - the items
public void setOperator(OperatorId operator)
throws 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"
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(String name)
public FormItem getField(String name)
public String getValueAsString(String fieldName)
public Object getValue(String fieldName)
public FormItemEventInfo getEventItemInfo(String fieldName)
fieldName - the field name
public 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(Map initialValues)
initialValues - initial set of values for the editor as a map of field names to their corresponding valuespublic 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(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(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 operation
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.
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(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 saveData()
public void saveData(DSCallback callback)
public void saveData(DSCallback callback,
DSRequest requestProperties)
public void submit()
submit() is automatically called when a SubmitItem
included in the form is clicked, or, if saveOnEnter is set, when the "Enter" key is pressed in a text input. Submit can also be manually called. If
com.smartgwt.client.widgets.form.DynamicForm#submitValues exists, it will be called, then immediately
return.
Otherwise, default behavior varies based on canSubmit: if canSubmit is false, saveData()
will be called to handle saving via Smart GWT databinding.
If canSubmit is true, the form
will be submitted like an ordinary HTML form via submitForm().
The parameters to submit() apply only if submit() will be calling ValuesManager.saveData(). If you override submit(), you can safely
ignore the parameters as Smart GWT framework code does not pass them.
public void submit(DSCallback callback)
submit() 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
com.smartgwt.client.widgets.form.DynamicForm#submitValues exists, it will be called, then immediately
return.
Otherwise, default behavior varies based on canSubmit: if canSubmit is false, saveData()
will be called to handle saving via Smart GWT databinding.
If canSubmit is true, the form
will be submitted like an ordinary HTML form via submitForm().
The parameters to submit() apply only if submit() will be calling ValuesManager.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 canSubmit is true]
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
com.smartgwt.client.widgets.form.DynamicForm#submitValues exists, it will be called, then immediately
return.
Otherwise, default behavior varies based on canSubmit: if canSubmit is false, saveData()
will be called to handle saving via Smart GWT databinding.
If canSubmit is true, the form
will be submitted like an ordinary HTML form via submitForm().
The parameters to submit() apply only if submit() will be calling ValuesManager.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]public 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(String itemName)
itemName - the item namepublic void focusInItem(FormItem formItem)
formItem - the form item
public void setErrors(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 Map getErrors()
public void setFieldErrors(String fieldName,
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 display
public void setFieldErrors(String fieldName,
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 String[] getFieldErrors(String fieldName)
fieldName - the field name
public 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)
hoverFormatter - the hover formatter
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)
DataBoundComponentResultSet 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 DataBoundComponentdataPageSize - dataPageSize Default value is 75public int getDataPageSize()
DataBoundComponentResultSet 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 DataBoundComponentpublic void setUseAllDataSourceFields(Boolean useAllDataSourceFields)
DataBoundComponentfields) 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 DataBoundComponentuseAllDataSourceFields - useAllDataSourceFields Default value is falsepublic Boolean getUseAllDataSourceFields()
DataBoundComponentfields) 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 DataBoundComponentpublic void setShowHiddenFields(Boolean showHiddenFields)
DataBoundComponenthidden: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 DataBoundComponentshowHiddenFields - showHiddenFields Default value is falsepublic Boolean getShowHiddenFields()
DataBoundComponenthidden: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 DataBoundComponentpublic void setShowComplexFields(Boolean showComplexFields)
DataBoundComponentcomponent.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 DataBoundComponentshowComplexFields - showComplexFields Default value is truepublic Boolean getShowComplexFields()
DataBoundComponentcomponent.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 DataBoundComponentpublic void setFetchOperation(String fetchOperation)
DataBoundComponent
setFetchOperation in interface DataBoundComponentfetchOperation - fetchOperation Default value is nullpublic String getFetchOperation()
DataBoundComponent
getFetchOperation in interface DataBoundComponentpublic void setUpdateOperation(String updateOperation)
DataBoundComponent
setUpdateOperation in interface DataBoundComponentupdateOperation - updateOperation Default value is nullpublic String getUpdateOperation()
DataBoundComponent
getUpdateOperation in interface DataBoundComponentpublic void setAddOperation(String addOperation)
DataBoundComponent
setAddOperation in interface DataBoundComponentaddOperation - addOperation Default value is nullpublic String getAddOperation()
DataBoundComponent
getAddOperation in interface DataBoundComponentpublic void setRemoveOperation(String removeOperation)
DataBoundComponent
setRemoveOperation in interface DataBoundComponentremoveOperation - removeOperation Default value is nullpublic String getRemoveOperation()
DataBoundComponent
getRemoveOperation in interface DataBoundComponentpublic void setExportFields(String[] exportFields)
DataBoundComponentIf exportFields is not provided, the exported output includes all visible fields from this component, sorted as they appear.
setExportFields in interface DataBoundComponentexportFields - exportFields Default value is nullpublic String[] getExportFields()
DataBoundComponentIf exportFields is not provided, the exported output includes all visible fields from this component, sorted as they appear.
getExportFields in interface DataBoundComponentpublic void setExportAll(Boolean exportAll)
DataBoundComponentfields.
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 DataBoundComponentexportAll - exportAll Default value is falsepublic Boolean getExportAll()
DataBoundComponentfields.
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(Boolean preventDuplicates)
throws IllegalStateException
DataBoundComponentDataBoundComponent.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 DataBoundComponentpreventDuplicates - preventDuplicates Default value is null
IllegalStateException - this property cannot be changed after the component has been createdpublic Boolean getPreventDuplicates()
DataBoundComponentDataBoundComponent.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(String duplicateDragMessage)
throws IllegalStateException
DataBoundComponentpreventDuplicates
is enabled. If set to null, duplicates will not be reported and the dragged duplicates will not be saved.
setDuplicateDragMessage in interface DataBoundComponentduplicateDragMessage - duplicateDragMessage Default value is "Duplicates not allowed"
IllegalStateException - this property cannot be changed after the component has been createdpublic String getDuplicateDragMessage()
DataBoundComponentpreventDuplicates
is enabled. If set to null, duplicates will not be reported and the dragged duplicates will not be saved.
getDuplicateDragMessage in interface DataBoundComponentpublic void setAddDropValues(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 DataBoundComponentaddDropValues - addDropValues Default value is truepublic 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 DataBoundComponentpublic void setDropValues(Map dropValues)
DataBoundComponentaddDropValues 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 DataBoundComponentdropValues - dropValues Default value is nullpublic Map getDropValues()
DataBoundComponentaddDropValues 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 DataBoundComponentdropValues 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(Boolean useFlatFields)
throws IllegalStateException
DataBoundComponentuseFlatFields 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 DataBoundComponentuseFlatFields - useFlatFields Default value is null
IllegalStateException - this property cannot be changed after the component has been createdpublic Boolean getUseFlatFields()
DataBoundComponentuseFlatFields 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 DataBoundComponentpublic void setHiliteProperty(String hiliteProperty)
DataBoundComponentid for a hilite defined on this component.
setHiliteProperty in interface DataBoundComponenthiliteProperty - hiliteProperty Default value is "_hilite"public String getHiliteProperty()
DataBoundComponentid for a hilite defined on this component.
getHiliteProperty in interface DataBoundComponentpublic void editHilites()
editHilites in interface DataBoundComponentpublic String getHiliteState()
getHiliteState in interface DataBoundComponentpublic void setHiliteState(String hiliteState)
setHiliteState in interface DataBoundComponenthiliteState - 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 DataBoundComponenthilites - array of hilite objectspublic Hilite[] getHilites()
getHilites in interface DataBoundComponentpublic void setDragDataAction(DragDataAction dragDataAction)
DataBoundComponent
setDragDataAction in interface DataBoundComponentdragDataAction - dragDataAction Default value is Canvas.MOVEpublic DragDataAction getDragDataAction()
DataBoundComponent
getDragDataAction in interface DataBoundComponentpublic void setDragTrackerStyle(String dragTrackerStyle)
DataBoundComponent
setDragTrackerStyle in interface DataBoundComponentdragTrackerStyle - dragTrackerStyle Default value is "gridDragTracker"public String getDragTrackerStyle()
DataBoundComponent
getDragTrackerStyle in interface DataBoundComponentpublic void setCanAddFormulaFields(Boolean canAddFormulaFields)
DataBoundComponentcom.smartgwt.client..FormulaBuilder.
User-added formula fields can be persisted via ListGrid.getFieldState() and
ListGrid.setFieldState(java.lang.String).
setCanAddFormulaFields in interface DataBoundComponentcanAddFormulaFields - canAddFormulaFields Default value is falsepublic void addSummaryField()
DataBoundComponentcom.smartgwt.client..SummaryBuilder to create a new Summary Field. This
is equivalent to calling DataBoundComponentGen#editSummaryField with
no parameter.
addSummaryField in interface DataBoundComponentpublic void addFormulaField()
DataBoundComponentcom.smartgwt.client..FormulaBuilder to create a new Formula Field. This
is equivalent to calling DataBoundComponentGen#editFormulaField with
no parameter.
addFormulaField in interface DataBoundComponentpublic Boolean getCanAddFormulaFields()
DataBoundComponentcom.smartgwt.client..FormulaBuilder.
User-added formula fields can be persisted via ListGrid.getFieldState() and
ListGrid.setFieldState(java.lang.String).
getCanAddFormulaFields in interface DataBoundComponentpublic void setAddFormulaFieldText(String addFormulaFieldText)
DataBoundComponent
setAddFormulaFieldText in interface DataBoundComponentaddFormulaFieldText - addFormulaFieldText Default value is "Add formula column..."public String getAddFormulaFieldText()
DataBoundComponent
getAddFormulaFieldText in interface DataBoundComponentpublic void setEditFormulaFieldText(String editFormulaFieldText)
DataBoundComponent
setEditFormulaFieldText in interface DataBoundComponenteditFormulaFieldText - editFormulaFieldText Default value is "Edit formula..."public String getEditFormulaFieldText()
DataBoundComponent
getEditFormulaFieldText in interface DataBoundComponentpublic void setCanAddSummaryFields(Boolean canAddSummaryFields)
DataBoundComponentcom.smartgwt.client..SummaryBuilder.
User-added summary fields can be persisted via ListGrid.getFieldState() and
ListGrid.setFieldState(java.lang.String).
setCanAddSummaryFields in interface DataBoundComponentcanAddSummaryFields - canAddSummaryFields Default value is falsepublic Boolean getCanAddSummaryFields()
DataBoundComponentcom.smartgwt.client..SummaryBuilder.
User-added summary fields can be persisted via ListGrid.getFieldState() and
ListGrid.setFieldState(java.lang.String).
getCanAddSummaryFields in interface DataBoundComponentpublic void setAddSummaryFieldText(String addSummaryFieldText)
DataBoundComponent
setAddSummaryFieldText in interface DataBoundComponentaddSummaryFieldText - addSummaryFieldText Default value is "Add summary column..."public String getAddSummaryFieldText()
DataBoundComponent
getAddSummaryFieldText in interface DataBoundComponentpublic void setEditSummaryFieldText(String editSummaryFieldText)
DataBoundComponent
setEditSummaryFieldText in interface DataBoundComponenteditSummaryFieldText - editSummaryFieldText Default value is "Edit summary format..."public String getEditSummaryFieldText()
DataBoundComponent
getEditSummaryFieldText in interface DataBoundComponentpublic void selectRecord(Record record)
DataBoundComponentRecord passed in explicitly, or by index.
selectRecord in interface DataBoundComponentrecord - record (or row number) to selectpublic void selectRecord(int record)
DataBoundComponentRecord passed in explicitly, or by index.
selectRecord in interface DataBoundComponentrecord - record (or row number) to select
public void selectRecord(int record,
boolean newState)
DataBoundComponentRecord passed in explicitly, or by index.
selectRecord in interface DataBoundComponentrecord - record (or row number) to selectnewState - new selection state (if null, defaults to true)
public void selectRecord(Record record,
boolean newState)
DataBoundComponentRecord passed in explicitly, or by index.
selectRecord in interface DataBoundComponentrecord - record (or row number) to selectnewState - new selection state (if null, defaults to true)public void selectRecords(int[] records)
DataBoundComponentRecords passed in explicitly, or by index.
selectRecords in interface DataBoundComponentrecords - records (or row numbers) to select
public void selectRecords(int[] records,
boolean newState)
DataBoundComponentRecords passed in explicitly, or by index.
selectRecords in interface DataBoundComponentrecords - records (or row numbers) to selectnewState - new selection statepublic void selectRecords(Record[] records)
DataBoundComponentRecords passed in explicitly, or by index.
selectRecords in interface DataBoundComponentrecords - records (or row numbers) to select
public void selectRecords(Record[] records,
boolean newState)
DataBoundComponentRecords passed in explicitly, or by index.
selectRecords in interface DataBoundComponentrecords - records (or row numbers) to selectnewState - new selection state (if null, defaults to true)public void deselectRecord(Record record)
DataBoundComponentRecord passed in explicitly, or by index. Synonym for
selectRecord(record, false)
deselectRecord in interface DataBoundComponentrecord - record (or row number) to deselectpublic void deselectRecord(int record)
DataBoundComponentRecord passed in explicitly, or by index. Synonym for
selectRecord(record, false)
deselectRecord in interface DataBoundComponentrecord - record (or row number) to deselectpublic void deselectRecords(int[] records)
DataBoundComponentRecords passed in explicitly, or by index. Synonym
for selectRecords(records, false)
deselectRecords in interface DataBoundComponentrecords - records (or row numbers) to deselectpublic void deselectRecords(Record[] records)
DataBoundComponentRecords passed in explicitly, or by index. Synonym
for selectRecords(records, false)
deselectRecords in interface DataBoundComponentrecords - records (or row numbers) to deselectpublic void selectAllRecords()
DataBoundComponent
selectAllRecords in interface DataBoundComponentpublic void deselectAllRecords()
DataBoundComponent
deselectAllRecords in interface DataBoundComponentpublic Boolean anySelected()
DataBoundComponent
anySelected in interface DataBoundComponentpublic void enableHilite(String hiliteID)
DataBoundComponenthilites
enableHilite in interface DataBoundComponenthiliteID - ID of hilite to enable
public void enableHilite(String hiliteID,
boolean enable)
DataBoundComponenthilites
enableHilite in interface DataBoundComponenthiliteID - ID of hilite to enableenable - new enabled state to apply - if null, defaults to truepublic void disableHilite(String hiliteID)
DataBoundComponent
disableHilite in interface DataBoundComponenthiliteID - ID of hilite to disablepublic void enableHiliting()
DataBoundComponent
enableHiliting in interface DataBoundComponentpublic void enableHiliting(boolean enable)
DataBoundComponent
enableHiliting in interface DataBoundComponentenable - new enabled state to apply - if null, defaults to truepublic void disableHiliting()
DataBoundComponent
disableHiliting in interface DataBoundComponentpublic Record[] getDragData()
DataBoundComponent
This method is consulted by
ListGrid.willAcceptDrop().
getDragData in interface DataBoundComponentRecords that are currently selected.public void transferSelectedData(DataBoundComponent source)
DataBoundComponentDataBoundComponent.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 DataBoundComponentsource - source component from which the records will be tranferred
public void transferSelectedData(DataBoundComponent source,
int index)
DataBoundComponentDataBoundComponent.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 DataBoundComponentsource - source component from which the records will be tranferredindex - target index (drop position) of the rows within this grid.public int getRecordIndex(Record record)
DataBoundComponentOverride in subclasses to provide more specific behaviour, for instance, when data holds a large number of records
getRecordIndex in interface DataBoundComponentrecord - the record whose index is to be retrieved
public String getTitleFieldValue(Record record)
DataBoundComponentOverride in subclasses
getTitleFieldValue in interface DataBoundComponentrecord - the record whose index is to be retrieved
public void setTitleField(String titleField)
DataBoundComponent
setTitleField in interface DataBoundComponentpublic String getTitleField()
DataBoundComponenttitleField 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 DataBoundComponentpublic void setDataSource(DataSource dataSource)
DataBoundComponentWhen 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 DataBoundComponentdataSource - DataSource to bind to. Default value is nullpublic DataSource getDataSource()
DataBoundComponentDataSource requests.
getDataSource in interface DataBoundComponent
public void setAutoFetchData(Boolean autoFetchData)
throws IllegalStateException
DataBoundComponentDataBoundComponent.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 DataBoundComponentautoFetchData - autoFetchData
IllegalStateExceptionpublic Boolean getAutoFetchData()
DataBoundComponentDataBoundComponent.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 IllegalStateException
DataBoundComponentautoFetchData is true, this attribute allows the developer to specify a textMatchStyle
for the initial DataBoundComponent.fetchData() call.
setAutoFetchTextMatchStyle in interface DataBoundComponentIllegalStateExceptionpublic TextMatchStyle getAutoFetchTextMatchStyle()
DataBoundComponentautoFetchData is true, this attribute allows the developer to specify a textMatchStyle
for the initial DataBoundComponent.fetchData() call.
getAutoFetchTextMatchStyle in interface DataBoundComponent
public void setAutoFetchAsFilter(Boolean autoFetchAsFilter)
throws IllegalStateException
DataBoundComponentDataBoundComponent.setAutoFetchData(Boolean) is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData() or DataBoundComponent.filterData()
setAutoFetchAsFilter in interface DataBoundComponentautoFetchAsFilter - autoFetchAsFilter
IllegalStateExceptionpublic Boolean getAutoFetchAsFilter()
DataBoundComponentDataBoundComponent.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 IllegalStateException
DataBoundComponentDataBoundComponent.setAutoFetchData(Boolean) is used.
setInitialCriteria in interface DataBoundComponentinitialCriteria - the initial criteria
IllegalStateException - this property cannot be changed after the component has been createdpublic Criteria getInitialCriteria()
DataBoundComponentDataBoundComponent.setAutoFetchData(Boolean) is used.
getInitialCriteria in interface DataBoundComponentpublic 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 DataBoundComponentpublic 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 DataBoundComponentcriteria - 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 DataBoundComponentcriteria - 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
public 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 DataBoundComponentcriteria - 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 DataBoundComponentpublic 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 DataBoundComponentcriteria - 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 DataBoundComponentcriteria - 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 details
public 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 DataBoundComponentcriteria - 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()
DataBoundComponentthis.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 DataBoundComponentpublic ResultSet getResultSet()
DataBoundComponentResultSet.
Note that this method should only be called after initial data has been fetched by this DataBoundComponent.
getResultSet in interface DataBoundComponentDataBoundComponent.fetchData()public RecordList getRecordList()
DataBoundComponentRecordList.
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 DataBoundComponentpublic void exportData()
DataBoundComponentDataSource
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 DataBoundComponentDataBoundComponentMethods overview and related methodspublic void exportData(DSRequest requestProperties)
DataBoundComponentDataSource
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 DataBoundComponentrequestProperties - additional properties to set on the DSRequest that will be issuedDataBoundComponentMethods overview and related methodspublic void exportClientData()
DataBoundComponentTo 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 DataBoundComponentDataSource.exportClientData(java.lang.Object[], com.smartgwt.client.data.DSRequest)public void exportClientData(DSRequest requestProperties)
DataBoundComponentTo 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 DataBoundComponentrequestProperties - Request properties for the exportDataSource.exportClientData(java.lang.Object[], com.smartgwt.client.data.DSRequest)public HandlerRegistration addFetchDataHandler(FetchDataHandler handler)
Notification function fired on fetchData() or filterData()
addFetchDataHandler in interface HasFetchDataHandlershandler - the filterData handler
HandlerRegistration used to remove this handlerpublic 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 HasDropCompleteHandlershandler - the DropCompleteHandler
HandlerRegistration used to remove this handlerpublic 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 HasDragCompleteHandlershandler - the DropCompleteHandler
HandlerRegistration 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 LogicalStructuregetLogicalStructure in class Canvas
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||