|
|||||||||
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, set fields
to an Array of Objects describing the
FormItems you want to use. For example:
isc.DynamicForm.create({ fields:[ {name:"userName", type:"text"}, // creates a TextItem {name:"usState", type:"select"} // creates a SelectItem ] })The item
name
is an identifier for the item that must be unique just within
this form. It is used:
getValues()
getValue(java.lang.String)
)
getItem(java.lang.String)
type
controls what kind of FormItem is created. See
FormItemType
.
The title
and defaultValue
are also
commonly specified. 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 ${isc.DocUtils.linkForExampleId('toolstrip', 'Toolstrip example')}.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.smartgwt.client.widgets.BaseWidget |
---|
config, configOnly, id, isElementSet |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
DynamicForm()
|
|
DynamicForm(com.google.gwt.core.client.JavaScriptObject jsObj)
|
Method Summary | |
---|---|
void |
addFormulaField()
Convenience method to display a com.smartgwt.client..FormulaBuilder to create a new Formula Field. |
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. |
java.lang.Boolean |
anySelected()
Whether at least one item is selected |
void |
cancel()
This method exists for clean integration with existing server frameworks that have a 'cancel' feature which typically clears session state associated with the form. |
void |
cancel(DSRequest requestProperties)
This method exists for clean integration with existing server frameworks that have a 'cancel' feature which typically clears session state associated with the form. |
void |
clearErrors(boolean show)
Clears all errors for this DynamicForm. |
void |
clearFieldErrors(java.lang.String fieldName,
boolean show)
Clear any validation errors on the field passed in. |
void |
clearValue(java.lang.String fieldName)
Clears the value for some field via a call to com.smartgwt.client.widgets.form.fields.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.
|
void |
clearValues()
Reset to default form values and clear errors |
protected com.google.gwt.core.client.JavaScriptObject |
create()
|
void |
deselectAllRecords()
Deselect all records |
void |
deselectRecord(int record)
Deselect a Record passed in explicitly, or by index. |
void |
deselectRecord(Record record)
Deselect a Record passed in explicitly, or by index. |
void |
deselectRecords(int[] records)
Deselect a list of Record s passed in explicitly, or by index. |
void |
deselectRecords(Record[] records)
Deselect a list of Record s passed in explicitly, or by index. |
void |
disableHilite(java.lang.String hiliteID)
Disable a hilite |
void |
disableHiliting()
Disable all hilites. |
void |
editNewRecord()
Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified). |
void |
editNewRecord(java.util.Map initialValues)
Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified). |
void |
editRecord(Record record)
Edit an existing record. |
void |
editSelectedData(ListGrid selectionComponent)
|
void |
editSelectedData(java.lang.String listGridID)
|
void |
enableHilite(java.lang.String hiliteID)
Enable / disable a hilites
|
void |
enableHilite(java.lang.String hiliteID,
boolean enable)
Enable / disable a hilites
|
void |
enableHiliting()
Enable all hilites. |
void |
enableHiliting(boolean enable)
Enable all hilites. |
void |
fetchData()
Uses a "fetch" operation on the current DataSource to retrieve data that matches
the provided criteria, and displays the matching data in this component. |
void |
fetchData(Criteria criteria)
Uses a "fetch" operation on the current DataSource to retrieve data that matches
the provided criteria, and displays the matching data in this component. |
void |
fetchData(Criteria criteria,
DSCallback callback)
Uses a "fetch" operation on the current DataSource to retrieve data that matches
the provided criteria, and displays the matching data in this component. |
void |
fetchData(Criteria criteria,
DSCallback callback,
DSRequest requestProperties)
Uses a "fetch" operation on the current DataSource to retrieve data that matches
the provided criteria, and displays the matching data in this component. |
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(java.lang.String itemName)
Move the keyboard focus into a particular item. |
java.lang.String |
getAction()
The URL to which the form will submit its values. |
java.lang.Boolean |
getAddDropValues()
Indicates whether to add "drop values" to items dropped on this component, if both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key. |
java.lang.String |
getAddFormulaFieldText()
Text for a menu item allowing users to add a formula field |
java.lang.String |
getAddOperation()
Operation ID this component should use when performing add operations. |
java.lang.String |
getAddSummaryFieldText()
Text for a menu item allowing users to add a formula field |
java.lang.Boolean |
getAutoFetchAsFilter()
If DataBoundComponent.setAutoFetchData(Boolean) is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData() or DataBoundComponent.filterData() |
java.lang.Boolean |
getAutoFetchData()
If true, when this component is first drawn, automatically call DataBoundComponent.fetchData() or DataBoundComponent.filterData() depending on
DataBoundComponent.getAutoFetchAsFilter() . |
java.lang.Boolean |
getAutoFocus()
If true, when the form is drawn, focus will automatically be put into the first focusable element in the form. Note that to put focus in a different item you can explicitly call dynamicForm.focusInItem(itemName) |
java.lang.Boolean |
getCanAddFormulaFields()
Adds an item to the header context menu allowing users to launch a dialog to define a new field based on values present in other fields, using the com.smartgwt.client..FormulaBuilder .
|
java.lang.Boolean |
getCanAddSummaryFields()
Adds an item to the header context menu allowing users to launch a dialog to define a new text field that can contain both user-defined text and the formatted values present in other fields, using the com.smartgwt.client..SummaryBuilder .
|
java.lang.String |
getCancelParamName()
The name of the special field sent to the server as part of cancel() |
java.lang.String |
getCancelParamValue()
The value of the special field sent to the server as part of cancel() |
java.lang.Boolean |
getCanFocus()
DynamicForms are considered to have focus if any of their form items have focus. Note that setting dynamicForm.canFocus to false will have no effect on
whether form items within the form may recieve focus. |
java.lang.Boolean |
getCanSubmit()
Governs whether this form will be used to perform a standard HTML form submission. Note that if true, submit() will perform a native HTML submission
to the specified action URL.Wherever possible we strongly recommend using the '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. |
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()
Return the cellSpacing. |
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 DSRequest .
|
java.lang.Boolean |
getDisableValidation()
If set to true, client-side validators will not run on the form when validate() is called. |
Record[] |
getDragData()
During a drag-and-drop interaction, this method returns the set of records being dragged out of the component. |
DragDataAction |
getDragDataAction()
Indicates what to do with data dragged into another DataBoundComponent. |
java.lang.String |
getDragTrackerStyle()
CSS Style to apply to the drag tracker when dragging occurs on this component. |
java.util.Map |
getDropValues()
When an item is dropped on this component, and addDropValues is true and both
the source and target widgets are databound, either to the same DataSource or
to different DataSources that are related via a foreign key, this object
provides the "drop values" that SmartGWT will apply to the dropped object
before updating it.
|
java.lang.String |
getDuplicateDragMessage()
Message to show when a user attempts to transfer duplicate records into this component, and preventDuplicates is enabled. |
java.lang.String |
getEditFormulaFieldText()
Text for a menu item allowing users to edit a formula field |
java.lang.String |
getEditSummaryFieldText()
Text for a menu item allowing users to edit the formatter for a field |
Encoding |
getEncoding()
encoding for the form, use MULTIPART_ENCODING for file upload forms |
java.lang.String |
getErrorItemCellStyle()
If showInlineErrors is false we show all errors for the form item in
a single item rendered at the top of the form.This attribute specifies the cellStyle to apply to this item. |
java.util.Map |
getErrors()
Returns the set of errors. |
java.lang.String |
getErrorsPreamble()
If showInlineErrors is false 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. |
java.lang.Boolean |
getExportAll()
Setting exportAll to true prevents the component from passing it's list of fields to the export call. |
java.lang.String[] |
getExportFields()
The list of field-names to export. |
java.lang.String |
getFetchOperation()
Operation ID this component should use when performing fetch operations. |
FormItem |
getField(java.lang.String name)
|
java.lang.String[] |
getFieldErrors(java.lang.String fieldName)
Returns any validation errors for some field in this valuesManager. |
FormItem[] |
getFields()
Return thhe form fields |
java.lang.Boolean |
getFixedColWidths()
If true, we ensure that column widths are at least as large as you specify them. |
java.lang.String |
getHiliteProperty()
Marker that can be set on a record to flag that record as hilited. |
java.lang.Boolean |
getHiliteRequiredFields()
Indicates whether the titles of required items in this form should use the special prefix and suffix specified by the next two properties, instead of the standard prefix and suffix. |
Criteria |
getInitialCriteria()
Criteria to use when DataBoundComponent.setAutoFetchData(Boolean) is used. |
FormItem |
getItem(java.lang.String name)
|
Alignment |
getItemHoverAlign()
Text alignment for hovers shown for items |
int |
getItemHoverDelay()
If the user rolls over an item, how long a delay before we fire any hover action / show a hover for that item? |
java.lang.Integer |
getItemHoverHeight()
A default height for hovers shown for items |
java.lang.Integer |
getItemHoverOpacity()
Opacity for hovers shown for items |
java.lang.String |
getItemHoverStyle()
CSS Style for hovers shown for items |
java.lang.Integer |
getItemHoverVAlign()
Vertical text alignment for hovers shown for items |
java.lang.Integer |
getItemHoverWidth()
A default width for hovers shown for items |
FormLayoutType |
getItemLayout()
Layout style to use with this form. |
int |
getLongTextEditorThreshold()
When creating form items for fields with text type data, if the specified length of the field exceeds this threshold we will create form item of type this.longTextEditorType (a TextAreaItem by default), rather than a simple
text item. |
java.lang.String |
getLongTextEditorType()
Name of the Form Item class to use for text fields which exceed the longTextEditorThreshold for this form. |
FormMethod |
getMethod()
The mechanism by which form data is sent to the action URL. |
int |
getMinColWidth()
Minimum width of a form column. |
int |
getNumCols()
The number of columns of titles and items in this form's layout grid. |
OperatorId |
getOperator()
When operator has been set for any FormItem in this form, what logical operator should be applied across
the ${isc.DocUtils.linkForRef('object:Criterion','criteria')} produced by the form items? Only applicable to
forms that have a dataSource . |
static DynamicForm |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
|
java.lang.Boolean |
getPreventDuplicates()
If set, detect and prevent duplicate records from being transferred to this component, either via drag and drop or via DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent) . |
int |
getRecordIndex(Record record)
Get the index of the provided record. |
java.lang.Boolean |
getRejectInvalidValueOnChange()
If validateOnChange is true, and validation fails for an item on change, with no suggested value, should we revert to the previous value, or continue to display the bad value entered by the user. |
java.lang.String |
getRemoveOperation()
Operation ID this component should use when performing remove operations. |
java.lang.String |
getRequiredRightTitlePrefix()
The string prepended to the title of every required item in this form if highlightRequiredFields is true and the titleOrientation property is set to "right". |
java.lang.String |
getRequiredRightTitleSuffix()
The string appended to the title of every required item in this form if highlightRequiredFields is true and the titleOrientation property is set to "right". |
java.lang.String |
getRequiredTitlePrefix()
The string prepended to the title of every required item in this form if highlightRequiredFields is true. |
java.lang.String |
getRequiredTitleSuffix()
The string appended to the title of every required item in this form if highlightRequiredFields is true. |
java.lang.String |
getRightTitlePrefix()
The string prepended to the title of an item in this form if its titleOrientation property is set to "right". |
java.lang.String |
getRightTitleSuffix()
The string appended to the title of an item in this form if its titleOrientation property is set to "right". |
java.lang.Boolean |
getSaveOnEnter()
If true , when the user hits the Enter key while focussed in a text-item in
this form, we automatically submit the form to the server using the
submit() method. |
DSOperationType |
getSaveOperationType()
Default DSOperationType to be performed when saveData() is called.
This property is automatically set on a call to editRecord(com.smartgwt.client.data.Record) or
editNewRecord() , or may be set directly via
setSaveOperationType(com.smartgwt.client.types.DSOperationType) .
|
VisibilityMode |
getSectionVisibilityMode()
If the form has sections, [implemented as SectionItem s], this attribute controls
whether multiple sections can be expanded at once. |
java.lang.Boolean |
getSelectOnFocus()
If this property is set to true, whenever a text-based field in this form ( TextItem , TextAreaItem ) is given focus programmatically
(see focusInItem(int) ), all text within the item will be selected.
|
java.lang.Boolean |
getShowComplexFields()
Whether to show fields of non-atomic types when a DataBoundComponent is given a DataSource but no component.fields .
|
java.lang.Boolean |
getShowComplexFieldsRecursively()
If set, this DynamicForm will set both
showComplexFields and
showComplexFieldsRecursively on any nested component used for showing/editing
a complex field. |
java.lang.Boolean |
getShowDetailFields()
Whether to show fields marked detail:true when a DataBoundComponent is
given a DataSource but no component.fields .
|
java.lang.Boolean |
getShowErrorIcons()
showErrorIcons ,
showErrorText , and
showErrorStyle control how validation errors are
displayed next to form items when showInlineErrors is true.
These properties are boolean values, and can be set on a DynamicForm to control the
behavior form-wide, or set on individual FormItems.
|
java.lang.Boolean |
getShowErrorStyle()
showErrorIcons ,
showErrorText , and
showErrorStyle control how validation errors are
displayed next to form items when showInlineErrors is true.
These properties are boolean values, and can be set on a DynamicForm to control the
behavior form-wide, or set on individual FormItems.
|
java.lang.Boolean |
getShowErrorText()
showErrorIcons ,
showErrorText , and
showErrorStyle control how validation errors are
displayed next to form items when showInlineErrors is true.
These properties are boolean values, and can be set on a DynamicForm to control the
behavior form-wide, or set on individual FormItems.
|
java.lang.Boolean |
getShowHiddenFields()
Whether to show fields marked hidden:true when a DataBoundComponent is given a
DataSource but no component.fields .
|
java.lang.Boolean |
getShowInlineErrors()
If true, field errors are written into the form next to the item(s) where the errors occurred. |
java.lang.Boolean |
getShowTitlesWithErrorMessages()
Indicates whether on validation failure, the error message displayed to the user should be prepended with the title for the item. |
java.lang.String |
getTarget()
The name of a window or frame that will receive the results returned by the form's action. |
java.lang.String |
getTitleField()
Method to return the fieldName which represents the "title" for records in this Component. If this.titleField is explicitly specified it will always be used. Otherwise, default implementation will check titleField for databound
compounds.For non databound components returns the first defined field name of "title" ,
"name" , or "id" . |
java.lang.String |
getTitleFieldValue(Record record)
Get the value of the titleField for the passed record |
TitleOrientation |
getTitleOrientation()
Default orientation for titles for items in this form. |
java.lang.String |
getTitlePrefix()
The string prepended to the title of every item in this form. |
java.lang.String |
getTitleSuffix()
The string appended to the title of every item in this form. |
java.lang.String |
getUnknownErrorMessage()
The error message for a failed validator that does not specify its own errorMessage. |
java.lang.String |
getUpdateOperation()
Operation ID this component should use when performing update operations. |
java.lang.Boolean |
getUseAllDataSourceFields()
If true, the set of fields given by the "default binding" (see fields ) is used, with any fields specified in
component.fields acting as overrides that can suppress or modify the
display of individual fields, without having to list the entire set of fields that
should be shown.
|
java.lang.Boolean |
getUseFlatFields()
The useFlatFields flag causes all simple type fields anywhere in a nested
set of DataSources to be exposed as a flat list for form binding. |
java.lang.Boolean |
getValidateOnChange()
If true, form fields will be validated when each item's "change" handler is fired as well as when the entire form is submitted or validated. 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 change. |
java.lang.String |
getValidationURL()
validationURL can be set to do server-side validation against a different URL from where the form will ultimately save, as part of an incremental upgrade strategy for Struts and Struts-like applications. |
java.lang.Object |
getValue(java.lang.String fieldName)
|
java.lang.String |
getValueAsString(java.lang.String fieldName)
|
java.util.Map |
getValues()
Returns the current set of values where each propertyName is the name of a form item in the form, and each property value is the value held by that form item. |
Criteria |
getValuesAsCriteria()
|
ValuesManager |
getValuesManager()
Return the ValuesManager for this form. |
java.lang.Boolean |
getWrapItemTitles()
Whether titles for form items should wrap. |
java.lang.Boolean |
hasErrors()
Return whether this form currently has any validation errors. Validation errors are set up automatically by validation, or may be explicitly set via setErrors(java.util.Map, boolean) or setFieldErrors(java.lang.String, java.lang.String, boolean) .
|
java.lang.Boolean |
hasFieldErrors(java.lang.String fieldName)
Does this form currently h ave any validation errors on the field passed in? Validation errors are set up automatically by validation, or may be explicitly set via setErrors(java.util.Map, boolean) or setFieldErrors(java.lang.String, java.lang.String, boolean) .
|
void |
hideItem(java.lang.String itemName)
Hide a form item via FormItem.hide()
|
void |
invalidateCache()
Invalidate the current data cache for this databound component via a call to this.data.invalidateCache() . |
java.lang.Boolean |
isNewRecord()
Returns true if saveOperationType is currently "add". |
protected void |
onInit()
|
com.google.gwt.core.client.JavaScriptObject |
rememberValues()
Make a snapshot of the current set of values, so we can reset to them later. |
void |
reset()
Resets values to the state it was the last time setValues() or
rememberValues() was called. |
void |
resetValues()
Same as reset() .
|
void |
saveData()
|
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 Record s passed in explicitly, or by index. |
void |
selectRecords(int[] records,
boolean newState)
Select/deselect a list of Record s passed in explicitly, or by index. |
void |
selectRecords(Record[] records)
Select/deselect a list of Record s passed in explicitly, or by index. |
void |
selectRecords(Record[] records,
boolean newState)
Select/deselect a list of Record s passed in explicitly, or by index. |
void |
setAction(java.lang.String action)
The URL to which the form will submit its values. |
void |
setAddDropValues(java.lang.Boolean addDropValues)
Indicates whether to add "drop values" to items dropped on this component, if both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key. |
void |
setAddFormulaFieldText(java.lang.String addFormulaFieldText)
Text for a menu item allowing users to add a formula field |
void |
setAddOperation(java.lang.String addOperation)
Operation ID this component should use when performing add operations. |
void |
setAddSummaryFieldText(java.lang.String addSummaryFieldText)
Text for a menu item allowing users to add a formula field |
void |
setAutoFetchAsFilter(java.lang.Boolean autoFetchAsFilter)
If DataBoundComponent.setAutoFetchData(Boolean) is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData() or DataBoundComponent.filterData() |
void |
setAutoFetchData(java.lang.Boolean autoFetchData)
If true, when this component is first drawn, automatically call DataBoundComponent.fetchData() or DataBoundComponent.filterData() depending on
DataBoundComponent.getAutoFetchAsFilter() . |
void |
setAutoFocus(java.lang.Boolean autoFocus)
If true, when the form is drawn, focus will automatically be put into the first focusable element in the form. Note that to put focus in a different item you can explicitly call dynamicForm.focusInItem(itemName) |
void |
setCanAddFormulaFields(java.lang.Boolean canAddFormulaFields)
Adds an item to the header context menu allowing users to launch a dialog to define a new field based on values present in other fields, using the com.smartgwt.client..FormulaBuilder .
|
void |
setCanAddSummaryFields(java.lang.Boolean canAddSummaryFields)
Adds an item to the header context menu allowing users to launch a dialog to define a new text field that can contain both user-defined text and the formatted values present in other fields, using the com.smartgwt.client..SummaryBuilder .
|
void |
setCancelParamName(java.lang.String cancelParamName)
The name of the special field sent to the server as part of cancel() |
void |
setCancelParamValue(java.lang.String cancelParamValue)
The value of the special field sent to the server as part of cancel() |
void |
setCanFocus(java.lang.Boolean canFocus)
DynamicForms are considered to have focus if any of their form items have focus. Note that setting dynamicForm.canFocus to false will have no effect on
whether form items within the form may recieve focus. |
void |
setCanSubmit(java.lang.Boolean canSubmit)
Governs whether this form will be used to perform a standard HTML form submission. Note that if true, submit() will perform a native HTML submission
to the specified action URL.Wherever possible we strongly recommend using the '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. |
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)
Set the cellSpacing. |
void |
setColWidths(java.lang.Object... colWidths)
|
void |
setDataPageSize(int dataPageSize)
When using data paging, how many records to fetch at a time. |
void |
setDataSource(DataSource dataSource)
The DataSource that this component should bind to for default fields and for performing DSRequest .
|
void |
setDisableValidation(java.lang.Boolean disableValidation)
If set to true, client-side validators will not run on the form when validate() is called. |
void |
setDragDataAction(DragDataAction dragDataAction)
Indicates what to do with data dragged into another DataBoundComponent. |
void |
setDragTrackerStyle(java.lang.String dragTrackerStyle)
CSS Style to apply to the drag tracker when dragging occurs on this component. |
void |
setDropValues(java.util.Map dropValues)
When an item is dropped on this component, and addDropValues is true and both
the source and target widgets are databound, either to the same DataSource or
to different DataSources that are related via a foreign key, this object
provides the "drop values" that SmartGWT will apply to the dropped object
before updating it.
|
void |
setDuplicateDragMessage(java.lang.String duplicateDragMessage)
Message to show when a user attempts to transfer duplicate records into this component, and preventDuplicates is enabled. |
void |
setEditFormulaFieldText(java.lang.String editFormulaFieldText)
Text for a menu item allowing users to edit a formula field |
void |
setEditSummaryFieldText(java.lang.String editSummaryFieldText)
Text for a menu item allowing users to edit the formatter for a field |
void |
setEncoding(Encoding encoding)
encoding for the form, use MULTIPART_ENCODING for file upload forms |
void |
setErrorItemCellStyle(java.lang.String errorItemCellStyle)
If showInlineErrors is false we show all errors for the form item in
a single item rendered at the top of the form.This attribute specifies the cellStyle to apply to this item. |
void |
setErrorOrientation(FormErrorOrientation errorOrientation)
|
void |
setErrors(java.util.Map errors,
boolean showErrors)
Setter for validation errors on this form. |
void |
setErrorsPreamble(java.lang.String errorsPreamble)
If showInlineErrors is false 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(java.lang.Boolean exportAll)
Setting exportAll to true prevents the component from passing it's list of fields to the export call. |
void |
setExportFields(java.lang.String[] exportFields)
The list of field-names to export. |
void |
setFetchOperation(java.lang.String fetchOperation)
Operation ID this component should use when performing fetch operations. |
void |
setFieldErrors(java.lang.String fieldName,
java.lang.String[] errors,
boolean showErrors)
Set field validation errors for some field. |
void |
setFieldErrors(java.lang.String fieldName,
java.lang.String error,
boolean showErrors)
Set field validation error for some field. |
void |
setFields(FormItem... fields)
An array of field objects, specifying the order, layout, and types of each field in the DynamicForm. |
void |
setFixedColWidths(java.lang.Boolean fixedColWidths)
If true, we ensure that column widths are at least as large as you specify them. |
void |
setHiliteProperty(java.lang.String hiliteProperty)
Marker that can be set on a record to flag that record as hilited. |
void |
setHiliteRequiredFields(java.lang.Boolean hiliteRequiredFields)
Indicates whether the titles of required items in this form should use the special prefix and suffix specified by the next two properties, instead of the standard prefix and suffix. |
void |
setInitialCriteria(Criteria initialCriteria)
Criteria to use when DataBoundComponent.setAutoFetchData(Boolean) is used. |
void |
setItemHoverAlign(Alignment itemHoverAlign)
Text alignment for hovers shown for items |
void |
setItemHoverDelay(int itemHoverDelay)
If the user rolls over an item, how long a delay before we fire any hover action / show a hover for that item? |
void |
setItemHoverFormatter(FormItemHoverFormatter hoverFormatter)
The FormItemHoverFormatter should return the HTML to display in a hover canvas when the user holds the mousepointer over this item. |
void |
setItemHoverHeight(java.lang.Integer itemHoverHeight)
A default height for hovers shown for items |
void |
setItemHoverOpacity(java.lang.Integer itemHoverOpacity)
Opacity for hovers shown for items |
void |
setItemHoverStyle(java.lang.String itemHoverStyle)
CSS Style for hovers shown for items |
void |
setItemHoverVAlign(java.lang.Integer itemHoverVAlign)
Vertical text alignment for hovers shown for items |
void |
setItemHoverWidth(java.lang.Integer itemHoverWidth)
A default width for hovers shown for items |
void |
setItemLayout(FormLayoutType itemLayout)
Layout style to use with this form. |
void |
setItems(FormItem... items)
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 |
setLongTextEditorThreshold(int longTextEditorThreshold)
When creating form items for fields with text type data, if the specified length of the field exceeds this threshold we will create form item of type this.longTextEditorType (a TextAreaItem by default), rather than a simple
text item. |
void |
setLongTextEditorType(java.lang.String longTextEditorType)
Name of the Form Item class to use for text fields which exceed the longTextEditorThreshold for this form. |
void |
setMethod(FormMethod method)
The mechanism by which form data is sent to the action URL. |
void |
setMinColWidth(int minColWidth)
Minimum width of a form column. |
void |
setNumCols(int numCols)
The number of columns of titles and items in this form's layout grid. |
void |
setOperator(OperatorId operator)
When operator has been set for any FormItem in this form, what logical operator should be applied across
the ${isc.DocUtils.linkForRef('object:Criterion','criteria')} produced by the form items? Only applicable to
forms that have a dataSource . |
void |
setPreventDuplicates(java.lang.Boolean preventDuplicates)
If set, detect and prevent duplicate records from being transferred to this component, either via drag and drop or via DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent) . |
void |
setRejectInvalidValueOnChange(java.lang.Boolean rejectInvalidValueOnChange)
If validateOnChange is true, and validation fails for an item on change, with no suggested value, should we revert to the previous value, or continue to display the bad value entered by the user. |
void |
setRemoveOperation(java.lang.String removeOperation)
Operation ID this component should use when performing remove operations. |
void |
setRequiredRightTitlePrefix(java.lang.String requiredRightTitlePrefix)
The string prepended to the title of every required item in this form if highlightRequiredFields is true and the titleOrientation property is set to "right". |
void |
setRequiredRightTitleSuffix(java.lang.String requiredRightTitleSuffix)
The string appended to the title of every required item in this form if highlightRequiredFields is true and the titleOrientation property is set to "right". |
void |
setRequiredTitlePrefix(java.lang.String requiredTitlePrefix)
The string prepended to the title of every required item in this form if highlightRequiredFields is true. |
void |
setRequiredTitleSuffix(java.lang.String requiredTitleSuffix)
The string appended to the title of every required item in this form if highlightRequiredFields is true. |
void |
setResizeFrom(java.lang.String... resizeFrom)
|
void |
setRightTitlePrefix(java.lang.String rightTitlePrefix)
The string prepended to the title of an item in this form if its titleOrientation property is set to "right". |
void |
setRightTitleSuffix(java.lang.String rightTitleSuffix)
The string appended to the title of an item in this form if its titleOrientation property is set to "right". |
void |
setSaveOnEnter(java.lang.Boolean saveOnEnter)
If true , when the user hits the Enter key while focussed in a text-item in
this form, we automatically submit the form to the server using the
submit() method. |
void |
setSaveOperationType(DSOperationType saveOperationType)
Default DSOperationType to be performed when saveData() is called.
This property is automatically set on a call to editRecord(com.smartgwt.client.data.Record) or
editNewRecord() , or may be set directly via
setSaveOperationType(com.smartgwt.client.types.DSOperationType) .
|
void |
setSectionVisibilityMode(VisibilityMode sectionVisibilityMode)
If the form has sections, [implemented as SectionItem s], this attribute controls
whether multiple sections can be expanded at once. |
void |
setSelectOnFocus(java.lang.Boolean selectOnFocus)
If this property is set to true, whenever a text-based field in this form ( TextItem , TextAreaItem ) is given focus programmatically
(see focusInItem(int) ), all text within the item will be selected.
|
void |
setShowComplexFields(java.lang.Boolean showComplexFields)
Whether to show fields of non-atomic types when a DataBoundComponent is given a DataSource but no component.fields .
|
void |
setShowComplexFieldsRecursively(java.lang.Boolean showComplexFieldsRecursively)
If set, this DynamicForm will set both
showComplexFields and
showComplexFieldsRecursively on any nested component used for showing/editing
a complex field. |
void |
setShowDetailFields(java.lang.Boolean showDetailFields)
Whether to show fields marked detail:true when a DataBoundComponent is
given a DataSource but no component.fields .
|
void |
setShowErrorIcons(java.lang.Boolean showErrorIcons)
showErrorIcons ,
showErrorText , and
showErrorStyle control how validation errors are
displayed next to form items when showInlineErrors is true.
These properties are boolean values, and can be set on a DynamicForm to control the
behavior form-wide, or set on individual FormItems.
|
void |
setShowErrorStyle(java.lang.Boolean showErrorStyle)
showErrorIcons ,
showErrorText , and
showErrorStyle control how validation errors are
displayed next to form items when showInlineErrors is true.
These properties are boolean values, and can be set on a DynamicForm to control the
behavior form-wide, or set on individual FormItems.
|
void |
setShowErrorText(java.lang.Boolean showErrorText)
showErrorIcons ,
showErrorText , and
showErrorStyle control how validation errors are
displayed next to form items when showInlineErrors is true.
These properties are boolean values, and can be set on a DynamicForm to control the
behavior form-wide, or set on individual FormItems.
|
void |
setShowHiddenFields(java.lang.Boolean showHiddenFields)
Whether to show fields marked hidden:true when a DataBoundComponent is given a
DataSource but no component.fields .
|
void |
setShowInlineErrors(java.lang.Boolean showInlineErrors)
If true, field errors are written into the form next to the item(s) where the errors occurred. |
void |
setShowTitlesWithErrorMessages(java.lang.Boolean showTitlesWithErrorMessages)
Indicates whether on validation failure, the error message displayed to the user should be prepended with the title for the item. |
void |
setTarget(java.lang.String target)
The name of a window or frame that will receive the results returned by the form's action. |
void |
setTitleField(java.lang.String titleField)
|
void |
setTitleOrientation(TitleOrientation titleOrientation)
Default orientation for titles for items in this form. |
void |
setTitlePrefix(java.lang.String titlePrefix)
The string prepended to the title of every item in this form. |
void |
setTitleSuffix(java.lang.String titleSuffix)
The string appended to the title of every item in this form. |
void |
setTitleWidth(int titleWidth)
|
void |
setTitleWidth(java.lang.String titleWidth)
|
void |
setUnknownErrorMessage(java.lang.String unknownErrorMessage)
The error message for a failed validator that does not specify its own errorMessage. |
void |
setUpdateOperation(java.lang.String updateOperation)
Operation ID this component should use when performing update operations. |
void |
setUseAllDataSourceFields(boolean useAllDataSourceFields)
If true, the set of fields given by the "default binding" (see DataBoundComponent.fields) is used, with any fields specified in component.fields acting as overrides that can suppress or modify the display of individual fields, without having to list the entire set of fields that should be shown. |
void |
setUseAllDataSourceFields(java.lang.Boolean useAllDataSourceFields)
If true, the set of fields given by the "default binding" (see fields ) is used, with any fields specified in
component.fields acting as overrides that can suppress or modify the
display of individual fields, without having to list the entire set of fields that
should be shown.
|
void |
setUseFlatFields(java.lang.Boolean useFlatFields)
The useFlatFields flag causes all simple type fields anywhere in a nested
set of DataSources to be exposed as a flat list for form binding. |
void |
setValidateOnChange(java.lang.Boolean validateOnChange)
If true, form fields will be validated when each item's "change" handler is fired as well as when the entire form is submitted or validated. 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 change. |
void |
setValidationURL(java.lang.String validationURL)
validationURL can be set to do server-side validation against a different URL from where the form will ultimately save, as part of an incremental upgrade strategy for Struts and Struts-like applications. |
void |
setValue(java.lang.String fieldName,
boolean value)
Set the value for some field. |
void |
setValue(java.lang.String fieldName,
DataClass value)
Set the value for some field. |
void |
setValue(java.lang.String fieldName,
DataClass[] value)
Set the value for some field. |
void |
setValue(java.lang.String fieldName,
double value)
Set the value for some field. |
void |
setValue(java.lang.String fieldName,
com.google.gwt.core.client.JavaScriptObject value)
Set the value for some field. |
void |
setValue(java.lang.String fieldName,
java.util.Map value)
Set the value for some field. |
void |
setValue(java.lang.String fieldName,
Record value)
Set the value for some field. |
void |
setValue(java.lang.String fieldName,
Record[] value)
Set the value for some field. |
void |
setValue(java.lang.String fieldName,
java.lang.String value)
Sets the value for some field |
void |
setValues(java.util.Map values)
et the values for this DynamicForm. |
void |
setValuesManager(ValuesManager valuesManager)
If set at init time, this dynamicForm will be created as a member form for the specified valuesManager. |
void |
setWrapItemTitles(java.lang.Boolean wrapItemTitles)
Whether titles for form items should wrap. |
void |
showErrors()
If this form has any outstanding validation errors, show them now. This method is called when the set of errors are changed by setErrors(java.util.Map, boolean) or
validate(boolean) . |
void |
showFieldErrors(java.lang.String fieldName)
If this form has any outstanding validation errors for the field passed in, show them now. Called when field errors are set directly via setFieldErrors(java.lang.String, java.lang.String, boolean) /
com.smartgwt.client.widgets.form.DynamicForm#addFieldErrors / clearFieldErrors(java.lang.String, boolean) .Default implementation simply falls through to showErrors() .
|
void |
showItem(java.lang.String itemName)
Show a form item via FormItem.show()
|
void |
submit()
submit() is automatically called when a SubmitItem
included in the form is clicked, or, if saveOnEnter is set, when the "Enter" key is pressed in a text input. |
void |
submit(DSCallback callback)
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. |
java.lang.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. |
java.lang.Boolean |
valuesHaveChanged()
Compares the current set of values with the values stored by the call to the rememberValues() method. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setPixelSize, setSize, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkEvents, 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 |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Constructor Detail |
---|
public DynamicForm()
public DynamicForm(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
public static DynamicForm getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
protected com.google.gwt.core.client.JavaScriptObject create()
create
in class Canvas
public void setSaveOperationType(DSOperationType saveOperationType)
DSOperationType
to be performed when saveData()
is called.
This property is automatically set on a call to editRecord(com.smartgwt.client.data.Record)
or
editNewRecord()
, or may be set directly via
setSaveOperationType(com.smartgwt.client.types.DSOperationType)
.
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.
Setter for the default DSOperationType
when saveData()
is called.
Note that this property can also be set by calling editRecord(com.smartgwt.client.data.Record)
or
editNewRecord()
saveOperationType
- Operation type to use as a default. Valid values are "add"
or "update"
.. Default value is nullpublic DSOperationType getSaveOperationType()
DSOperationType
to be performed when saveData()
is called.
This property is automatically set on a call to editRecord(com.smartgwt.client.data.Record)
or
editNewRecord()
, or may be set directly via
setSaveOperationType(com.smartgwt.client.types.DSOperationType)
.
If saveOperationType
is unset, the form will heuristically determine
whether an "add" or "update" operation is intended based on whether the primaryKey field
is present and editable.
DSOperationType
to be performed when saveData()
is
called. Valid options are "add"
or "update"
.
If a DSRequest
configuration object is passed in containing an explicit operationType
this will be returned. Otherwise saveOperationType
will be returned.
public 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(int)
and FormItem.setTop(int)
can be used for manual reflow.
Note : This is an advanced setting
itemLayout
- itemLayout Default value is "table"public FormLayoutType getItemLayout()
The default of "table" uses a tabular layout similar to HTML tables, but with much more powerful control over sizing, item visibility and reflow, overflow handling, etc.
itemLayout:"absolute"
allows absolute positioning of every form item. This
provides maximum flexibility in placement, with the following limitations:
FormItem.setLeft(int)
and FormItem.setTop(int)
can be used for manual reflow.
public void setNumCols(int numCols)
numCols
- numCols Default value is 2public int getNumCols()
public void setFixedColWidths(java.lang.Boolean fixedColWidths)
If false, columns will have their specified sizes as long as no column overflows. If any column overflows, space will be taken from any other columns that aren't filling the available room, until there is no more free space, in which case the form as a whole overflows.
fixedColWidths
- fixedColWidths Default value is falsepublic java.lang.Boolean getFixedColWidths()
If false, columns will have their specified sizes as long as no column overflows. If any column overflows, space will be taken from any other columns that aren't filling the available room, until there is no more free space, in which case the form as a whole overflows.
public void setMinColWidth(int minColWidth)
minColWidth
- minColWidth Default value is 20public int getMinColWidth()
public void setCellPadding(int cellPadding)
cellPadding
- cellPadding Default value is 2public int getCellPadding()
public void setCellBorder(int cellBorder)
cellBorder
- cellBorder Default value is 0public int getCellBorder()
public void setSectionVisibilityMode(VisibilityMode sectionVisibilityMode)
SectionItem
s], this attribute controls
whether multiple sections can be expanded at once.
sectionVisibilityMode
- sectionVisibilityMode Default value is "multiple"public VisibilityMode getSectionVisibilityMode()
SectionItem
s], this attribute controls
whether multiple sections can be expanded at once.
public void setLongTextEditorThreshold(int longTextEditorThreshold)
this.longTextEditorType
(a TextAreaItem by default), rather than a simple
text item. Overridden by explicitly specifying editorType
for the field.
longTextEditorThreshold
- longTextEditorThreshold Default value is 255public int getLongTextEditorThreshold()
this.longTextEditorType
(a TextAreaItem by default), rather than a simple
text item. Overridden by explicitly specifying editorType
for the field.
public void setLongTextEditorType(java.lang.String longTextEditorType)
longTextEditorType
- longTextEditorType Default value is "textArea"public java.lang.String getLongTextEditorType()
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.
titleOrientation
- titleOrientation Default value is "left"public 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.
public void setTitlePrefix(java.lang.String titlePrefix)
titlePrefix
- titlePrefix Default value is ""public java.lang.String getTitlePrefix()
public void setRightTitlePrefix(java.lang.String rightTitlePrefix)
rightTitlePrefix
- rightTitlePrefix Default value is ": "public java.lang.String getRightTitlePrefix()
public void setTitleSuffix(java.lang.String titleSuffix)
titleSuffix
- titleSuffix Default value is " :"public java.lang.String getTitleSuffix()
public void setRightTitleSuffix(java.lang.String rightTitleSuffix)
rightTitleSuffix
- rightTitleSuffix Default value is ""public java.lang.String getRightTitleSuffix()
public void setWrapItemTitles(java.lang.Boolean wrapItemTitles)
wrapTitle
wrapItemTitles
- wrapItemTitles Default value is nullpublic java.lang.Boolean getWrapItemTitles()
wrapTitle
public void setShowInlineErrors(java.lang.Boolean showInlineErrors)
showErrorText
:false}.
If false, errors are written at the top of the form.
To do some other kind of error display, override showErrors()
.
showInlineErrors
- showInlineErrors Default value is truepublic java.lang.Boolean getShowInlineErrors()
showErrorText
:false}.
If false, errors are written at the top of the form.
To do some other kind of error display, override showErrors()
.
public void setShowErrorIcons(java.lang.Boolean showErrorIcons)
showErrorIcons
,
showErrorText
, and
showErrorStyle
control how validation errors are
displayed next to form items when showInlineErrors
is true.
These properties are boolean values, 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
com.smartgwt.client.widgets.form.fields.FormItem#getErrorHTML
.
The default implemenation 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 com.smartgwt.client..FormItemBaseStyle
for a
discussion for how error styling is calculated.
showErrorIcons
- showErrorIcons Default value is truepublic java.lang.Boolean getShowErrorIcons()
showErrorIcons
,
showErrorText
, and
showErrorStyle
control how validation errors are
displayed next to form items when showInlineErrors
is true.
These properties are boolean values, 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
com.smartgwt.client.widgets.form.fields.FormItem#getErrorHTML
.
The default implemenation 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 com.smartgwt.client..FormItemBaseStyle
for a
discussion for how error styling is calculated.
public void setShowErrorText(java.lang.Boolean showErrorText)
showErrorIcons
,
showErrorText
, and
showErrorStyle
control how validation errors are
displayed next to form items when showInlineErrors
is true.
These properties are boolean values, 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
com.smartgwt.client.widgets.form.fields.FormItem#getErrorHTML
.
The default implemenation 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 com.smartgwt.client..FormItemBaseStyle
for a
discussion for how error styling is calculated.
showErrorText
- showErrorText Default value is falsepublic java.lang.Boolean getShowErrorText()
showErrorIcons
,
showErrorText
, and
showErrorStyle
control how validation errors are
displayed next to form items when showInlineErrors
is true.
These properties are boolean values, 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
com.smartgwt.client.widgets.form.fields.FormItem#getErrorHTML
.
The default implemenation 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 com.smartgwt.client..FormItemBaseStyle
for a
discussion for how error styling is calculated.
public void setShowErrorStyle(java.lang.Boolean showErrorStyle)
showErrorIcons
,
showErrorText
, and
showErrorStyle
control how validation errors are
displayed next to form items when showInlineErrors
is true.
These properties are boolean values, 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
com.smartgwt.client.widgets.form.fields.FormItem#getErrorHTML
.
The default implemenation 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 com.smartgwt.client..FormItemBaseStyle
for a
discussion for how error styling is calculated.
showErrorStyle
- showErrorStyle Default value is truepublic java.lang.Boolean getShowErrorStyle()
showErrorIcons
,
showErrorText
, and
showErrorStyle
control how validation errors are
displayed next to form items when showInlineErrors
is true.
These properties are boolean values, 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
com.smartgwt.client.widgets.form.fields.FormItem#getErrorHTML
.
The default implemenation 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 com.smartgwt.client..FormItemBaseStyle
for a
discussion for how error styling is calculated.
public void setErrorItemCellStyle(java.lang.String errorItemCellStyle) throws java.lang.IllegalStateException
showInlineErrors
is false we show all errors for the form item in
a single item rendered at the top of the form.
errorItemCellStyle
- errorItemCellStyle Default value is "formCellError"
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getErrorItemCellStyle()
showInlineErrors
is false we show all errors for the form item in
a single item rendered at the top of the form.
public void setErrorsPreamble(java.lang.String errorsPreamble) throws java.lang.IllegalStateException
showInlineErrors
is false we show all errors for the form item in
a single item rendered at the top of the form.
errorsPreamble
- errorsPreamble Default value is "The following errors were found"
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getErrorsPreamble()
showInlineErrors
is false we show all errors for the form item in
a single item rendered at the top of the form.
public void setShowTitlesWithErrorMessages(java.lang.Boolean showTitlesWithErrorMessages)
showTitlesWithErrorMessages
- showTitlesWithErrorMessages Default value is falsepublic java.lang.Boolean getShowTitlesWithErrorMessages()
public void setHiliteRequiredFields(java.lang.Boolean hiliteRequiredFields)
hiliteRequiredFields
- hiliteRequiredFields Default value is truepublic java.lang.Boolean getHiliteRequiredFields()
public void setRequiredTitlePrefix(java.lang.String requiredTitlePrefix)
requiredTitlePrefix
- requiredTitlePrefix Default value is ""public java.lang.String getRequiredTitlePrefix()
public void setRequiredRightTitlePrefix(java.lang.String requiredRightTitlePrefix)
requiredRightTitlePrefix
- requiredRightTitlePrefix Default value is ": "public java.lang.String getRequiredRightTitlePrefix()
public void setRequiredTitleSuffix(java.lang.String requiredTitleSuffix)
requiredTitleSuffix
- requiredTitleSuffix Default value is " :"public java.lang.String getRequiredTitleSuffix()
public void setRequiredRightTitleSuffix(java.lang.String requiredRightTitleSuffix)
requiredRightTitleSuffix
- requiredRightTitleSuffix Default value is ""public java.lang.String getRequiredRightTitleSuffix()
public void setItemHoverDelay(int itemHoverDelay)
itemHoverDelay
- itemHoverDelay Default value is 500public int getItemHoverDelay()
public void setItemHoverWidth(java.lang.Integer itemHoverWidth)
itemHoverWidth
- itemHoverWidth Default value is nullpublic java.lang.Integer getItemHoverWidth()
public void setItemHoverHeight(java.lang.Integer itemHoverHeight)
itemHoverHeight
- itemHoverHeight Default value is nullpublic java.lang.Integer getItemHoverHeight()
public void setItemHoverAlign(Alignment itemHoverAlign)
itemHoverAlign
- itemHoverAlign Default value is nullpublic Alignment getItemHoverAlign()
public void setItemHoverVAlign(java.lang.Integer itemHoverVAlign)
itemHoverVAlign
- itemHoverVAlign Default value is nullpublic java.lang.Integer getItemHoverVAlign()
public void setItemHoverStyle(java.lang.String itemHoverStyle)
itemHoverStyle
- itemHoverStyle Default value is "formHover"public java.lang.String getItemHoverStyle()
public void setItemHoverOpacity(java.lang.Integer itemHoverOpacity)
itemHoverOpacity
- itemHoverOpacity Default value is nullpublic java.lang.Integer getItemHoverOpacity()
public void setValidateOnChange(java.lang.Boolean validateOnChange)
validateOnChange
- validateOnChange Default value is falsepublic java.lang.Boolean getValidateOnChange()
public void setRejectInvalidValueOnChange(java.lang.Boolean rejectInvalidValueOnChange)
Note : This is an advanced setting
rejectInvalidValueOnChange
- rejectInvalidValueOnChange Default value is nullpublic java.lang.Boolean getRejectInvalidValueOnChange()
public void setUnknownErrorMessage(java.lang.String unknownErrorMessage)
unknownErrorMessage
- unknownErrorMessage Default value is "Invalid value"public java.lang.String getUnknownErrorMessage()
public void setAutoFocus(java.lang.Boolean autoFocus)
dynamicForm.focusInItem(itemName)
autoFocus
- autoFocus Default value is falsepublic java.lang.Boolean getAutoFocus()
dynamicForm.focusInItem(itemName)
public void setSelectOnFocus(java.lang.Boolean selectOnFocus)
TextItem
, TextAreaItem
) is given focus programmatically
(see focusInItem(int)
), 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
SmartGWT preserves these behaviors. selectOnFocus
if 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 falsepublic java.lang.Boolean getSelectOnFocus()
TextItem
, TextAreaItem
) is given focus programmatically
(see focusInItem(int)
), 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
SmartGWT preserves these behaviors. selectOnFocus
if 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
.
public void setCanFocus(java.lang.Boolean canFocus)
dynamicForm.canFocus
to false will have no effect on
whether form items within the form may recieve focus. This property will only govern
whether the form may recieve focus if the form contains no focusable items.
Note : This is an advanced setting
setCanFocus
in class Canvas
canFocus
- canFocus Default value is truepublic java.lang.Boolean getCanFocus()
dynamicForm.canFocus
to false will have no effect on
whether form items within the form may recieve focus. This property will only govern
whether the form may recieve focus if the form contains no focusable items.
getCanFocus
in class Canvas
public void setValidationURL(java.lang.String validationURL)
If set, calling submit()
causes an RPC to be sent to this URL to
perform server-side validation of the form values. If the validation fails, the
validation errors returned by the server are rendered in the form. If the validation
succeeds, the form is submitted to the URL specified by action
.
The form values are available on the server as request parameters (just like a normal form submit) and also as the values of a DSRequest sent as an RPC alongside the normal submit.
The expected response to this request is a DSResponse sent via the RPC mechanism. If validation is successful, an empty response with the STATUS_SUCCESS status code is sufficient. If there are validation errors, the DSResponse should have the status set to STATUS_VALIDATION_ERROR and the errors should be set on the response via the addError()/setErrorReport() API on DSResponse. See the javadoc for DSResponse for details.
See the Struts examples in [webroot]/examples/struts
for usage examples.
validationURL
- validationURL Default value is nullpublic java.lang.String getValidationURL()
If set, calling submit()
causes an RPC to be sent to this URL to
perform server-side validation of the form values. If the validation fails, the
validation errors returned by the server are rendered in the form. If the validation
succeeds, the form is submitted to the URL specified by action
.
The form values are available on the server as request parameters (just like a normal form submit) and also as the values of a DSRequest sent as an RPC alongside the normal submit.
The expected response to this request is a DSResponse sent via the RPC mechanism. If validation is successful, an empty response with the STATUS_SUCCESS status code is sufficient. If there are validation errors, the DSResponse should have the status set to STATUS_VALIDATION_ERROR and the errors should be set on the response via the addError()/setErrorReport() API on DSResponse. See the javadoc for DSResponse for details.
See the Struts examples in [webroot]/examples/struts
for usage examples.
public void setDisableValidation(java.lang.Boolean disableValidation)
disableValidation
- disableValidation Default value is nullpublic java.lang.Boolean getDisableValidation()
public void setCancelParamName(java.lang.String cancelParamName)
cancel()
cancelParamName
- cancelParamName Default value is "org.apache.struts.taglib.html.CANCEL"public java.lang.String getCancelParamName()
cancel()
public void setCancelParamValue(java.lang.String cancelParamValue)
cancel()
cancelParamValue
- cancelParamValue Default value is "cancel"public java.lang.String getCancelParamValue()
cancel()
public void setAction(java.lang.String action)
NOTE: this is used only in the very rare case that a form is used to submit data
directly to a URL. Normal server contact is through RPCManager.
See canSubmit
for more on this.
Sets the action
for this form.
action
- New action URL. Default value is "#"public java.lang.String getAction()
NOTE: this is used only in the very rare case that a form is used to submit data
directly to a URL. Normal server contact is through RPCManager.
See canSubmit
for more on this.
public void setTarget(java.lang.String target)
NOTE: this is used only in the very rare case that a form is used to submit data
directly to a URL. Normal server contact is through
'DataBound Component Methods'
.
Note : This is an advanced setting
target
- target Default value is nullpublic java.lang.String getTarget()
NOTE: this is used only in the very rare case that a form is used to submit data
directly to a URL. Normal server contact is through
'DataBound Component Methods'
.
public void setMethod(FormMethod method)
NOTE: this is used only in the very rare case that a form is used to submit data
directly to a URL. Normal server contact is through
'DataBound Component Methods'
.
method
- method Default value is DynamicForm.POSTpublic 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'
.
public void setEncoding(Encoding encoding)
Note : This is an advanced setting
encoding
- encoding Default value is DynamicForm.NORMALpublic Encoding getEncoding()
public void setCanSubmit(java.lang.Boolean canSubmit)
submit()
will perform a native HTML submission
to the specified action
URL.'DataBound Component Methods'
to send data to
the server as they provide a far more sophisticated interface, with built in
options for server validation, required fields, etc.Note : This is an advanced setting
canSubmit
- canSubmit Default value is falsepublic java.lang.Boolean getCanSubmit()
submit()
will perform a native HTML submission
to the specified action
URL.'DataBound Component Methods'
to send data to
the server as they provide a far more sophisticated interface, with built in
options for server validation, required fields, etc.
public void setSaveOnEnter(java.lang.Boolean saveOnEnter)
true
, when the user hits the Enter key while focussed in a text-item in
this form, we automatically submit the form to the server using the
submit()
method.
saveOnEnter
- saveOnEnter Default value is falsepublic java.lang.Boolean getSaveOnEnter()
true
, when the user hits the Enter key while focussed in a text-item in
this form, we automatically submit the form to the server using the
submit()
method.
public void setShowComplexFieldsRecursively(java.lang.Boolean showComplexFieldsRecursively) throws java.lang.IllegalStateException
DynamicForm
will set both
showComplexFields
and
showComplexFieldsRecursively
on any nested component used for showing/editing
a complex field. Thus any of this form's items that handle complex fields will themselves
also show complex fields. This allows for handling of field structures of any complexity.
If set, this value automatically sets showComplexFields
as well.
showComplexFieldsRecursively
- showComplexFieldsRecursively Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getShowComplexFieldsRecursively()
DynamicForm
will set both
showComplexFields
and
showComplexFieldsRecursively
on any nested component used for showing/editing
a complex field. Thus any of this form's items that handle complex fields will themselves
also show complex fields. This allows for handling of field structures of any complexity.
If set, this value automatically sets showComplexFields
as well.
public void validateData()
public void reset()
setValues()
or
rememberValues()
was called. If neither of those methods has been called,
values will be set back to their inital values at init time.
public void cancel()
cancelParamName
with the value
cancelParamValue
.Note that no other form data is sent. By default the current top-level page is replaced with the reply. If you wish to ignore the server reply instead, call this method like this:
dynamicFormInstance.cancel({ignoreTimeout: true, target: null});
public void cancel(DSRequest requestProperties)
cancelParamName
with the value
cancelParamValue
.Note that no other form data is sent. By default the current top-level page is replaced with the reply. If you wish to ignore the server reply instead, call this method like this:
dynamicFormInstance.cancel({ignoreTimeout: true, target: null});
requestProperties
- additional properties to set on the RPCRequest that will be issuedpublic java.lang.Boolean isNewRecord()
saveOperationType
is currently "add". See
saveOperationType
.
public void resetValues()
reset()
.
public void clearValues()
public java.lang.Boolean valuesHaveChanged()
rememberValues()
method. Returns true if the values have changed, and false
otherwise.
public void setValue(java.lang.String fieldName, java.lang.String value)
fieldName
- Name of the field being updatedvalue
- New value.public void clearValue(java.lang.String fieldName)
com.smartgwt.client.widgets.form.fields.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 clearedpublic void showItem(java.lang.String itemName)
FormItem.show()
itemName
- Name of the item to showpublic void hideItem(java.lang.String itemName)
FormItem.hide()
itemName
- Name of the item to showpublic void clearFieldErrors(java.lang.String fieldName, boolean show)
fieldName
- field to clear errors fromshow
- If true this method will fall through to showFieldErrors(java.lang.String)
to update the displaypublic void clearErrors(boolean show)
show
- If true, redraw the form to clear any visible error messages.public java.lang.Boolean hasErrors()
setErrors(java.util.Map, boolean)
or setFieldErrors(java.lang.String, java.lang.String, boolean)
.
public java.lang.Boolean hasFieldErrors(java.lang.String fieldName)
setErrors(java.util.Map, boolean)
or setFieldErrors(java.lang.String, java.lang.String, boolean)
.
fieldName
- field to test for validation errors
public void submitForm()
action
,
identically to how a plain HTML <form> element would submit data,
as either an HTTP GET or POST as specified by method
.
Notes:
'DataBound Component Methods'
.canSubmit
must be set to true
HiddenItem
with a defaultValue
set. This is analagous to <input type="hidden">
in HTML forms.
public java.lang.Boolean validate(boolean validateHiddenFields)
com.smartgwt.client.widgets.form.DynamicForm#handleHiddenValidationErrors
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 showFieldErrors(java.lang.String fieldName)
setFieldErrors(java.lang.String, java.lang.String, boolean)
/
com.smartgwt.client.widgets.form.DynamicForm#addFieldErrors
/ clearFieldErrors(java.lang.String, boolean)
.showErrors()
.
fieldName
- field to show errors forpublic HandlerRegistration addItemChangedHandler(ItemChangedHandler handler)
Handler fired when there is a changed() event fired on a FormItem within this form.
Fires after the change() handler on the FormItem itself, and only if the item did not cancel the change event and chooses to allow it to propagate to the form as a whole.
addItemChangedHandler
in interface HasItemChangedHandlers
handler
- the itemChanged handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addItemChangeHandler(ItemChangeHandler handler)
Handler fired when there is a change() event fired on a FormItem within this form.
Fires after the change() handler on the FormItem itself, and only if the item did not cancel the change event and chooses to allow it to propagate to the form as a whole.
addItemChangeHandler
in interface HasItemChangeHandlers
handler
- the itemChange 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 HasItemKeyPressHandlers
handler
- the itemKeyPress handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addSubmitValuesHandler(SubmitValuesHandler handler)
Triggered when a SubmitItem is included in the form is submitted and gets pressed.
addSubmitValuesHandler
in interface HasSubmitValuesHandlers
handler
- the submitValues handler
HandlerRegistration
used to remove this handlerprotected void onInit()
onInit
in class BaseWidget
public void showErrors()
setErrors(java.util.Map, boolean)
or
validate(boolean)
.
com.smartgwt.client.widgets.form.DynamicForm#handleHiddenValidationErrors
to
display errors with no visible field.
Note: This is an override point. This method may be overridden to perform custom display of validation errors.
public void setValuesManager(ValuesManager valuesManager) throws java.lang.IllegalStateException
valuesManager.addMember(form)
and
valuesManager.removeMember(form)
Note : This is an advanced setting
valuesManager
- valuesManager Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic ValuesManager getValuesManager()
public void setCellSpacing(int cellSpacing) throws java.lang.IllegalStateException
cellSpacing
- the cellSpacing
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic int getCellSpacing()
public void setUseAllDataSourceFields(boolean useAllDataSourceFields)
useAllDataSourceFields
- useAllDataSourceFieldspublic void setValues(java.util.Map values)
values
- the valuespublic java.util.Map getValues()
public void setValue(java.lang.String fieldName, double value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, boolean value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, java.util.Map value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, com.google.gwt.core.client.JavaScriptObject value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, Record value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, DataClass value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, Record[] value)
fieldName
- Name of the field being updatedvalue
- New value.public void setValue(java.lang.String fieldName, DataClass[] value)
fieldName
- Name of the field being updatedvalue
- New value.public void setItems(FormItem... items)
setFields(com.smartgwt.client.widgets.form.fields.FormItem[])
.
items
- the itemspublic void setOperator(OperatorId operator) throws java.lang.IllegalStateException
operator
has been set for any FormItem
in this form, what logical operator should be applied across
the ${isc.DocUtils.linkForRef('object:Criterion','criteria')} produced by the form items? Only applicable to
forms that have a dataSource
.
operator
- operator Default value is "and"
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic OperatorId getOperator()
operator
has been set for any FormItem
in this form, what logical operator should be applied across
the ${isc.DocUtils.linkForRef('object:Criterion','criteria')} produced by the form items? Only applicable to
forms that have a dataSource
.
public void setFields(FormItem... fields)
fields
and dataSource
are set, fields
acts as a set
of overrides as explained in DataBoundComponent fields.
See Form Layout for information about how flags specified on the FormItems control how the form is laid out.
fields
- form item fieldspublic FormItem[] getFields()
public FormItem getItem(java.lang.String name)
public FormItem getField(java.lang.String name)
public java.lang.String getValueAsString(java.lang.String fieldName)
public java.lang.Object getValue(java.lang.String fieldName)
public boolean validate()
com.smartgwt.client.widgets.form.DynamicForm#handleHiddenValidationErrors
public void editNewRecord()
public void editNewRecord(java.util.Map initialValues)
initialValues
- initial set of values for the editor as a map of field names to their corresponding valuespublic void editSelectedData(ListGrid selectionComponent)
public void editSelectedData(java.lang.String listGridID)
public Criteria getValuesAsCriteria()
public void setColWidths(java.lang.Object... colWidths)
public void setResizeFrom(java.lang.String... resizeFrom)
setResizeFrom
in class Canvas
public void setTitleWidth(int titleWidth)
public void setTitleWidth(java.lang.String titleWidth)
public void setErrorOrientation(FormErrorOrientation errorOrientation)
public 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 SmartGWT 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 SmartGWT 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 SmartGWT 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 SmartGWT framework code does not pass them.
callback
- callback to invoke on completion. [Ignored if
this.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 SmartGWT 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 SmartGWT 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(java.lang.String itemName)
itemName
- the item namepublic void focusInItem(FormItem formItem)
formItem
- the form itempublic void setErrors(java.util.Map errors, boolean showErrors)
errors
- list of errors as a map with the field names as keysshowErrors
- If true redraw form to display errors now. Otherwise errors can be displayed by calling
showErrors()
Note: When the errors are shown, handleHiddenValidationErrors() will be fired for errors
on hidden fields, or with no associated formItem.public java.util.Map getErrors()
public void setFieldErrors(java.lang.String fieldName, java.lang.String error, boolean showErrors)
showFieldErrors(java.lang.String)
will display the errors for this field.
fieldName
- field to apply the new errors toerror
- error to apply to the field in questionshowErrors
- If true this method will fall through to DynamicForm.showFieldErrors() to update the displaypublic void setFieldErrors(java.lang.String fieldName, java.lang.String[] errors, boolean showErrors)
showFieldErrors(java.lang.String)
will display the errors for this field.
fieldName
- field to apply the new errors toerrors
- errors to apply to the field in questionshowErrors
- If true this method will fall through to DynamicForm.showFieldErrors() to update the displaypublic java.lang.String[] getFieldErrors(java.lang.String fieldName)
fieldName
- the field name
public com.google.gwt.core.client.JavaScriptObject rememberValues()
public void setItemHoverFormatter(FormItemHoverFormatter hoverFormatter)
hoverFormatter
- the hover formatterpublic void setItemTitleHoverFormatter(FormItemHoverFormatter hoverFormatter)
hoverFormatter
- the hover formatterpublic void setDataPageSize(int dataPageSize)
DataBoundComponent
com.smartgwt.client.data.ResultSet
object for this
component. In effect, this gives you control over the resultSize
attribute for this component.
Note that regardless of the dataPageSize
setting, a component will always fetch
all of data that it needs to draw. Settings such as
showAllRecords
,
drawAllMaxCells
and
drawAheadRatio
can cause more rows than the configured
dataPageSize
to be fetched.
setDataPageSize
in interface DataBoundComponent
dataPageSize
- dataPageSize Default value is 75public int getDataPageSize()
DataBoundComponent
com.smartgwt.client.data.ResultSet
object for this
component. In effect, this gives you control over the resultSize
attribute for this component.
Note that regardless of the dataPageSize
setting, a component will always fetch
all of data that it needs to draw. Settings such as
showAllRecords
,
drawAllMaxCells
and
drawAheadRatio
can cause more rows than the configured
dataPageSize
to be fetched.
getDataPageSize
in interface DataBoundComponent
public void setUseAllDataSourceFields(java.lang.Boolean useAllDataSourceFields)
DataBoundComponent
fields
) is used, with any fields specified in
component.fields
acting as overrides that can suppress or modify the
display of individual fields, without having to list the entire set of fields that
should be shown.
If component.fields
contains fields that are not found in the DataSource,
they will be shown after the most recently referred to DataSource field. If the new
fields appear first, they will be shown first.
${isc.DocUtils.linkForExampleId('validationFieldBinding', 'This example')} shows a mixture of component fields and DataSource fields, and how they interact for validation.
setUseAllDataSourceFields
in interface DataBoundComponent
useAllDataSourceFields
- useAllDataSourceFields Default value is falsepublic java.lang.Boolean getUseAllDataSourceFields()
DataBoundComponent
fields
) is used, with any fields specified in
component.fields
acting as overrides that can suppress or modify the
display of individual fields, without having to list the entire set of fields that
should be shown.
If component.fields
contains fields that are not found in the DataSource,
they will be shown after the most recently referred to DataSource field. If the new
fields appear first, they will be shown first.
${isc.DocUtils.linkForExampleId('validationFieldBinding', 'This example')} shows a mixture of component fields and DataSource fields, and how they interact for validation.
getUseAllDataSourceFields
in interface DataBoundComponent
public void setShowHiddenFields(java.lang.Boolean showHiddenFields)
DataBoundComponent
hidden:true
when a DataBoundComponent is given a
DataSource but no component.fields
.
The hidden
property is used on DataSource fields to mark fields that are
never of meaning to an end user.
setShowHiddenFields
in interface DataBoundComponent
showHiddenFields
- showHiddenFields Default value is falsepublic java.lang.Boolean getShowHiddenFields()
DataBoundComponent
hidden:true
when a DataBoundComponent is given a
DataSource but no component.fields
.
The hidden
property is used on DataSource fields to mark fields that are
never of meaning to an end user.
getShowHiddenFields
in interface DataBoundComponent
public void setShowDetailFields(java.lang.Boolean showDetailFields)
DataBoundComponent
detail:true
when a DataBoundComponent is
given a DataSource but no component.fields
.
The detail
property is used on DataSource fields to mark fields that
shouldn't appear by default in a view that tries to show many records in a small space.
setShowDetailFields
in interface DataBoundComponent
showDetailFields
- showDetailFields Default value is falsepublic java.lang.Boolean getShowDetailFields()
DataBoundComponent
detail:true
when a DataBoundComponent is
given a DataSource but no component.fields
.
The detail
property is used on DataSource fields to mark fields that
shouldn't appear by default in a view that tries to show many records in a small space.
getShowDetailFields
in interface DataBoundComponent
public void setShowComplexFields(java.lang.Boolean showComplexFields)
DataBoundComponent
component.fields
.
If true, the component will show fields that declare a complex type, for example, a field 'shippingAddress' that declares type 'Address', where 'Address' is the ID of a DataSource that declares the fields of a shipping address (city, street name, etc).
Such fields may need custom formatters or editors in order to create a usable interface, for example, an Address field in a ListGrid might use a custom formatter to combine the relevant fields of an address into one column, and might use a pop-up dialog for editing.
Note : This is an advanced setting
setShowComplexFields
in interface DataBoundComponent
showComplexFields
- showComplexFields Default value is truepublic java.lang.Boolean getShowComplexFields()
DataBoundComponent
component.fields
.
If true, the component will show fields that declare a complex type, for example, a field 'shippingAddress' that declares type 'Address', where 'Address' is the ID of a DataSource that declares the fields of a shipping address (city, street name, etc).
Such fields may need custom formatters or editors in order to create a usable interface, for example, an Address field in a ListGrid might use a custom formatter to combine the relevant fields of an address into one column, and might use a pop-up dialog for editing.
getShowComplexFields
in interface DataBoundComponent
public void setFetchOperation(java.lang.String fetchOperation)
DataBoundComponent
setFetchOperation
in interface DataBoundComponent
fetchOperation
- fetchOperation Default value is nullpublic java.lang.String getFetchOperation()
DataBoundComponent
getFetchOperation
in interface DataBoundComponent
public void setUpdateOperation(java.lang.String updateOperation)
DataBoundComponent
setUpdateOperation
in interface DataBoundComponent
updateOperation
- updateOperation Default value is nullpublic java.lang.String getUpdateOperation()
DataBoundComponent
getUpdateOperation
in interface DataBoundComponent
public void setAddOperation(java.lang.String addOperation)
DataBoundComponent
setAddOperation
in interface DataBoundComponent
addOperation
- addOperation Default value is nullpublic java.lang.String getAddOperation()
DataBoundComponent
getAddOperation
in interface DataBoundComponent
public void setRemoveOperation(java.lang.String removeOperation)
DataBoundComponent
setRemoveOperation
in interface DataBoundComponent
removeOperation
- removeOperation Default value is nullpublic java.lang.String getRemoveOperation()
DataBoundComponent
getRemoveOperation
in interface DataBoundComponent
public void setExportFields(java.lang.String[] exportFields)
DataBoundComponent
If exportFields is not provided, the exported output includes all visible fields from this component, sorted as they appear.
setExportFields
in interface DataBoundComponent
exportFields
- exportFields Default value is nullpublic java.lang.String[] getExportFields()
DataBoundComponent
If exportFields is not provided, the exported output includes all visible fields from this component, sorted as they appear.
getExportFields
in interface DataBoundComponent
public void setExportAll(java.lang.Boolean exportAll)
DataBoundComponent
fields
.
If exportAll is false, an export operation will first consider
exportFields
, if it's set, and fall back on all visible fields from
fields
otherwise.
setExportAll
in interface DataBoundComponent
exportAll
- exportAll Default value is falsepublic java.lang.Boolean getExportAll()
DataBoundComponent
fields
.
If exportAll is false, an export operation will first consider
exportFields
, if it's set, and fall back on all visible fields from
fields
otherwise.
getExportAll
in interface DataBoundComponent
public void setPreventDuplicates(java.lang.Boolean preventDuplicates) throws java.lang.IllegalStateException
DataBoundComponent
DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent)
. When a duplicate transfer is detected,
a dialog will appear showing the duplicateDragMessage
.
If the component either does not have a DataSource
or has a DataSource with no
primaryKey
declared, duplicate checking is off by
default. If duplicate checking is enabled, it looks for an existing record in the dataset
that has all of the properties of the dragged record, and considers that a duplicate.
For DragDataAction
:"copy" where the target DataSource is related to the source
DataSource by foreignKey, a duplicate means that the target list, as filtered by the current
criteria, already has a record whose value for the foreignKey field matches the
primaryKey of the record being transferred.
For example, consider dragging "employees" to "teams", where "teams" has a field "teams.employeeId" which is a foreignKey pointing to "employees.id", and the target grid has search criteria causing it to show all the members of one team. A duplicate - adding an employee to the same team twice - is when the target grid's dataset contains an record with "employeeId" matching the "id" field of the dropped employee.
setPreventDuplicates
in interface DataBoundComponent
preventDuplicates
- preventDuplicates Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getPreventDuplicates()
DataBoundComponent
DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent)
. When a duplicate transfer is detected,
a dialog will appear showing the duplicateDragMessage
.
If the component either does not have a DataSource
or has a DataSource with no
primaryKey
declared, duplicate checking is off by
default. If duplicate checking is enabled, it looks for an existing record in the dataset
that has all of the properties of the dragged record, and considers that a duplicate.
For DragDataAction
:"copy" where the target DataSource is related to the source
DataSource by foreignKey, a duplicate means that the target list, as filtered by the current
criteria, already has a record whose value for the foreignKey field matches the
primaryKey of the record being transferred.
For example, consider dragging "employees" to "teams", where "teams" has a field "teams.employeeId" which is a foreignKey pointing to "employees.id", and the target grid has search criteria causing it to show all the members of one team. A duplicate - adding an employee to the same team twice - is when the target grid's dataset contains an record with "employeeId" matching the "id" field of the dropped employee.
getPreventDuplicates
in interface DataBoundComponent
public void setDuplicateDragMessage(java.lang.String duplicateDragMessage) throws java.lang.IllegalStateException
DataBoundComponent
preventDuplicates
is enabled.
setDuplicateDragMessage
in interface DataBoundComponent
duplicateDragMessage
- duplicateDragMessage Default value is "Duplicates not allowed"
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getDuplicateDragMessage()
DataBoundComponent
preventDuplicates
is enabled.
getDuplicateDragMessage
in interface DataBoundComponent
public void setAddDropValues(java.lang.Boolean addDropValues)
DataBoundComponent
If this value is true and this component is databound, DataBoundComponent.getDropValues()
will
be called for every databound item dropped on this grid, and an update performed
on the item
setAddDropValues
in interface DataBoundComponent
addDropValues
- addDropValues Default value is truepublic java.lang.Boolean getAddDropValues()
DataBoundComponent
If this value is true and this component is databound, DataBoundComponent.getDropValues()
will
be called for every databound item dropped on this grid, and an update performed
on the item
getAddDropValues
in interface DataBoundComponent
public void setDropValues(java.util.Map dropValues)
DataBoundComponent
addDropValues
is true and both
the source and target widgets are databound, either to the same DataSource or
to different DataSources that are related via a foreign key, this object
provides the "drop values" that SmartGWT will apply to the dropped object
before updating it.
If this property is not defined, SmartGWT defaults to returning the selection criteria currently in place for this component. Thus, any databound items (for example, rows from other grids bound to the same DataSource) dropped on the grid will, by default, be subjected to an update that makes them conform to the grid's current filter criteria.
Note : This is an advanced setting
setDropValues
in interface DataBoundComponent
dropValues
- dropValues Default value is nullpublic java.util.Map getDropValues()
DataBoundComponent
addDropValues
is true and both
the source and target widgets are databound, either to the same DataSource or
to different DataSources that are related via a foreign key, this object
provides the "drop values" that SmartGWT will apply to the dropped object
before updating it.
If this property is not defined, SmartGWT 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.
getDropValues
in interface DataBoundComponent
dropValues
for more details. If multiple records
are being dropped, this method is called for each of them in turn.
This method returns the following:
addDropValues
is falseYou can override this method if you need more complex setting of drop values than can be provided by simply supplying a dropValues object.
public void setUseFlatFields(java.lang.Boolean useFlatFields) throws java.lang.IllegalStateException
DataBoundComponent
useFlatFields
flag causes all simple type fields anywhere in a nested
set of DataSources to be exposed as a flat list for form binding.
useFlatFields
is typically used with imported metadata, such as
XMLTools.loadXMLSchema(java.lang.String, com.smartgwt.client.data.XSDLoadCallback)
from a
XMLTools.loadWSDL(java.lang.String, com.smartgwt.client.data.WSDLLoadCallback)
, as a means of eliminating levels of XML
nesting that aren't meaningful in a user interface, without the cumbersome and fragile
process of mapping form fields to XML structures.
For example, having called WebService.getInputDS(java.lang.String)
to retrieve the input message
schema for a web service operation whose input message looks like this:
<FindServices> <searchFor>search text</searchFor> <Options> <caseSensitive>false</caseSensitive> </Options> <IncludeInSearch> <serviceName>true</serviceName> <documentation>true</documentation> <keywords>true</keywords> </IncludeInSearch> </FindServices>Setting
useFlatFields
on a DynamicForm
that is bound to this input
message schema would result in 5 FormItem
reflecting the 5 simple type
fields in the message.
For this form, the result of getValues()
might look
like:
{ searchFor: "search text", caseSensitive: false, serviceName: true, documentation : true, keywords : true }When contacting a
WebService
, these values can be automatically
mapped to the structure of the input message for a web service operation by setting
useFlatFields
(for use with WebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback)
) or by setting
useFlatFields
(for use with a DataSource
that is
'bound to a WSDL web service'
via
wsOperation
).
Using these two facilities in conjunction (component.useFlatFields and request.useFlatFields) allows gratuitous nesting to be consistently bypassed in both the user presentation and when providing the data for XML messages.
You can also set useFlatFields
to automatically enable
"flattened" XML serialization (request.useFlatFields) for all DataSource requests of a
particular operationType.
Note that useFlatFields
is not generally recommended for use with structures
where multiple simple type fields exist with the same name, however if used with such a
structure, the first field to use a given name wins. "first" means the first field
encountered in a depth first search. "wins" means only the first field will be present as a
field when data binding.
setUseFlatFields
in interface DataBoundComponent
useFlatFields
- useFlatFields Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getUseFlatFields()
DataBoundComponent
useFlatFields
flag causes all simple type fields anywhere in a nested
set of DataSources to be exposed as a flat list for form binding.
useFlatFields
is typically used with imported metadata, such as
XMLTools.loadXMLSchema(java.lang.String, com.smartgwt.client.data.XSDLoadCallback)
from a
XMLTools.loadWSDL(java.lang.String, com.smartgwt.client.data.WSDLLoadCallback)
, as a means of eliminating levels of XML
nesting that aren't meaningful in a user interface, without the cumbersome and fragile
process of mapping form fields to XML structures.
For example, having called WebService.getInputDS(java.lang.String)
to retrieve the input message
schema for a web service operation whose input message looks like this:
<FindServices> <searchFor>search text</searchFor> <Options> <caseSensitive>false</caseSensitive> </Options> <IncludeInSearch> <serviceName>true</serviceName> <documentation>true</documentation> <keywords>true</keywords> </IncludeInSearch> </FindServices>Setting
useFlatFields
on a DynamicForm
that is bound to this input
message schema would result in 5 FormItem
reflecting the 5 simple type
fields in the message.
For this form, the result of getValues()
might look
like:
{ searchFor: "search text", caseSensitive: false, serviceName: true, documentation : true, keywords : true }When contacting a
WebService
, these values can be automatically
mapped to the structure of the input message for a web service operation by setting
useFlatFields
(for use with WebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback)
) or by setting
useFlatFields
(for use with a DataSource
that is
'bound to a WSDL web service'
via
wsOperation
).
Using these two facilities in conjunction (component.useFlatFields and request.useFlatFields) allows gratuitous nesting to be consistently bypassed in both the user presentation and when providing the data for XML messages.
You can also set useFlatFields
to automatically enable
"flattened" XML serialization (request.useFlatFields) for all DataSource requests of a
particular operationType.
Note that useFlatFields
is not generally recommended for use with structures
where multiple simple type fields exist with the same name, however if used with such a
structure, the first field to use a given name wins. "first" means the first field
encountered in a depth first search. "wins" means only the first field will be present as a
field when data binding.
getUseFlatFields
in interface DataBoundComponent
public void setHiliteProperty(java.lang.String hiliteProperty)
DataBoundComponent
id
for a hilite defined on this component.
setHiliteProperty
in interface DataBoundComponent
hiliteProperty
- hiliteProperty Default value is "_hilite"public java.lang.String getHiliteProperty()
DataBoundComponent
id
for a hilite defined on this component.
getHiliteProperty
in interface DataBoundComponent
public void setDragDataAction(DragDataAction dragDataAction)
DataBoundComponent
setDragDataAction
in interface DataBoundComponent
dragDataAction
- dragDataAction Default value is Canvas.MOVEpublic DragDataAction getDragDataAction()
DataBoundComponent
getDragDataAction
in interface DataBoundComponent
public void setDragTrackerStyle(java.lang.String dragTrackerStyle)
DataBoundComponent
setDragTrackerStyle
in interface DataBoundComponent
dragTrackerStyle
- dragTrackerStyle Default value is "gridDragTracker"public java.lang.String getDragTrackerStyle()
DataBoundComponent
getDragTrackerStyle
in interface DataBoundComponent
public void setCanAddFormulaFields(java.lang.Boolean canAddFormulaFields)
DataBoundComponent
com.smartgwt.client..FormulaBuilder
.
User-added formula fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
setCanAddFormulaFields
in interface DataBoundComponent
canAddFormulaFields
- canAddFormulaFields Default value is falsepublic void addSummaryField()
DataBoundComponent
com.smartgwt.client..SummaryBuilder
to create a new Summary Field. This
is equivalent to calling DataBoundComponentGen#editSummaryField
with
no paramater.
addSummaryField
in interface DataBoundComponent
public void addFormulaField()
DataBoundComponent
com.smartgwt.client..FormulaBuilder
to create a new Formula Field. This
is equivalent to calling DataBoundComponentGen#editFormulaField
with
no paramater.
addFormulaField
in interface DataBoundComponent
public java.lang.Boolean getCanAddFormulaFields()
DataBoundComponent
com.smartgwt.client..FormulaBuilder
.
User-added formula fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
getCanAddFormulaFields
in interface DataBoundComponent
public void setAddFormulaFieldText(java.lang.String addFormulaFieldText)
DataBoundComponent
setAddFormulaFieldText
in interface DataBoundComponent
addFormulaFieldText
- addFormulaFieldText Default value is "Add formula column..."public java.lang.String getAddFormulaFieldText()
DataBoundComponent
getAddFormulaFieldText
in interface DataBoundComponent
public void setEditFormulaFieldText(java.lang.String editFormulaFieldText)
DataBoundComponent
setEditFormulaFieldText
in interface DataBoundComponent
editFormulaFieldText
- editFormulaFieldText Default value is "Edit formula..."public java.lang.String getEditFormulaFieldText()
DataBoundComponent
getEditFormulaFieldText
in interface DataBoundComponent
public void setCanAddSummaryFields(java.lang.Boolean canAddSummaryFields)
DataBoundComponent
com.smartgwt.client..SummaryBuilder
.
User-added summary fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
setCanAddSummaryFields
in interface DataBoundComponent
canAddSummaryFields
- canAddSummaryFields Default value is falsepublic java.lang.Boolean getCanAddSummaryFields()
DataBoundComponent
com.smartgwt.client..SummaryBuilder
.
User-added summary fields can be persisted via ListGrid.getFieldState()
and
ListGrid.setFieldState(java.lang.String)
.
getCanAddSummaryFields
in interface DataBoundComponent
public void setAddSummaryFieldText(java.lang.String addSummaryFieldText)
DataBoundComponent
setAddSummaryFieldText
in interface DataBoundComponent
addSummaryFieldText
- addSummaryFieldText Default value is "Add summary column..."public java.lang.String getAddSummaryFieldText()
DataBoundComponent
getAddSummaryFieldText
in interface DataBoundComponent
public void setEditSummaryFieldText(java.lang.String editSummaryFieldText)
DataBoundComponent
setEditSummaryFieldText
in interface DataBoundComponent
editSummaryFieldText
- editSummaryFieldText Default value is "Edit summary format..."public java.lang.String getEditSummaryFieldText()
DataBoundComponent
getEditSummaryFieldText
in interface DataBoundComponent
public void selectRecord(Record record)
DataBoundComponent
Record
passed in explicitly, or by index.
selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectpublic void selectRecord(int record)
DataBoundComponent
Record
passed in explicitly, or by index.
selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectpublic void selectRecord(int record, boolean newState)
DataBoundComponent
Record
passed in explicitly, or by index.
selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectnewState
- new selection state (if null, defaults to true)public void selectRecord(Record record, boolean newState)
DataBoundComponent
Record
passed in explicitly, or by index.
selectRecord
in interface DataBoundComponent
record
- record (or row number) to selectnewState
- new selection state (if null, defaults to true)public void selectRecords(int[] records)
DataBoundComponent
Record
s passed in explicitly, or by index.
selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectpublic void selectRecords(int[] records, boolean newState)
DataBoundComponent
Record
s passed in explicitly, or by index.
selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectnewState
- new selection statepublic void selectRecords(Record[] records)
DataBoundComponent
Record
s passed in explicitly, or by index.
selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectpublic void selectRecords(Record[] records, boolean newState)
DataBoundComponent
Record
s passed in explicitly, or by index.
selectRecords
in interface DataBoundComponent
records
- records (or row numbers) to selectnewState
- new selection state (if null, defaults to true)public void deselectRecord(Record record)
DataBoundComponent
Record
passed in explicitly, or by index. Synonym for
selectRecord(record, false)
deselectRecord
in interface DataBoundComponent
record
- record (or row number) to deselectpublic void deselectRecord(int record)
DataBoundComponent
Record
passed in explicitly, or by index. Synonym for
selectRecord(record, false)
deselectRecord
in interface DataBoundComponent
record
- record (or row number) to deselectpublic void deselectRecords(int[] records)
DataBoundComponent
Record
s passed in explicitly, or by index. Synonym
for selectRecords(records, false)
deselectRecords
in interface DataBoundComponent
records
- records (or row numbers) to deselectpublic void deselectRecords(Record[] records)
DataBoundComponent
Record
s passed in explicitly, or by index. Synonym
for selectRecords(records, false)
deselectRecords
in interface DataBoundComponent
records
- records (or row numbers) to deselectpublic void selectAllRecords()
DataBoundComponent
selectAllRecords
in interface DataBoundComponent
public void deselectAllRecords()
DataBoundComponent
deselectAllRecords
in interface DataBoundComponent
public java.lang.Boolean anySelected()
DataBoundComponent
anySelected
in interface DataBoundComponent
public void enableHilite(java.lang.String hiliteID)
DataBoundComponent
hilites
enableHilite
in interface DataBoundComponent
hiliteID
- ID of hilite to enablepublic void enableHilite(java.lang.String hiliteID, boolean enable)
DataBoundComponent
hilites
enableHilite
in interface DataBoundComponent
hiliteID
- ID of hilite to enableenable
- new enabled state to apply - if null, defaults to truepublic void disableHilite(java.lang.String hiliteID)
DataBoundComponent
disableHilite
in interface DataBoundComponent
hiliteID
- ID of hilite to disablepublic void enableHiliting()
DataBoundComponent
enableHiliting
in interface DataBoundComponent
public void enableHiliting(boolean enable)
DataBoundComponent
enableHiliting
in interface DataBoundComponent
enable
- new enabled state to apply - if null, defaults to truepublic void disableHiliting()
DataBoundComponent
disableHiliting
in interface DataBoundComponent
public Record[] getDragData()
DataBoundComponent
This method is generally called by com.smartgwt.client.widgets.DataBoundComponent#transferDragData
and is consulted by
ListGrid.willAcceptDrop()
.
getDragData
in interface DataBoundComponent
Record
s that are currently selected.public void transferSelectedData(DataBoundComponent source)
DataBoundComponent
DataBoundComponent.getDropValues()
for each dropped record.
To transfer all data in, for example, a ListGrid
, call grid.selection.selectAll() first.
See the Dragging
documentation for an overview of list grid drag/drop data
transfer.
transferSelectedData
in interface DataBoundComponent
source
- source component from which the records will be tranferredpublic void transferSelectedData(DataBoundComponent source, int index)
DataBoundComponent
DataBoundComponent.getDropValues()
for each dropped record.
To transfer all data in, for example, a ListGrid
, call grid.selection.selectAll() first.
See the Dragging
documentation for an overview of list grid drag/drop data
transfer.
transferSelectedData
in interface DataBoundComponent
source
- source component from which the records will be tranferredindex
- target index (drop position) of the rows within this grid.public int getRecordIndex(Record record)
DataBoundComponent
Override in subclasses to provide more specific behaviour, for instance, when data holds a large number of records
getRecordIndex
in interface DataBoundComponent
record
- the record whose index is to be retrieved
public java.lang.String getTitleFieldValue(Record record)
DataBoundComponent
Override in subclasses
getTitleFieldValue
in interface DataBoundComponent
record
- the record whose index is to be retrieved
public void setTitleField(java.lang.String titleField)
setTitleField
in interface DataBoundComponent
public java.lang.String getTitleField()
DataBoundComponent
titleField
for databound
compounds."title"
,
"name"
, or "id"
. If we dont find any field-names that match these
titles, the first field in the component will be used instead.
getTitleField
in interface DataBoundComponent
public void setDataSource(DataSource dataSource)
DataBoundComponent
DSRequest
.
Can be specified as either a DataSource instance or the String ID of a DataSource. Bind to a new DataSource.
Like passing the "dataSource" property on creation, 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().
setDataSource
in interface DataBoundComponent
dataSource
- DataSource to bind to. Default value is nullpublic DataSource getDataSource()
DataBoundComponent
DSRequest
.
Can be specified as either a DataSource instance or the String ID of a DataSource.
getDataSource
in interface DataBoundComponent
public void setAutoFetchData(java.lang.Boolean autoFetchData) throws java.lang.IllegalStateException
DataBoundComponent
DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
depending on
DataBoundComponent.getAutoFetchAsFilter()
. Criteria for this fetch may be picked up from initialCriteria
.
setAutoFetchData
in interface DataBoundComponent
autoFetchData
- autoFetchData
java.lang.IllegalStateException
public java.lang.Boolean getAutoFetchData()
DataBoundComponent
DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
depending on
DataBoundComponent.getAutoFetchAsFilter()
. Criteria for this fetch may be picked up from initialCriteria
.
getAutoFetchData
in interface DataBoundComponent
public void setAutoFetchAsFilter(java.lang.Boolean autoFetchAsFilter) throws java.lang.IllegalStateException
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
setAutoFetchAsFilter
in interface DataBoundComponent
autoFetchAsFilter
- autoFetchAsFilter
java.lang.IllegalStateException
public java.lang.Boolean getAutoFetchAsFilter()
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is true, this attribute determines whether the initial fetch operation should be
performed via DataBoundComponent.fetchData()
or DataBoundComponent.filterData()
getAutoFetchAsFilter
in interface DataBoundComponent
public void setInitialCriteria(Criteria initialCriteria) throws java.lang.IllegalStateException
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is used.
setInitialCriteria
in interface DataBoundComponent
initialCriteria
- the initial criteria
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic Criteria getInitialCriteria()
DataBoundComponent
DataBoundComponent.setAutoFetchData(Boolean)
is used.
getInitialCriteria
in interface DataBoundComponent
public void fetchData()
DataBoundComponent
DataSource
to retrieve data that matches
the provided criteria, and displays the matching data in this component. If there are a large number of matching records, paging will automatically be enabled, so that initially a smaller number of records will be retrieved and further records will be fetched as the user navigates the dataset.
When first called, this
method will create a com.smartgwt.client.data.ResultSet
, which will be configured based on component
settings such as fetchOperation
and dataPageSize
, as well as the general purpose dataProperties
. The ResultSet is then available as
component.data
.
Subsequent calls to fetchData() will simply call com.smartgwt.client.data.ResultSet#setCriteria
on the created ResultSet with the passed criteria.
In some
cases fetchData() will not need to context the server as the new criteria can be satisfied by performing a
client-side filter against the currently cached set of data. You can determine whether criteria will cause a
fetch by calling com.smartgwt.client.data.ResultSet#willFetchData
.
If you need to force a server
fetch, you can call com.smartgwt.client.data.ResultSet#invalidateCache
via
component.data.invalidateCache()
to do so.
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 we recomment using com.smartgwt.client.data.ResultSet#willFetchData
before calling this method to determine whether or not a server
fetch will occur.
In addition to the callback parameter for this method, developers can use com.smartgwt.client.data.ResultSet#dataArrived
to be notified every time ResultSet data is loaded. A
dataArrived
method can be installed in the automatically created ResultSet by adding it to dataProperties
.
fetchData
in interface DataBoundComponent
public void fetchData(Criteria criteria)
DataBoundComponent
DataSource
to retrieve data that matches
the provided criteria, and displays the matching data in this component. If there are a large number of matching records, paging will automatically be enabled, so that initially a smaller number of records will be retrieved and further records will be fetched as the user navigates the dataset.
When first called, this
method will create a com.smartgwt.client.data.ResultSet
, which will be configured based on component
settings such as fetchOperation
and dataPageSize
, as well as the general purpose dataProperties
. The ResultSet is then available as
component.data
.
Subsequent calls to fetchData() will simply call com.smartgwt.client.data.ResultSet#setCriteria
on the created ResultSet with the passed criteria.
In some
cases fetchData() will not need to context the server as the new criteria can be satisfied by performing a
client-side filter against the currently cached set of data. You can determine whether criteria will cause a
fetch by calling com.smartgwt.client.data.ResultSet#willFetchData
.
If you need to force a server
fetch, you can call com.smartgwt.client.data.ResultSet#invalidateCache
via
component.data.invalidateCache()
to do so.
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 we recomment using com.smartgwt.client.data.ResultSet#willFetchData
before calling this method to determine whether or not a server
fetch will occur.
In addition to the callback parameter for this method, developers can use com.smartgwt.client.data.ResultSet#dataArrived
to be notified every time ResultSet data is loaded. A
dataArrived
method can be installed in the automatically created ResultSet by adding it to dataProperties
.
fetchData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling getValuesAsCriteria()
public void fetchData(Criteria criteria, DSCallback callback)
DataBoundComponent
DataSource
to retrieve data that matches
the provided criteria, and displays the matching data in this component. If there are a large number of matching records, paging will automatically be enabled, so that initially a smaller number of records will be retrieved and further records will be fetched as the user navigates the dataset.
When first called, this
method will create a com.smartgwt.client.data.ResultSet
, which will be configured based on component
settings such as fetchOperation
and dataPageSize
, as well as the general purpose dataProperties
. The ResultSet is then available as
component.data
.
Subsequent calls to fetchData() will simply call com.smartgwt.client.data.ResultSet#setCriteria
on the created ResultSet with the passed criteria.
In some
cases fetchData() will not need to context the server as the new criteria can be satisfied by performing a
client-side filter against the currently cached set of data. You can determine whether criteria will cause a
fetch by calling com.smartgwt.client.data.ResultSet#willFetchData
.
If you need to force a server
fetch, you can call com.smartgwt.client.data.ResultSet#invalidateCache
via
component.data.invalidateCache()
to do so.
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 we recomment using com.smartgwt.client.data.ResultSet#willFetchData
before calling this method to determine whether or not a server
fetch will occur.
In addition to the callback parameter for this method, developers can use com.smartgwt.client.data.ResultSet#dataArrived
to be notified every time ResultSet data is loaded. A
dataArrived
method can be installed in the automatically created ResultSet by adding it to dataProperties
.
fetchData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires only
if server contact was requiredpublic void fetchData(Criteria criteria, DSCallback callback, DSRequest requestProperties)
DataBoundComponent
DataSource
to retrieve data that matches
the provided criteria, and displays the matching data in this component. If there are a large number of matching records, paging will automatically be enabled, so that initially a smaller number of records will be retrieved and further records will be fetched as the user navigates the dataset.
When first called, this
method will create a com.smartgwt.client.data.ResultSet
, which will be configured based on component
settings such as fetchOperation
and dataPageSize
, as well as the general purpose dataProperties
. The ResultSet is then available as
component.data
.
Subsequent calls to fetchData() will simply call com.smartgwt.client.data.ResultSet#setCriteria
on the created ResultSet with the passed criteria.
In some
cases fetchData() will not need to context the server as the new criteria can be satisfied by performing a
client-side filter against the currently cached set of data. You can determine whether criteria will cause a
fetch by calling com.smartgwt.client.data.ResultSet#willFetchData
.
If you need to force a server
fetch, you can call com.smartgwt.client.data.ResultSet#invalidateCache
via
component.data.invalidateCache()
to do so.
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 we recomment using com.smartgwt.client.data.ResultSet#willFetchData
before calling this method to determine whether or not a server
fetch will occur.
In addition to the callback parameter for this method, developers can use com.smartgwt.client.data.ResultSet#dataArrived
to be notified every time ResultSet data is loaded. A
dataArrived
method can be installed in the automatically created ResultSet by adding it to dataProperties
.
fetchData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object,
will be derived by calling getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires
only if server contact was requiredrequestProperties
- additional properties to set on the DSRequest
that will be issuedpublic void filterData()
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
public void filterData(Criteria criteria)
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object, will be
derived by calling getValuesAsCriteria()
public void filterData(Criteria criteria, DSCallback callback)
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object,
will be derived by calling getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires
only if server contact was required; see
DataBoundComponent.fetchData()
for detailspublic void filterData(Criteria criteria, DSCallback callback, DSRequest requestProperties)
DataBoundComponent
This
method behaves exactly like ListGrid.fetchData()
except that textMatchStyle
is automatically set to "substring" so that
String-valued fields are matched by case-insensitive substring comparison.
filterData
in interface DataBoundComponent
criteria
- Search criteria. If a DynamicForm
is passed in as this argument instead of a raw criteria object,
will be derived by calling getValuesAsCriteria()
callback
- callback to invoke when a fetch is complete. Fires
only if server contact was required; see
DataBoundComponent.fetchData()
for detailsrequestProperties
- for databound components only - optional additional
properties to set on the DSRequest that will be issuedpublic void invalidateCache()
DataBoundComponent
this.data.invalidateCache()
. If necessary, this will cause a new fetch to
be performed with the current set of criteria for this component.
Has no effect if this component is not showing a set of filtered data.
invalidateCache
in interface DataBoundComponent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |