com.smartgwt.client.widgets.form
Class DynamicForm

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.smartgwt.client.widgets.BaseWidget
              extended by com.smartgwt.client.widgets.Canvas
                  extended by com.smartgwt.client.widgets.form.DynamicForm
All Implemented Interfaces:
HasHandlers, EventListener, DataBoundComponent, HasClickHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasFormSubmitFailedHandlers, HasItemChangedHandlers, HasItemChangeHandlers, HasItemKeyPressHandlers, HasSubmitValuesHandlers
Direct Known Subclasses:
PropertySheet, SearchForm

public class DynamicForm
extends Canvas
implements DataBoundComponent, HasSubmitValuesHandlers, HasItemChangeHandlers, HasItemChangedHandlers, HasItemKeyPressHandlers, HasFormSubmitFailedHandlers

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: The item 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
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.smartgwt.client.widgets.BaseWidget
config, configOnly, id, isElementSet, scClassName
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
DynamicForm()
           
DynamicForm(JavaScriptObject jsObj)
           
 
Method Summary
 HandlerRegistration addFormSubmitFailedHandler(FormSubmitFailedHandler handler)
          Add a formSubmitFailed handler.
 void addFormulaField()
          Convenience method to display a com.smartgwt.client..FormulaBuilder to create a new Formula Field.
 HandlerRegistration addItemChangedHandler(ItemChangedHandler handler)
          Add a itemChanged handler.
 HandlerRegistration addItemChangeHandler(ItemChangeHandler handler)
          Add a itemChange handler.
 HandlerRegistration addItemKeyPressHandler(ItemKeyPressHandler handler)
          Add a itemKeyPress handler.
 HandlerRegistration addSubmitValuesHandler(SubmitValuesHandler handler)
          Add a submitValues handler.
 void addSummaryField()
          Convenience method to display a com.smartgwt.client..SummaryBuilder to create a new Summary Field.
 Boolean anySelected()
          Whether at least one item is selected
 void cancel()
           This method exists for clean integration with existing server frameworks that have a 'cancel' feature which typically clears session state associated with the form.
 void cancel(DSRequest requestProperties)
           This method exists for clean integration with existing server frameworks that have a 'cancel' feature which typically clears session state associated with the form.
 void clearErrors(boolean show)
          Clears all errors for this DynamicForm.
 void clearFieldErrors(String fieldName, boolean show)
          Clear any validation errors on the field passed in.
 void clearValue(String fieldName)
          Clears the value for some field via a call to FormItem.clearValue() if appropriate.
 void clearValues()
          Reset to default form values and clear errors
protected  JavaScriptObject create()
           
 void deselectAllRecords()
           Deselect all records
 void deselectRecord(int record)
          Deselect a Record passed in explicitly, or by index.
 void deselectRecord(Record record)
          Deselect a Record passed in explicitly, or by index.
 void deselectRecords(int[] records)
          Deselect a list of Records passed in explicitly, or by index.
 void deselectRecords(Record[] records)
          Deselect a list of Records passed in explicitly, or by index.
 void disableHilite(String hiliteID)
          Disable a hilite
 void disableHiliting()
          Disable all hilites.
 void editNewRecord()
          Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified).
 void editNewRecord(Map initialValues)
          Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified).
 void editRecord(Record record)
          Edit an existing record.
 void editSelectedData(ListGrid selectionComponent)
           
 void editSelectedData(String listGridID)
           
 void enableHilite(String hiliteID)
          Enable / disable a hilites
 void enableHilite(String hiliteID, boolean enable)
          Enable / disable a hilites
 void enableHiliting()
          Enable all hilites.
 void enableHiliting(boolean enable)
          Enable all hilites.
 void 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(String itemName)
          Move the keyboard focus into a particular item.
 String getAction()
          The URL to which the form will submit its values.
 Boolean getAddDropValues()
          Indicates whether to add "drop values" to items dropped on this component, if both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key.
 String getAddFormulaFieldText()
          Text for a menu item allowing users to add a formula field
 String getAddOperation()
          Operation ID this component should use when performing add operations.
 String getAddSummaryFieldText()
          Text for a menu item allowing users to add a formula field
 Boolean getAutoFetchAsFilter()
          If DataBoundComponent.setAutoFetchData(Boolean) is true, this attribute determines whether the initial fetch operation should be performed via DataBoundComponent.fetchData() or DataBoundComponent.filterData()
 Boolean getAutoFetchData()
          If true, when this component is first drawn, automatically call DataBoundComponent.fetchData() or DataBoundComponent.filterData() depending on DataBoundComponent.getAutoFetchAsFilter() .
 TextMatchStyle getAutoFetchTextMatchStyle()
          If autoFetchData is true, this attribute allows the developer to specify a textMatchStyle for the initial fetchData() call.
 Boolean getAutoFocus()
          If true, when the form is drawn, focus will automatically be put into the first focusable element in the form.
Note that to put focus in a different item you can explicitly call dynamicForm.focusInItem(itemName)
 Boolean getCanAddFormulaFields()
          Adds an item to the header context menu allowing users to launch a dialog to define a new field based on values present in other fields, using the com.smartgwt.client..FormulaBuilder.
 Boolean getCanAddSummaryFields()
          Adds an item to the header context menu allowing users to launch a dialog to define a new text field that can contain both user-defined text and the formatted values present in other fields, using the com.smartgwt.client..SummaryBuilder.
 String getCancelParamName()
          The name of the special field sent to the server as part of cancel()
 String getCancelParamValue()
          The value of the special field sent to the server as part of cancel()
 Boolean getCanFocus()
          DynamicForms are considered to have focus if any of their form items have focus.
 Boolean getCanSubmit()
          Governs whether this form will be used to perform a standard HTML form submission.
 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.
 FetchMode getDataFetchMode()
          How to fetch and manage records retrieve from the server.
 int getDataPageSize()
          When using data paging, how many records to fetch at a time.
 DataSource getDataSource()
          The DataSource that this component should bind to for default fields and for performing DSRequest.
 Boolean getDisableValidation()
          If set to true, client-side validators will not run on the form when validate() is called.
 Record[] getDragData()
           During a drag-and-drop interaction, this method returns the set of records being dragged out of the component.
 DragDataAction getDragDataAction()
          Indicates what to do with data dragged into another DataBoundComponent.
 String getDragTrackerStyle()
          CSS Style to apply to the drag tracker when dragging occurs on this component.
 Map getDropValues()
          When an item is dropped on this component, and addDropValues is true and both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key, this object provides the "drop values" that SmartGWT will apply to the dropped object before updating it.
 String getDuplicateDragMessage()
          Message to show when a user attempts to transfer duplicate records into this component, and preventDuplicates is enabled.
 String getEditFormulaFieldText()
          Text for a menu item allowing users to edit a formula field
 String getEditSummaryFieldText()
          Text for a menu item allowing users to edit the formatter for a field
 Encoding getEncoding()
          encoding for the form, use MULTIPART_ENCODING for file upload forms
 String getErrorItemCellStyle()
          If showInlineErrors is false we show all errors for the form item in a single item rendered at the top of the form.
This attribute specifies the cellStyle to apply to this item.
 Map getErrors()
          Returns the set of errors.
 String getErrorsPreamble()
          If showInlineErrors is false we show all errors for the form item in a single item rendered at the top of the form.
This attribute specifies an introductory string rendered out before the individual error messages.
 Boolean getExportAll()
          Setting exportAll to true prevents the component from passing it's list of fields to the export call.
 String[] getExportFields()
          The list of field-names to export.
 String getFetchOperation()
          Operation ID this component should use when performing fetch operations.
 FormItem getField(String name)
           
 String[] getFieldErrors(String fieldName)
          Returns any validation errors for some field in this valuesManager.
 FormItem[] getFields()
          Return thhe form fields
 Boolean getFixedColWidths()
          If true, we ensure that column widths are at least as large as you specify them.
 String getFormSubmitFailedWarning()
          Warning to display to the user if an attempt to submitForm() a form is unable to submit to the server.
 String getHiliteProperty()
          Marker that can be set on a record to flag that record as hilited.
 Boolean getHiliteRequiredFields()
          Indicates whether the titles of required items in this form should use the special prefix and suffix specified by the next two properties, instead of the standard prefix and suffix.
 Criteria getInitialCriteria()
          Criteria to use when DataBoundComponent.setAutoFetchData(Boolean) is used.
 FormItem getItem(String name)
           
 Alignment getItemHoverAlign()
          Text alignment for hovers shown for items
 int getItemHoverDelay()
          If the user rolls over an item, how long a delay before we fire any hover action / show a hover for that item?
 Integer getItemHoverHeight()
          A default height for hovers shown for items
 Integer getItemHoverOpacity()
          Opacity for hovers shown for items
 String getItemHoverStyle()
          CSS Style for hovers shown for items
 Integer getItemHoverVAlign()
          Vertical text alignment for hovers shown for items
 Integer getItemHoverWidth()
          A default width for hovers shown for items
 FormLayoutType getItemLayout()
          Layout style to use with this form.
 int getLongTextEditorThreshold()
          When creating form items for fields with text type data, if the specified length of the field exceeds this threshold we will create form item of type this.longTextEditorType (a TextAreaItem by default), rather than a simple text item.
 String getLongTextEditorType()
          Name of the Form Item class to use for text fields which exceed the longTextEditorThreshold for this form.
 FormMethod getMethod()
          The mechanism by which form data is sent to the action URL.
 int getMinColWidth()
          Minimum width of a form column.
 int getNumCols()
          The number of columns of titles and items in this form's layout grid.
 OperatorId getOperator()
          When operator has been set for any FormItem in this form, what logical operator should be applied across the ${isc.DocUtils.linkForRef('object:Criterion','criteria')} produced by the form items? Only applicable to forms that have a dataSource.
static DynamicForm getOrCreateRef(JavaScriptObject jsObj)
           
 Boolean getPreventDuplicates()
          If set, detect and prevent duplicate records from being transferred to this component, either via drag and drop or via DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent).
 int getRecordIndex(Record record)
          Get the index of the provided record.
 RecordList getRecordList()
          Return the underlying data of this DataBoundComponent as a RecordList.
 Boolean getRejectInvalidValueOnChange()
          If validateOnChange is true, and validation fails for an item on change, with no suggested value, should we revert to the previous value, or continue to display the bad value entered by the user.
 String getRemoveOperation()
          Operation ID this component should use when performing remove operations.
 String getRequiredRightTitlePrefix()
          The string prepended to the title of every required item in this form if highlightRequiredFields is true and the titleOrientation property is set to "right".
 String getRequiredRightTitleSuffix()
          The string appended to the title of every required item in this form if highlightRequiredFields is true and the titleOrientation property is set to "right".
 String getRequiredTitlePrefix()
          The string prepended to the title of every required item in this form if highlightRequiredFields is true.
 String getRequiredTitleSuffix()
          The string appended to the title of every required item in this form if highlightRequiredFields is true.
 ResultSet getResultSet()
          Return the underlying data of this DataBoundComponent as a ResultSet.
 String getRightTitlePrefix()
          The string prepended to the title of an item in this form if its titleOrientation property is set to "right".
 String getRightTitleSuffix()
          The string appended to the title of an item in this form if its titleOrientation property is set to "right".
 Boolean getSaveOnEnter()
          If true, when the user hits the Enter key while 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.
 VisibilityMode getSectionVisibilityMode()
          If the form has sections, [implemented as SectionItems], this attribute controls whether multiple sections can be expanded at once.
 Boolean getSelectOnFocus()
          If this property is set to true, whenever a text-based field in this form (TextItem, TextAreaItem) is given focus programmatically (see focusInItem(int)), all text within the item will be selected.
 Boolean getShowComplexFields()
          Whether to show fields of non-atomic types when a DataBoundComponent is given a DataSource but no component.fields.
 Boolean getShowComplexFieldsRecursively()
          If set, this DynamicForm will set both 'showComplexFields' and showComplexFieldsRecursively on any nested component used for showing/editing a complex field.
 Boolean getShowDetailFields()
          Whether to show fields marked detail:true when a DataBoundComponent is given a DataSource but no component.fields.
 Boolean getShowErrorIcons()
          'showErrorIcons', 'showErrorText', and 'showErrorStyle' control how validation errors are displayed next to form items when showInlineErrors is true.
 Boolean getShowErrorStyle()
          'showErrorIcons', 'showErrorText', and 'showErrorStyle' control how validation errors are displayed next to form items when showInlineErrors is true.
 Boolean getShowErrorText()
          'showErrorIcons', 'showErrorText', and 'showErrorStyle' control how validation errors are displayed next to form items when showInlineErrors is true.
 Boolean getShowHiddenFields()
          Whether to show fields marked hidden:true when a DataBoundComponent is given a DataSource but no component.fields.
 Boolean getShowInlineErrors()
          If true, field errors are written into the form next to the item(s) where the errors occurred.
 Boolean getShowTitlesWithErrorMessages()
          Indicates whether on validation failure, the error message displayed to the user should be prepended with the title for the item.
 String getTarget()
          The name of a window or frame that will receive the results returned by the form's action.
 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".
 String getTitleFieldValue(Record record)
          Get the value of the titleField for the passed record
 TitleOrientation getTitleOrientation()
          Default orientation for titles for items in this form.
 String getTitlePrefix()
          The string prepended to the title of every item in this form.
 String getTitleSuffix()
          The string appended to the title of every item in this form.
 String getUnknownErrorMessage()
          The error message for a failed validator that does not specify its own errorMessage.
 String getUpdateOperation()
          Operation ID this component should use when performing update operations.
 Boolean getUseAllDataSourceFields()
          If true, the set of fields given by the "default binding" (see fields) is used, with any fields specified in component.fields acting as overrides that can suppress or modify the display of individual fields, without having to list the entire set of fields that should be shown.
 Boolean getUseFlatFields()
          The useFlatFields flag causes all simple type fields anywhere in a nested set of DataSources to be exposed as a flat list for form binding.
 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.
 String getValidationURL()
          validationURL can be set to do server-side validation against a different URL from where the form will ultimately save, as part of an incremental upgrade strategy for Struts and Struts-like applications.
 Object getValue(String fieldName)
           
 String getValueAsString(String fieldName)
           
 Map getValues()
          Returns the current set of values where each propertyName is the name of a form item in the form, and each property value is the value held by that form item.
 AdvancedCriteria getValuesAsAdvancedCriteria()
          Return an AdvancedCriteria object based on the current set of values within this form.
 Criteria getValuesAsCriteria()
           
 ValuesManager getValuesManager()
          Return the ValuesManager for this form.
 Boolean getWrapItemTitles()
          Whether titles for form items should wrap.
 Boolean hasErrors()
          Return whether this form currently has any validation errors.
Validation errors are set up automatically by validation, or may be explicitly set via setErrors(java.util.Map, boolean) or setFieldErrors(java.lang.String, java.lang.String, boolean).
 Boolean hasFieldErrors(String fieldName)
          Does this form currently h ave any validation errors on the field passed in?
Validation errors are set up automatically by validation, or may be explicitly set via setErrors(java.util.Map, boolean) or setFieldErrors(java.lang.String, java.lang.String, boolean).
 void hideItem(String itemName)
          Hide a form item via FormItem.hide()
 void invalidateCache()
          Invalidate the current data cache for this databound component via a call to this.data.invalidateCache().
 Boolean isNewRecord()
          Returns true if saveOperationType is currently "add".
protected  void onInit()
           
 JavaScriptObject rememberValues()
          Make a snapshot of the current set of values, so we can reset to them later.
 void reset()
          Resets values to the state it was the last time setValues() or rememberValues() was called.
 void resetValues()
          Same as reset().
 void saveData()
           
 void saveData(DSCallback callback)
           
 void saveData(DSCallback callback, DSRequest requestProperties)
           
 void selectAllRecords()
          Select all records
 void selectRecord(int record)
          Select/deselect a Record passed in explicitly, or by index.
 void selectRecord(int record, boolean newState)
          Select/deselect a Record passed in explicitly, or by index.
 void selectRecord(Record record)
          Select/deselect a Record passed in explicitly, or by index.
 void selectRecord(Record record, boolean newState)
          Select/deselect a Record passed in explicitly, or by index.
 void selectRecords(int[] records)
          Select/deselect a list of Records passed in explicitly, or by index.
 void selectRecords(int[] records, boolean newState)
          Select/deselect a list of Records passed in explicitly, or by index.
 void selectRecords(Record[] records)
          Select/deselect a list of Records passed in explicitly, or by index.
 void selectRecords(Record[] records, boolean newState)
          Select/deselect a list of Records passed in explicitly, or by index.
 void setAction(String action)
          The URL to which the form will submit its values.
 void setAddDropValues(Boolean addDropValues)
          Indicates whether to add "drop values" to items dropped on this component, if both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key.
 void setAddFormulaFieldText(String addFormulaFieldText)
          Text for a menu item allowing users to add a formula field
 void setAddOperation(String addOperation)
          Operation ID this component should use when performing add operations.
 void setAddSummaryFieldText(String addSummaryFieldText)
          Text for a menu item allowing users to add a formula field
 void setAutoFetchAsFilter(Boolean autoFetchAsFilter)
          If DataBoundComponent.setAutoFetchData(Boolean) is true, this attribute determines whether the initial fetch operation should be performed via DataBoundComponent.fetchData() or DataBoundComponent.filterData()
 void setAutoFetchData(Boolean autoFetchData)
          If true, when this component is first drawn, automatically call DataBoundComponent.fetchData() or DataBoundComponent.filterData() depending on DataBoundComponent.getAutoFetchAsFilter() .
 void setAutoFetchTextMatchStyle(TextMatchStyle autoFetchTextMatchStyle)
          If autoFetchData is true, this attribute allows the developer to specify a textMatchStyle for the initial fetchData() call.
 void setAutoFocus(Boolean autoFocus)
          If true, when the form is drawn, focus will automatically be put into the first focusable element in the form.
Note that to put focus in a different item you can explicitly call dynamicForm.focusInItem(itemName)
 void setCanAddFormulaFields(Boolean canAddFormulaFields)
          Adds an item to the header context menu allowing users to launch a dialog to define a new field based on values present in other fields, using the com.smartgwt.client..FormulaBuilder.
 void setCanAddSummaryFields(Boolean canAddSummaryFields)
          Adds an item to the header context menu allowing users to launch a dialog to define a new text field that can contain both user-defined text and the formatted values present in other fields, using the com.smartgwt.client..SummaryBuilder.
 void setCancelParamName(String cancelParamName)
          The name of the special field sent to the server as part of cancel()
 void setCancelParamValue(String cancelParamValue)
          The value of the special field sent to the server as part of cancel()
 void setCanFocus(Boolean canFocus)
          DynamicForms are considered to have focus if any of their form items have focus.
 void setCanSubmit(Boolean canSubmit)
          Governs whether this form will be used to perform a standard HTML form submission.
 void 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(Object... colWidths)
          An array of widths for the columns of items in this form's layout grid.
 void setDataFetchMode(FetchMode fetchMode)
          How to fetch and manage records retrieve from the server.
 void setDataPageSize(int dataPageSize)
          When using data paging, how many records to fetch at a time.
 void setDataSource(DataSource dataSource)
          The DataSource that this component should bind to for default fields and for performing DSRequest.
 void setDisableValidation(Boolean disableValidation)
          If set to true, client-side validators will not run on the form when validate() is called.
 void setDragDataAction(DragDataAction dragDataAction)
          Indicates what to do with data dragged into another DataBoundComponent.
 void setDragTrackerStyle(String dragTrackerStyle)
          CSS Style to apply to the drag tracker when dragging occurs on this component.
 void setDropValues(Map dropValues)
          When an item is dropped on this component, and addDropValues is true and both the source and target widgets are databound, either to the same DataSource or to different DataSources that are related via a foreign key, this object provides the "drop values" that SmartGWT will apply to the dropped object before updating it.
 void setDuplicateDragMessage(String duplicateDragMessage)
          Message to show when a user attempts to transfer duplicate records into this component, and preventDuplicates is enabled.
 void setEditFormulaFieldText(String editFormulaFieldText)
          Text for a menu item allowing users to edit a formula field
 void setEditSummaryFieldText(String editSummaryFieldText)
          Text for a menu item allowing users to edit the formatter for a field
 void setEncoding(Encoding encoding)
          encoding for the form, use MULTIPART_ENCODING for file upload forms
 void setErrorItemCellStyle(String errorItemCellStyle)
          If showInlineErrors is false we show all errors for the form item in a single item rendered at the top of the form.
This attribute specifies the cellStyle to apply to this item.
 void setErrorOrientation(FormErrorOrientation errorOrientation)
          If DynamicForm.showInlineErrors is true, where should the error icon and text appear relative to form items? Valid options are "top", "bottom", "left" or "right".
 void setErrors(Map errors, boolean showErrors)
          Setter for validation errors on this form.
 void setErrorsPreamble(String errorsPreamble)
          If showInlineErrors is false we show all errors for the form item in a single item rendered at the top of the form.
This attribute specifies an introductory string rendered out before the individual error messages.
 void setExportAll(Boolean exportAll)
          Setting exportAll to true prevents the component from passing it's list of fields to the export call.
 void setExportFields(String[] exportFields)
          The list of field-names to export.
 void setFetchOperation(String fetchOperation)
          Operation ID this component should use when performing fetch operations.
 void setFieldErrors(String fieldName, String[] errors, boolean showErrors)
          Set field validation errors for some field.
 void setFieldErrors(String fieldName, String error, boolean showErrors)
          Set field validation error for some field.
 void setFields(FormItem... fields)
          An array of field objects, specifying the order, layout, and types of each field in the DynamicForm.
 void setFixedColWidths(Boolean fixedColWidths)
          If true, we ensure that column widths are at least as large as you specify them.
 void setFormSubmitFailedWarning(String formSubmitFailedWarning)
          Warning to display to the user if an attempt to submitForm() a form is unable to submit to the server.
 void setHiliteProperty(String hiliteProperty)
          Marker that can be set on a record to flag that record as hilited.
 void setHiliteRequiredFields(Boolean hiliteRequiredFields)
          Indicates whether the titles of required items in this form should use the special prefix and suffix specified by the next two properties, instead of the standard prefix and suffix.
 void setInitialCriteria(Criteria initialCriteria)
          Criteria to use when DataBoundComponent.setAutoFetchData(Boolean) is used.
 void setItemHoverAlign(Alignment itemHoverAlign)
          Text alignment for hovers shown for items
 void setItemHoverDelay(int itemHoverDelay)
          If the user rolls over an item, how long a delay before we fire any hover action / show a hover for that item?
 void setItemHoverFormatter(FormItemHoverFormatter hoverFormatter)
          The FormItemHoverFormatter should return the HTML to display in a hover canvas when the user holds the mousepointer over this item.
 void setItemHoverHeight(Integer itemHoverHeight)
          A default height for hovers shown for items
 void setItemHoverOpacity(Integer itemHoverOpacity)
          Opacity for hovers shown for items
 void setItemHoverStyle(String itemHoverStyle)
          CSS Style for hovers shown for items
 void setItemHoverVAlign(Integer itemHoverVAlign)
          Vertical text alignment for hovers shown for items
 void setItemHoverWidth(Integer itemHoverWidth)
          A default width for hovers shown for items
 void setItemLayout(FormLayoutType itemLayout)
          Layout style to use with this form.
 void setItems(FormItem... items)
          Synonym for setFields(com.smartgwt.client.widgets.form.fields.FormItem[]).
 void setItemTitleHoverFormatter(FormItemHoverFormatter hoverFormatter)
          The FormItemHoverFormatter should return the HTML to display in a hover canvas when the user holds the mousepointer over the item's title.
 void setLongTextEditorThreshold(int longTextEditorThreshold)
          When creating form items for fields with text type data, if the specified length of the field exceeds this threshold we will create form item of type this.longTextEditorType (a TextAreaItem by default), rather than a simple text item.
 void setLongTextEditorType(String longTextEditorType)
          Name of the Form Item class to use for text fields which exceed the longTextEditorThreshold for this form.
 void setMethod(FormMethod method)
          The mechanism by which form data is sent to the action URL.
 void setMinColWidth(int minColWidth)
          Minimum width of a form column.
 void setNumCols(int numCols)
          The number of columns of titles and items in this form's layout grid.
 void setOperator(OperatorId operator)
          When operator has been set for any FormItem in this form, what logical operator should be applied across the ${isc.DocUtils.linkForRef('object:Criterion','criteria')} produced by the form items? Only applicable to forms that have a dataSource.
 void setPreventDuplicates(Boolean preventDuplicates)
          If set, detect and prevent duplicate records from being transferred to this component, either via drag and drop or via DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent).
 void setRejectInvalidValueOnChange(Boolean rejectInvalidValueOnChange)
          If validateOnChange is true, and validation fails for an item on change, with no suggested value, should we revert to the previous value, or continue to display the bad value entered by the user.
 void setRemoveOperation(String removeOperation)
          Operation ID this component should use when performing remove operations.
 void setRequiredRightTitlePrefix(String requiredRightTitlePrefix)
          The string prepended to the title of every required item in this form if highlightRequiredFields is true and the titleOrientation property is set to "right".
 void setRequiredRightTitleSuffix(String requiredRightTitleSuffix)
          The string appended to the title of every required item in this form if highlightRequiredFields is true and the titleOrientation property is set to "right".
 void setRequiredTitlePrefix(String requiredTitlePrefix)
          The string prepended to the title of every required item in this form if highlightRequiredFields is true.
 void setRequiredTitleSuffix(String requiredTitleSuffix)
          The string appended to the title of every required item in this form if highlightRequiredFields is true.
 void setRightTitlePrefix(String rightTitlePrefix)
          The string prepended to the title of an item in this form if its titleOrientation property is set to "right".
 void setRightTitleSuffix(String rightTitleSuffix)
          The string appended to the title of an item in this form if its titleOrientation property is set to "right".
 void setSaveOnEnter(Boolean saveOnEnter)
          If true, when the user hits the Enter key while 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.
 void setSectionVisibilityMode(VisibilityMode sectionVisibilityMode)
          If the form has sections, [implemented as SectionItems], this attribute controls whether multiple sections can be expanded at once.
 void setSelectOnFocus(Boolean selectOnFocus)
          If this property is set to true, whenever a text-based field in this form (TextItem, TextAreaItem) is given focus programmatically (see focusInItem(int)), all text within the item will be selected.
 void setShowComplexFields(Boolean showComplexFields)
          Whether to show fields of non-atomic types when a DataBoundComponent is given a DataSource but no component.fields.
 void setShowComplexFieldsRecursively(Boolean showComplexFieldsRecursively)
          If set, this DynamicForm will set both 'showComplexFields' and showComplexFieldsRecursively on any nested component used for showing/editing a complex field.
 void setShowDetailFields(Boolean showDetailFields)
          Whether to show fields marked detail:true when a DataBoundComponent is given a DataSource but no component.fields.
 void setShowErrorIcons(Boolean showErrorIcons)
          'showErrorIcons', 'showErrorText', and 'showErrorStyle' control how validation errors are displayed next to form items when showInlineErrors is true.
 void setShowErrorStyle(Boolean showErrorStyle)
          'showErrorIcons', 'showErrorText', and 'showErrorStyle' control how validation errors are displayed next to form items when showInlineErrors is true.
 void setShowErrorText(Boolean showErrorText)
          'showErrorIcons', 'showErrorText', and 'showErrorStyle' control how validation errors are displayed next to form items when showInlineErrors is true.
 void setShowHiddenFields(Boolean showHiddenFields)
          Whether to show fields marked hidden:true when a DataBoundComponent is given a DataSource but no component.fields.
 void setShowInlineErrors(Boolean showInlineErrors)
          If true, field errors are written into the form next to the item(s) where the errors occurred.
 void setShowTitlesWithErrorMessages(Boolean showTitlesWithErrorMessages)
          Indicates whether on validation failure, the error message displayed to the user should be prepended with the title for the item.
 void setTarget(String target)
          The name of a window or frame that will receive the results returned by the form's action.
 void setTitleField(String titleField)
           
 void setTitleOrientation(TitleOrientation titleOrientation)
          Default orientation for titles for items in this form.
 void setTitlePrefix(String titlePrefix)
          The string prepended to the title of every item in this form.
 void setTitleSuffix(String titleSuffix)
          The string appended to the title of every item in this form.
 void setTitleWidth(int titleWidth)
          The width in pixels allocated to the title of every item in this form.
 void setTitleWidth(String titleWidth)
          The width in pixels allocated to the title of every item in this form.
 void setUnknownErrorMessage(String unknownErrorMessage)
          The error message for a failed validator that does not specify its own errorMessage.
 void setUpdateOperation(String updateOperation)
          Operation ID this component should use when performing update operations.
 void setUseAllDataSourceFields(boolean useAllDataSourceFields)
          If true, the set of fields given by the "default binding" (see DataBoundComponent.fields) is used, with any fields specified in component.fields acting as overrides that can suppress or modify the display of individual fields, without having to list the entire set of fields that should be shown.
 void setUseAllDataSourceFields(Boolean useAllDataSourceFields)
          If true, the set of fields given by the "default binding" (see fields) is used, with any fields specified in component.fields acting as overrides that can suppress or modify the display of individual fields, without having to list the entire set of fields that should be shown.
 void setUseFlatFields(Boolean useFlatFields)
          The useFlatFields flag causes all simple type fields anywhere in a nested set of DataSources to be exposed as a flat list for form binding.
 void setValidateOnChange(Boolean validateOnChange)
          If true, form fields will be validated when each item's "change" handler is fired as well as when the entire form is submitted or validated.
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(String validationURL)
          validationURL can be set to do server-side validation against a different URL from where the form will ultimately save, as part of an incremental upgrade strategy for Struts and Struts-like applications.
 void setValue(String fieldName, boolean value)
          Set the value for some field.
 void setValue(String fieldName, DataClass value)
          Set the value for some field.
 void setValue(String fieldName, DataClass[] value)
          Set the value for some field.
 void setValue(String fieldName, double value)
          Set the value for some field.
 void setValue(String fieldName, JavaScriptObject value)
          Set the value for some field.
 void setValue(String fieldName, Map value)
          Set the value for some field.
 void setValue(String fieldName, Record value)
          Set the value for some field.
 void setValue(String fieldName, Record[] value)
          Set the value for some field.
 void setValue(String fieldName, String value)
          Sets the value for some field
 void setValues(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(Boolean wrapItemTitles)
          Whether titles for form items should wrap.
 void showErrors()
          If this form has any outstanding validation errors, show them now.
This method is called when the set of errors are changed by setErrors(java.util.Map, boolean) or validate(boolean).
 void showFieldErrors(String fieldName)
          If this form has any outstanding validation errors for the field passed in, show them now.
 void showItem(String itemName)
          Show a form item via FormItem.show()
 void submit()
          submit() is automatically called when a SubmitItem included in the form is clicked, or, if saveOnEnter is set, when the "Enter" key is pressed in a text input.
 void submit(DSCallback callback)
          submit() is automatically called when a SubmitItem included in the form is clicked, or, if saveOnEnter is set, when the "Enter" key is pressed in a text input.
 void submit(DSCallback callback, DSRequest requestProperties)
          submit() is automatically called when a SubmitItem included in the form is clicked, or, if saveOnEnter is set, when the "Enter" key is pressed in a text input.
 void submitForm()
          Submits the form to the URL defined by action, identically to how a plain HTML <form> element would submit data, as either an HTTP GET or POST as specified by method.
 void transferSelectedData(DataBoundComponent source)
          Simulates a drag / drop type transfer of the selected records in some other component to this component, without requiring any user interaction.
 void transferSelectedData(DataBoundComponent source, int index)
          Simulates a drag / drop type transfer of the selected records in some other component to this component, without requiring any user interaction.
 boolean validate()
          Validates the form without submitting it, and redraws the form to display error messages if there are any validation errors.
 Boolean validate(boolean validateHiddenFields)
          Validates the form without submitting it, and redraws the form to display error messages if there are any validation errors.
 void validateData()
          Perform validation on the client and the server.
 boolean valuesAreValid(boolean validateHiddenFields)
          Method to determine whether the current form values would pass validation.
 Boolean valuesHaveChanged()
          Compares the current set of values with the values stored by the call to the rememberValues() method.
 
Methods inherited from class com.smartgwt.client.widgets.Canvas
addChild, addChild, addChild, addClickHandler, addDoubleClickHandler, addDragMoveHandler, addDragRepositionMoveHandler, addDragRepositionStartHandler, addDragRepositionStopHandler, addDragResizeMoveHandler, addDragResizeStartHandler, addDragResizeStopHandler, addDragStartHandler, addDragStopHandler, addDropHandler, addDropMoveHandler, addDropOutHandler, addDropOverHandler, addFocusChangedHandler, addHoverHandler, addHoverHiddenHandler, addKeyDownHandler, addKeyPressHandler, addMouseDownHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseStillDownHandler, addMouseUpHandler, addMouseWheelHandler, addPeer, addPeer, addResizedHandler, addRightMouseDownHandler, addScrolledHandler, addShowContextMenuHandler, addStyleName, adjustForContent, animateFade, animateFade, animateFade, animateHide, animateHide, animateHide, animateMove, animateMove, animateMove, animateMove, animateRect, animateRect, animateRect, animateResize, animateResize, animateResize, animateScroll, animateScroll, animateScroll, animateShow, animateShow, animateShow, blur, bringToFront, clear, clickMaskUp, clickMaskUp, contains, contains, containsEvent, containsFocus, containsPoint, containsPoint, convertToCanvasArray, disable, enable, focus, getAbsoluteLeft, getAbsoluteTop, getAccessKey, getAnimateAcceleration, getAnimateFadeTime, getAnimateHideAcceleration, getAnimateHideTime, getAnimateMoveAcceleration, getAnimateMoveTime, getAnimateRectAcceleration, getAnimateRectTime, getAnimateResizeAcceleration, getAnimateResizeTime, getAnimateScrollAcceleration, getAnimateScrollTime, getAnimateShowAcceleration, getAnimateShowTime, getAnimateTime, getAppImgDir, getAutoShowParent, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorder, getBottom, getById, getCanAcceptDrop, getCanDrag, getCanDragReposition, getCanDragResize, getCanDragScroll, getCanDrop, getCanDropBefore, getCanHover, getCanSelectText, getChildren, getChildrenSnapResizeToGrid, getChildrenSnapToGrid, getContents, getContextMenu, getCursor, getDataPath, getDefaultHeight, getDefaultWidth, getDestroyed, getDestroying, getDisabled, getDisabledCursor, getDoubleClickDelay, getDragAppearance, getDragIntersectStyle, getDragOpacity, getDragRepositionCursor, getDragScrollDelay, getDragStartDistance, getDragTarget, getDragType, getDynamicContents, getEdgeBackgroundColor, getEdgeCenterBackgroundColor, getEdgeImage, getEdgeOffset, getEdgeOpacity, getEdgeShowCenter, getEdgeSize, getExtraSpace, getFullDataPath, getGroupTitle, getHeight, getHeightAsString, getHoverAlign, getHoverDelay, getHoverHeight, getHoverHTML, getHoverMoveWithMouse, getHoverOpacity, getHoverStyle, getHoverVAlign, getHoverWidth, getHoverWrap, getHSnapOrigin, getHSnapOrigin, getHSnapPosition, getHSnapPosition, getHtmlPosition, getImgURL, getImgURL, getInnerContentHeight, getInnerContentWidth, getInnerHeight, getInnerWidth, getIsGroup, getLeft, getLeftAsString, getMargin, getMatchElement, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getMouseStillDownDelay, getMouseStillDownInitialDelay, getNextZIndex, getNoDoubleClicks, getOffsetHeight, getOffsetWidth, getOffsetX, getOffsetY, getOpacity, getOverflow, getPadding, getPageBottom, getPageLeft, getPageRect, getPageRight, getPageTop, getParentElement, getPercentBox, getPosition, getPrefix, getPrompt, getRect, getRedrawOnResize, getResizeBarTarget, getRight, getScrollbarSize, getScrollBottom, getScrollHeight, getScrollLeft, getScrollRight, getScrollTop, getScrollWidth, getShadowDepth, getShadowImage, getShadowOffset, getShadowSoftness, getShowCustomScrollbars, getShowDragShadow, getShowEdges, getShowHover, getShowResizeBar, getShowShadow, getSkinImgDir, getSnapAxis, getSnapEdge, getSnapHDirection, getSnapHGap, getSnapOffsetLeft, getSnapOffsetTop, getSnapOnDrop, getSnapResizeToGrid, getSnapTo, getSnapToGrid, getSnapVDirection, getSnapVGap, getStyleName, getTabIndex, getTitle, getTooltip, getTop, getTopAsString, getViewportHeight, getViewportWidth, getVisibility, getVisibleHeight, getVisibleWidth, getVSnapOrigin, getVSnapOrigin, getVSnapPosition, getVSnapPosition, getWidth, getWidthAsString, getZIndex, handleHover, hide, hideClickMask, hideClickMask, hideContextMenu, imgHTML, imgHTML, imgHTML, intersects, isDirty, isDisabled, isDrawn, isVisible, keyUp, layoutChildren, linkHTML, linkHTML, markForDestroy, markForRedraw, markForRedraw, moveAbove, moveBelow, moveBy, moveTo, parentResized, redraw, redraw, removeChild, removeChild, resizeBy, resizeTo, resizeTo, scrollBy, scrollByPercent, scrollTo, scrollTo, scrollToBottom, scrollToLeft, scrollToPercent, scrollToRight, scrollToTop, sendToBack, setAccessKey, setAlign, setAnimateAcceleration, setAnimateFadeTime, setAnimateHideAcceleration, setAnimateHideTime, setAnimateMoveAcceleration, setAnimateMoveTime, setAnimateRectAcceleration, setAnimateRectTime, setAnimateResizeAcceleration, setAnimateResizeTime, setAnimateScrollAcceleration, setAnimateScrollTime, setAnimateShowAcceleration, setAnimateShowTime, setAnimateTime, setAppImgDir, setAutoHeight, setAutoShowParent, setAutoWidth, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBottom, setCanAcceptDrop, setCanDrag, setCanDragReposition, setCanDragResize, setCanDragScroll, setCanDrop, setCanDropBefore, setCanHover, setCanSelectText, setChildren, setChildrenSnapResizeToGrid, setChildrenSnapToGrid, setContents, setContextMenu, setCursor, setDataPath, setDefaultHeight, setDefaultWidth, setDisabled, setDisabledCursor, setDoubleClickDelay, setDragAppearance, setDragIntersectStyle, setDragOpacity, setDragRepositionCursor, setDragScrollDelay, setDragStartDistance, setDragTarget, setDragType, setDropTypes, setDynamicContents, setEdgeBackgroundColor, setEdgeCenterBackgroundColor, setEdgeImage, setEdgeMarginSize, setEdgeOffset, setEdgeOpacity, setEdgeShowCenter, setEdgeSize, setExtraSpace, setGroupTitle, setHeight, setHeight, setHeight100, setHoverAlign, setHoverDelay, setHoverHeight, setHoverMoveWithMouse, setHoverOpacity, setHoverStyle, setHoverVAlign, setHoverWidth, setHoverWrap, setHtmlPosition, setImage, setImage, setIsGroup, setKeepInParentRect, setKeepInParentRect, setLayoutAlign, setLayoutAlign, setLeft, setLeft, setMargin, setMatchElement, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setMouseStillDownDelay, setMouseStillDownInitialDelay, setNoDoubleClicks, setOpacity, setOverflow, setPadding, setPageLeft, setPageTop, setParentElement, setPercentBox, setPosition, setPrefix, setPrompt, setRect, setRect, setRedrawOnResize, setResizeBarTarget, setResizeFrom, setRight, setScrollbarSize, setShadowDepth, setShadowImage, setShadowOffset, setShadowSoftness, setShowCustomScrollbars, setShowDragShadow, setShowEdges, setShowHover, setShowResizeBar, setShowShadow, setSkinImgDir, setSmoothFade, setSnapAxis, setSnapEdge, setSnapHDirection, setSnapHGap, setSnapOffsetLeft, setSnapOffsetTop, setSnapOnDrop, setSnapResizeToGrid, setSnapTo, setSnapToGrid, setSnapVDirection, setSnapVGap, setStyleName, setTabIndex, setTitle, setTooltip, setTop, setTop, setVisibility, setVisible, setWidth, setWidth, setWidth100, setZIndex, shouldDragScroll, show, showClickMask, showNextTo, showNextTo, showPrintPreview, updateHover, updateHover, updateShadow, visibleAtPoint, visibleAtPoint, willAcceptDrop
 
Methods inherited from class com.smartgwt.client.widgets.BaseWidget
addDrawHandler, destroy, doAddHandler, doInit, doOnRender, draw, equals, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getConfig, getDOM, getElement, getElement, getHandlerCount, getID, getInnerHTML, getJsObj, getOrCreateJsObj, getRef, hashCode, isConfigOnly, isCreated, onDestroy, onDraw, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setDragTracker, setElement, setHtmlElement, setID, setNullProperty, setPosition, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setPixelSize, setSize, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.smartgwt.client.widgets.DataBoundComponent
getOrCreateJsObj
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

DynamicForm

public DynamicForm()

DynamicForm

public DynamicForm(JavaScriptObject jsObj)
Method Detail

getOrCreateRef

public static DynamicForm getOrCreateRef(JavaScriptObject jsObj)

create

protected JavaScriptObject create()
Overrides:
create in class Canvas

setItemLayout

public void setItemLayout(FormLayoutType itemLayout)
Layout style to use with this form.

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:

Note : This is an advanced setting

Parameters:
itemLayout - itemLayout Default value is "table"

getItemLayout

public FormLayoutType getItemLayout()
Layout style to use with this form.

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:

Returns:
FormLayoutType

setNumCols

public void setNumCols(int numCols)
The number of columns of titles and items in this form's layout grid. A title and corresponding item each have their own column, so to display two form elements per row (each having a title and item), you would set this property to 4.

Parameters:
numCols - numCols Default value is 2

getNumCols

public int getNumCols()
The number of columns of titles and items in this form's layout grid. A title and corresponding item each have their own column, so to display two form elements per row (each having a title and item), you would set this property to 4.

Returns:
int

setFixedColWidths

public void setFixedColWidths(Boolean fixedColWidths)
If true, we ensure that column widths are at least as large as you specify them. This means that if any single column overflows (due to, eg, a long unbreakable title), the form as a whole overflows.

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.

Parameters:
fixedColWidths - fixedColWidths Default value is false

getFixedColWidths

public Boolean getFixedColWidths()
If true, we ensure that column widths are at least as large as you specify them. This means that if any single column overflows (due to, eg, a long unbreakable title), the form as a whole overflows.

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.

Returns:
Boolean

setMinColWidth

public void setMinColWidth(int minColWidth)
Minimum width of a form column.

Parameters:
minColWidth - minColWidth Default value is 20

getMinColWidth

public int getMinColWidth()
Minimum width of a form column.

Returns:
int

setCellPadding

public void setCellPadding(int cellPadding)
The amount of empty space, in pixels, surrounding each form item within its cell in the layout grid.

Parameters:
cellPadding - cellPadding Default value is 2

getCellPadding

public int getCellPadding()
The amount of empty space, in pixels, surrounding each form item within its cell in the layout grid.

Returns:
int

setCellBorder

public void setCellBorder(int cellBorder)
Width of border for the table that form is drawn in. This is primarily used for debugging form layout.

Parameters:
cellBorder - cellBorder Default value is 0

getCellBorder

public int getCellBorder()
Width of border for the table that form is drawn in. This is primarily used for debugging form layout.

Returns:
int

setSectionVisibilityMode

public void setSectionVisibilityMode(VisibilityMode sectionVisibilityMode)
If the form has sections, [implemented as SectionItems], this attribute controls whether multiple sections can be expanded at once.

Parameters:
sectionVisibilityMode - sectionVisibilityMode Default value is "multiple"

getSectionVisibilityMode

public VisibilityMode getSectionVisibilityMode()
If the form has sections, [implemented as SectionItems], this attribute controls whether multiple sections can be expanded at once.

Returns:
VisibilityMode

setLongTextEditorThreshold

public 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. Overridden by explicitly specifying editorType for the field.

Parameters:
longTextEditorThreshold - longTextEditorThreshold Default value is 255

getLongTextEditorThreshold

public 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. Overridden by explicitly specifying editorType for the field.

Returns:
int

setLongTextEditorType

public void setLongTextEditorType(String longTextEditorType)
Name of the Form Item class to use for text fields which exceed the longTextEditorThreshold for this form.

Parameters:
longTextEditorType - longTextEditorType Default value is "textArea"

getLongTextEditorType

public String getLongTextEditorType()
Name of the Form Item class to use for text fields which exceed the longTextEditorThreshold for this form.

Returns:
String

setTitleOrientation

public void setTitleOrientation(TitleOrientation titleOrientation)
Default orientation for titles for items in this form. 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.

Parameters:
titleOrientation - titleOrientation Default value is "left"

getTitleOrientation

public TitleOrientation getTitleOrientation()
Default orientation for titles for items in this form. 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.

Returns:
Return the orientation of the title for a specific item or the default title orientation if no item is passed.

setTitlePrefix

public void setTitlePrefix(String titlePrefix)
The string prepended to the title of every item in this form.

Parameters:
titlePrefix - titlePrefix Default value is ""

getTitlePrefix

public String getTitlePrefix()
The string prepended to the title of every item in this form.

Returns:
String

setRightTitlePrefix

public void setRightTitlePrefix(String rightTitlePrefix)
The string prepended to the title of an item in this form if its titleOrientation property is set to "right".

Parameters:
rightTitlePrefix - rightTitlePrefix Default value is ": "

getRightTitlePrefix

public String getRightTitlePrefix()
The string prepended to the title of an item in this form if its titleOrientation property is set to "right".

Returns:
String

setTitleSuffix

public void setTitleSuffix(String titleSuffix)
The string appended to the title of every item in this form.

Parameters:
titleSuffix - titleSuffix Default value is " :"

getTitleSuffix

public String getTitleSuffix()
The string appended to the title of every item in this form.

Returns:
String

setRightTitleSuffix

public void setRightTitleSuffix(String rightTitleSuffix)
The string appended to the title of an item in this form if its titleOrientation property is set to "right".

Parameters:
rightTitleSuffix - rightTitleSuffix Default value is ""

getRightTitleSuffix

public String getRightTitleSuffix()
The string appended to the title of an item in this form if its titleOrientation property is set to "right".

Returns:
String

setWrapItemTitles

public void setWrapItemTitles(Boolean wrapItemTitles)
Whether titles for form items should wrap. If not specified, titles will wrap by default. Can be overridden for individual items via wrapTitle

Parameters:
wrapItemTitles - wrapItemTitles Default value is null

getWrapItemTitles

public Boolean getWrapItemTitles()
Whether titles for form items should wrap. If not specified, titles will wrap by default. Can be overridden for individual items via wrapTitle

Returns:
Boolean

setShowInlineErrors

public void setShowInlineErrors(Boolean showInlineErrors)
If true, field errors are written into the form next to the item(s) where the errors occurred. Errors may appear as text or just an icon (via showErrorText:false}.

If false, errors are written at the top of the form.

To do some other kind of error display, override showErrors().

Parameters:
showInlineErrors - showInlineErrors Default value is true

getShowInlineErrors

public Boolean getShowInlineErrors()
If true, field errors are written into the form next to the item(s) where the errors occurred. Errors may appear as text or just an icon (via showErrorText:false}.

If false, errors are written at the top of the form.

To do some other kind of error display, override showErrors().

Returns:
Boolean

setShowErrorIcons

public void setShowErrorIcons(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.

Parameters:
showErrorIcons - showErrorIcons Default value is true

getShowErrorIcons

public 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.

Returns:
Boolean

setShowErrorText

public void setShowErrorText(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.

Parameters:
showErrorText - showErrorText Default value is false

getShowErrorText

public 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.

Returns:
Boolean

setShowErrorStyle

public void setShowErrorStyle(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.

Parameters:
showErrorStyle - showErrorStyle Default value is true

getShowErrorStyle

public 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.

Returns:
Boolean

setErrorItemCellStyle

public void setErrorItemCellStyle(String errorItemCellStyle)
                           throws IllegalStateException
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.

Parameters:
errorItemCellStyle - errorItemCellStyle Default value is "formCellError"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getErrorItemCellStyle

public 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.

Returns:
String

setErrorsPreamble

public void setErrorsPreamble(String errorsPreamble)
                       throws IllegalStateException
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.

Parameters:
errorsPreamble - errorsPreamble Default value is "The following errors were found"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getErrorsPreamble

public 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.

Returns:
String

setShowTitlesWithErrorMessages

public void setShowTitlesWithErrorMessages(Boolean showTitlesWithErrorMessages)
Indicates whether on validation failure, the error message displayed to the user should be prepended with the title for the item.

Parameters:
showTitlesWithErrorMessages - showTitlesWithErrorMessages Default value is false

getShowTitlesWithErrorMessages

public Boolean getShowTitlesWithErrorMessages()
Indicates whether on validation failure, the error message displayed to the user should be prepended with the title for the item.

Returns:
Boolean

setHiliteRequiredFields

public void setHiliteRequiredFields(Boolean hiliteRequiredFields)
Indicates whether the titles of required items in this form should use the special prefix and suffix specified by the next two properties, instead of the standard prefix and suffix.

Parameters:
hiliteRequiredFields - hiliteRequiredFields Default value is true

getHiliteRequiredFields

public 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.

Returns:
Boolean

setRequiredTitlePrefix

public void setRequiredTitlePrefix(String requiredTitlePrefix)
The string prepended to the title of every required item in this form if highlightRequiredFields is true.

Parameters:
requiredTitlePrefix - requiredTitlePrefix Default value is ""

getRequiredTitlePrefix

public String getRequiredTitlePrefix()
The string prepended to the title of every required item in this form if highlightRequiredFields is true.

Returns:
String

setRequiredRightTitlePrefix

public void setRequiredRightTitlePrefix(String requiredRightTitlePrefix)
The string prepended to the title of every required item in this form if highlightRequiredFields is true and the titleOrientation property is set to "right".

Parameters:
requiredRightTitlePrefix - requiredRightTitlePrefix Default value is ": "

getRequiredRightTitlePrefix

public 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".

Returns:
String

setRequiredTitleSuffix

public void setRequiredTitleSuffix(String requiredTitleSuffix)
The string appended to the title of every required item in this form if highlightRequiredFields is true.

Parameters:
requiredTitleSuffix - requiredTitleSuffix Default value is " :"

getRequiredTitleSuffix

public String getRequiredTitleSuffix()
The string appended to the title of every required item in this form if highlightRequiredFields is true.

Returns:
String

setRequiredRightTitleSuffix

public void setRequiredRightTitleSuffix(String requiredRightTitleSuffix)
The string appended to the title of every required item in this form if highlightRequiredFields is true and the titleOrientation property is set to "right".

Parameters:
requiredRightTitleSuffix - requiredRightTitleSuffix Default value is ""

getRequiredRightTitleSuffix

public 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".

Returns:
String

setItemHoverDelay

public 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?

Parameters:
itemHoverDelay - itemHoverDelay Default value is 500

getItemHoverDelay

public 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?

Returns:
int

setItemHoverWidth

public void setItemHoverWidth(Integer itemHoverWidth)
A default width for hovers shown for items

Parameters:
itemHoverWidth - itemHoverWidth Default value is null

getItemHoverWidth

public Integer getItemHoverWidth()
A default width for hovers shown for items

Returns:
Integer

setItemHoverHeight

public void setItemHoverHeight(Integer itemHoverHeight)
A default height for hovers shown for items

Parameters:
itemHoverHeight - itemHoverHeight Default value is null

getItemHoverHeight

public Integer getItemHoverHeight()
A default height for hovers shown for items

Returns:
Integer

setItemHoverAlign

public void setItemHoverAlign(Alignment itemHoverAlign)
Text alignment for hovers shown for items

Parameters:
itemHoverAlign - itemHoverAlign Default value is null

getItemHoverAlign

public Alignment getItemHoverAlign()
Text alignment for hovers shown for items

Returns:
Alignment

setItemHoverVAlign

public void setItemHoverVAlign(Integer itemHoverVAlign)
Vertical text alignment for hovers shown for items

Parameters:
itemHoverVAlign - itemHoverVAlign Default value is null

getItemHoverVAlign

public Integer getItemHoverVAlign()
Vertical text alignment for hovers shown for items

Returns:
Integer

setItemHoverStyle

public void setItemHoverStyle(String itemHoverStyle)
CSS Style for hovers shown for items

Parameters:
itemHoverStyle - itemHoverStyle Default value is "formHover"

getItemHoverStyle

public String getItemHoverStyle()
CSS Style for hovers shown for items

Returns:
String

setItemHoverOpacity

public void setItemHoverOpacity(Integer itemHoverOpacity)
Opacity for hovers shown for items

Parameters:
itemHoverOpacity - itemHoverOpacity Default value is null

getItemHoverOpacity

public Integer getItemHoverOpacity()
Opacity for hovers shown for items

Returns:
Integer

setValidateOnChange

public void setValidateOnChange(Boolean validateOnChange)
If true, form fields will be validated when each item's "change" handler is fired as well as when the entire form is submitted or validated.
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.

Parameters:
validateOnChange - validateOnChange Default value is false

getValidateOnChange

public 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.

Returns:
Boolean

setRejectInvalidValueOnChange

public void setRejectInvalidValueOnChange(Boolean rejectInvalidValueOnChange)
If validateOnChange is true, and validation fails for an item on change, with no suggested value, should we revert to the previous value, or continue to display the bad value entered by the user. May be set at the item or form level.

Note : This is an advanced setting

Parameters:
rejectInvalidValueOnChange - rejectInvalidValueOnChange Default value is null

getRejectInvalidValueOnChange

public 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. May be set at the item or form level.

Returns:
Boolean

setUnknownErrorMessage

public void setUnknownErrorMessage(String unknownErrorMessage)
The error message for a failed validator that does not specify its own errorMessage.

Parameters:
unknownErrorMessage - unknownErrorMessage Default value is "Invalid value"

getUnknownErrorMessage

public String getUnknownErrorMessage()
The error message for a failed validator that does not specify its own errorMessage.

Returns:
String

setAutoFocus

public void setAutoFocus(Boolean autoFocus)
If true, when the form is drawn, focus will automatically be put into the first focusable element in the form.
Note that to put focus in a different item you can explicitly call dynamicForm.focusInItem(itemName)

Parameters:
autoFocus - autoFocus Default value is false

getAutoFocus

public 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)

Returns:
Boolean

setSelectOnFocus

public void setSelectOnFocus(Boolean selectOnFocus)
If this property is set to true, whenever a text-based field in this form (TextItem, TextAreaItem) is given focus programmatically (see 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 Smart GWT 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.

Parameters:
selectOnFocus - selectOnFocus Default value is false

getSelectOnFocus

public 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.

Note that this flag affects only programmatic focus. It's the normal behavior of text fields to select all text if the user navigates into them via keyboard, or if the user navigates via mouse, to place the text insertion point at the mouse click, and Smart GWT preserves these behaviors. selectOnFocus 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.

Returns:
Boolean

setCanFocus

public void setCanFocus(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. This property will only govern whether the form may recieve focus if the form contains no focusable items.

Note : This is an advanced setting

Overrides:
setCanFocus in class Canvas
Parameters:
canFocus - canFocus Default value is true

getCanFocus

public 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. This property will only govern whether the form may recieve focus if the form contains no focusable items.

Overrides:
getCanFocus in class Canvas
Returns:
Boolean

setValidationURL

public void setValidationURL(String validationURL)
validationURL can be set to do server-side validation against a different URL from where the form will ultimately save, as part of an incremental upgrade strategy for Struts and Struts-like applications.

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.

Parameters:
validationURL - validationURL Default value is null

getValidationURL

public 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.

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.

Returns:
String

setDisableValidation

public void setDisableValidation(Boolean disableValidation)
If set to true, client-side validators will not run on the form when validate() is called. Server-side validatiors (if any) will still run on attempted save.

Parameters:
disableValidation - disableValidation Default value is null

getDisableValidation

public Boolean getDisableValidation()
If set to true, client-side validators will not run on the form when validate() is called. Server-side validatiors (if any) will still run on attempted save.

Returns:
Boolean

setCancelParamName

public void setCancelParamName(String cancelParamName)
The name of the special field sent to the server as part of cancel()

Parameters:
cancelParamName - cancelParamName Default value is "org.apache.struts.taglib.html.CANCEL"

getCancelParamName

public String getCancelParamName()
The name of the special field sent to the server as part of cancel()

Returns:
String

setCancelParamValue

public void setCancelParamValue(String cancelParamValue)
The value of the special field sent to the server as part of cancel()

Parameters:
cancelParamValue - cancelParamValue Default value is "cancel"

getCancelParamValue

public String getCancelParamValue()
The value of the special field sent to the server as part of cancel()

Returns:
String

setAction

public void setAction(String action)
The URL to which the form will submit its values.

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.

Parameters:
action - New action URL. Default value is "#"

getAction

public String getAction()
The URL to which the form will submit its values.

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.

Returns:
String

setTarget

public void setTarget(String target)
The name of a window or frame that will receive the results returned by the form's action. The default null indicates to use the current frame.

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'. Sets the 'target' for this form.

Note : This is an advanced setting

Parameters:
target - New submission target. Default value is null

getTarget

public String getTarget()
The name of a window or frame that will receive the results returned by the form's action. The default null indicates to use the current frame.

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'.

Returns:
String

setMethod

public void setMethod(FormMethod method)
The mechanism by which form data is sent to the action URL. See FormMethod type for details.

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'. Sets the 'method' for this form.

Parameters:
method - html form submission method (get or post). Default value is DynamicForm.POST

getMethod

public FormMethod getMethod()
The mechanism by which form data is sent to the action URL. See FormMethod type for details.

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'.

Returns:
FormMethod

setEncoding

public void setEncoding(Encoding encoding)
encoding for the form, use MULTIPART_ENCODING for file upload forms

Note : This is an advanced setting

Parameters:
encoding - encoding Default value is DynamicForm.NORMAL

getEncoding

public Encoding getEncoding()
encoding for the form, use MULTIPART_ENCODING for file upload forms

Returns:
Encoding

setCanSubmit

public void setCanSubmit(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.

Note : This is an advanced setting

Parameters:
canSubmit - canSubmit Default value is false

getCanSubmit

public 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.

Returns:
Boolean

setSaveOnEnter

public void setSaveOnEnter(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.

Parameters:
saveOnEnter - saveOnEnter Default value is false

getSaveOnEnter

public 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.

Returns:
Boolean

setShowComplexFieldsRecursively

public void setShowComplexFieldsRecursively(Boolean showComplexFieldsRecursively)
                                     throws IllegalStateException
If set, this 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.

Parameters:
showComplexFieldsRecursively - showComplexFieldsRecursively Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowComplexFieldsRecursively

public Boolean getShowComplexFieldsRecursively()
If set, this 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.

Returns:
Boolean

setFormSubmitFailedWarning

public void setFormSubmitFailedWarning(String formSubmitFailedWarning)
Warning to display to the user if an attempt to submitForm() a form is unable to submit to the server. The most common cause for this failure is that the user has typed an invalid file-path into an upload type field.

Note : This is an advanced setting

Parameters:
formSubmitFailedWarning - formSubmitFailedWarning Default value is "Form was unable to be submitted. The most likely cause for this is an invalid value in an upload field."

getFormSubmitFailedWarning

public String getFormSubmitFailedWarning()
Warning to display to the user if an attempt to submitForm() a form is unable to submit to the server. The most common cause for this failure is that the user has typed an invalid file-path into an upload type field.

Returns:
String

setSaveOperationType

public 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).

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()

Parameters:
saveOperationType - Operation type to use as a default. Valid values are "add" or "update".. Default value is null

getSaveOperationType

public 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).

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.

Returns:
Returns the 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.


setAutoFetchTextMatchStyle

public void setAutoFetchTextMatchStyle(TextMatchStyle autoFetchTextMatchStyle)
                                throws IllegalStateException
If autoFetchData is true, this attribute allows the developer to specify a textMatchStyle for the initial fetchData() call.

Parameters:
autoFetchTextMatchStyle - autoFetchTextMatchStyle Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getAutoFetchTextMatchStyle

public TextMatchStyle getAutoFetchTextMatchStyle()
If autoFetchData is true, this attribute allows the developer to specify a textMatchStyle for the initial fetchData() call.

Returns:
TextMatchStyle

resetValues

public void resetValues()
Same as reset().


clearValues

public void clearValues()
Reset to default form values and clear errors


valuesHaveChanged

public Boolean valuesHaveChanged()
Compares the current set of values with the values stored by the call to the rememberValues() method. Returns true if the values have changed, and false otherwise.

Returns:
true if current values do not match remembered values

getValuesAsAdvancedCriteria

public AdvancedCriteria getValuesAsAdvancedCriteria()
Return an AdvancedCriteria object based on the current set of values within this form.

Similar to getValuesAsCriteria(), except the returned criteria object is guaranteed to be an AdvancedCriteria object, even if none of the form's fields has a specified operator

Returns:
a ${isc.DocUtils.linkForRef('object:AdvancedCriteria')} based on the form's current values

setValue

public void setValue(String fieldName,
                     String value)
Sets the value for some field

Parameters:
fieldName - Name of the field being updated. A com.smartgwt.client..dataPath may be passed to set nested values
value - New value.

clearValue

public void clearValue(String fieldName)
Clears the value for some field via a call to 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.

Parameters:
fieldName - Name of the field being cleared. A com.smartgwt.client..dataPath may be used for clearing details of nested data structures.

showItem

public void showItem(String itemName)
Show a form item via FormItem.show()

Parameters:
itemName - Name of the item to show

hideItem

public void hideItem(String itemName)
Hide a form item via FormItem.hide()

Parameters:
itemName - Name of the item to show

clearFieldErrors

public void clearFieldErrors(String fieldName,
                             boolean show)
Clear any validation errors on the field passed in.

Parameters:
fieldName - field to clear errors from
show - If true this method will fall through to showFieldErrors(java.lang.String) to update the display

clearErrors

public void clearErrors(boolean show)
Clears all errors for this DynamicForm.

Parameters:
show - If true, redraw the form to clear any visible error messages.

hasErrors

public 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).

Returns:
true == form currently has validation errors.

hasFieldErrors

public Boolean hasFieldErrors(String fieldName)
Does this form currently h ave any validation errors on the field passed in?
Validation errors are set up automatically by validation, or may be explicitly set via setErrors(java.util.Map, boolean) or setFieldErrors(java.lang.String, java.lang.String, boolean).

Parameters:
fieldName - field to test for validation errors
Returns:
true if the form has outstanding errors for the field in question.

submitForm

public 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.

Notes:


addFormSubmitFailedHandler

public HandlerRegistration addFormSubmitFailedHandler(FormSubmitFailedHandler handler)
Add a formSubmitFailed handler.

Method called when an attempt to submitForm() a form is unable to submit to the server. Default behavior is to display the formSubmitFailedWarning in a warning dialog. The most common cause for this failure is that the user has typed an invalid file-path into an upload type field.

Specified by:
addFormSubmitFailedHandler in interface HasFormSubmitFailedHandlers
Parameters:
handler - the formSubmitFailed handler
Returns:
HandlerRegistration used to remove this handler

validate

public Boolean validate(boolean validateHiddenFields)
Validates the form without submitting it, and redraws the form to display error messages if there are any validation errors. Returns true if validation succeeds, or false if validation fails.
For databound forms, any Datasource field validators will be run even if there is no associated item in the form.
Validators will also be run on hidden form items
In both these cases, validation failure can be handled via com.smartgwt.client.widgets.form.DynamicForm#handleHiddenValidationErrors

Parameters:
validateHiddenFields - Should validators be processed for non-visible fields such as dataSource fields with no associated item or fields with visibility set to "hidden"?
Returns:
true if validation succeeds, or false if validation fails.

showFieldErrors

public void showFieldErrors(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().

Parameters:
fieldName - field to show errors for

addItemChangedHandler

public HandlerRegistration addItemChangedHandler(ItemChangedHandler handler)
Add a itemChanged 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.

Specified by:
addItemChangedHandler in interface HasItemChangedHandlers
Parameters:
handler - the itemChanged handler
Returns:
HandlerRegistration used to remove this handler

addItemChangeHandler

public HandlerRegistration addItemChangeHandler(ItemChangeHandler handler)
Add a itemChange 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.

Specified by:
addItemChangeHandler in interface HasItemChangeHandlers
Parameters:
handler - the itemChange handler
Returns:
HandlerRegistration used to remove this handler

addItemKeyPressHandler

public HandlerRegistration addItemKeyPressHandler(ItemKeyPressHandler handler)
Add a itemKeyPress 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.

Specified by:
addItemKeyPressHandler in interface HasItemKeyPressHandlers
Parameters:
handler - the itemKeyPress handler
Returns:
HandlerRegistration used to remove this handler

addSubmitValuesHandler

public HandlerRegistration addSubmitValuesHandler(SubmitValuesHandler handler)
Add a submitValues handler.

Triggered when a SubmitItem is included in the form is submitted and gets pressed.

Specified by:
addSubmitValuesHandler in interface HasSubmitValuesHandlers
Parameters:
handler - the submitValues handler
Returns:
HandlerRegistration used to remove this handler

validateData

public void validateData()
Perform validation on the client and the server.


reset

public void reset()
Resets values to the state it was the last time 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.


cancel

public 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. When this method is called, an RPC is sent to the server with a parameter named 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});
 


cancel

public 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. When this method is called, an RPC is sent to the server with a parameter named 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});
 

Parameters:
requestProperties - additional properties to set on the RPCRequest that will be issued

isNewRecord

public Boolean isNewRecord()
Returns true if saveOperationType is currently "add". See saveOperationType.

Returns:
whether this form will use an "add" operation when saving

onInit

protected void onInit()
Overrides:
onInit in class BaseWidget

showErrors

public 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).
Default implementation will redraw the form to display error messages and call 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.


setValuesManager

public void setValuesManager(ValuesManager valuesManager)
                      throws IllegalStateException
If set at init time, this dynamicForm will be created as a member form for the specified valuesManager. To update the valuesManager to which a form belongs after init use valuesManager.addMember(form) and valuesManager.removeMember(form)

Note : This is an advanced setting

Overrides:
setValuesManager in class Canvas
Parameters:
valuesManager - valuesManager Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getValuesManager

public ValuesManager getValuesManager()
Return the ValuesManager for this form.

Overrides:
getValuesManager in class Canvas
Returns:
the ValuesManager

setCellSpacing

public void setCellSpacing(int cellSpacing)
                    throws IllegalStateException
Set the cellSpacing.

Parameters:
cellSpacing - the cellSpacing
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getCellSpacing

public int getCellSpacing()
Return the cellSpacing.

Returns:
the cellSpacing

setUseAllDataSourceFields

public 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.

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.

Parameters:
useAllDataSourceFields - useAllDataSourceFields

setValues

public void setValues(Map values)
et the values for this DynamicForm. Member forms will be updated as required by this change. Note that pre-existant values in other fields are cleared out by this. .

Parameters:
values - the values

getValues

public 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.

Returns:
the values

setValue

public void setValue(String fieldName,
                     double value)
Set the value for some field.

Parameters:
fieldName - Name of the field being updated
value - New value.

setValue

public void setValue(String fieldName,
                     boolean value)
Set the value for some field.

Parameters:
fieldName - Name of the field being updated
value - New value.

setValue

public void setValue(String fieldName,
                     Map value)
Set the value for some field.

Parameters:
fieldName - Name of the field being updated
value - New value.

setValue

public void setValue(String fieldName,
                     JavaScriptObject value)
Set the value for some field.

Parameters:
fieldName - Name of the field being updated
value - New value.

setValue

public void setValue(String fieldName,
                     Record value)
Set the value for some field.

Parameters:
fieldName - Name of the field being updated
value - New value.

setValue

public void setValue(String fieldName,
                     DataClass value)
Set the value for some field.

Parameters:
fieldName - Name of the field being updated
value - New value.

setValue

public void setValue(String fieldName,
                     Record[] value)
Set the value for some field.

Parameters:
fieldName - Name of the field being updated
value - New value.

setValue

public void setValue(String fieldName,
                     DataClass[] value)
Set the value for some field.

Parameters:
fieldName - Name of the field being updated
value - New value.

setItems

public void setItems(FormItem... items)
Synonym for setFields(com.smartgwt.client.widgets.form.fields.FormItem[]).

Parameters:
items - the items

setOperator

public void setOperator(OperatorId operator)
                 throws IllegalStateException
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.

Parameters:
operator - operator Default value is "and"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getOperator

public 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.

Returns:
OperationId

setFields

public void setFields(FormItem... fields)
An array of field objects, specifying the order, layout, and types of each field in the DynamicForm. When both 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.

Parameters:
fields - form item fields

getFields

public FormItem[] getFields()
Return thhe form fields

Returns:
the form fields

getItem

public FormItem getItem(String name)

getField

public FormItem getField(String name)

getValueAsString

public String getValueAsString(String fieldName)

getValue

public Object getValue(String fieldName)

validate

public boolean validate()
Validates the form without submitting it, and redraws the form to display error messages if there are any validation errors. Returns true if validation succeeds, or false if validation fails.
For databound forms, any Datasource field validators will be run even if there is no associated item in the form.
Validators will also be run on hidden form items
In both these cases, validation failure can be handled via com.smartgwt.client.widgets.form.DynamicForm#handleHiddenValidationErrors

Returns:
true if validation succeeds, or false if validation fails.

editNewRecord

public void editNewRecord()
Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified). Subsequent calls to saveData() will use an add rather than an update operation.


editNewRecord

public void editNewRecord(Map initialValues)
Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified). Subsequent calls to saveData() will use an add rather than an update operation.

Parameters:
initialValues - initial set of values for the editor as a map of field names to their corresponding values

editSelectedData

public void editSelectedData(ListGrid selectionComponent)

editSelectedData

public void editSelectedData(String listGridID)

getValuesAsCriteria

public Criteria getValuesAsCriteria()

setColWidths

public void setColWidths(Object... colWidths)
An array of widths for the columns of items in this form's layout grid.

If specified, these widths should sum to the total width of the form (form.width). If not specified, we assume every other column will contain form item titles, and so should have form.titleWidth, and all other columns should share the remaining space.

Acceptable values for each element in the array are:

Parameters:
colWidths - the column widths

setTitleWidth

public void setTitleWidth(int titleWidth)
The width in pixels allocated to the title of every item in this form. If you don't specify explicit colWidths, you can set this value to the string "*" to divide the usable space evenly between titles and fields.

Parameters:
titleWidth - the title width

setTitleWidth

public void setTitleWidth(String titleWidth)
The width in pixels allocated to the title of every item in this form. If you don't specify explicit colWidths, you can set this value to the string "*" to divide the usable space evenly between titles and fields.

Parameters:
titleWidth - the title width

setErrorOrientation

public void setErrorOrientation(FormErrorOrientation errorOrientation)
If DynamicForm.showInlineErrors is true, where should the error icon and text appear relative to form items? Valid options are "top", "bottom", "left" or "right".

May be overridden at the item level via FormItem.setErrorOrientation(com.smartgwt.client.types.FormErrorOrientation).

Parameters:
errorOrientation - the error orientation

saveData

public void saveData()

saveData

public void saveData(DSCallback callback)

saveData

public void saveData(DSCallback callback,
                     DSRequest requestProperties)

submit

public void submit()
submit() is automatically called when a SubmitItem included in the form is clicked, or, if saveOnEnter is set, when the "Enter" key is pressed in a text input. Submit can also be manually called.

If com.smartgwt.client.widgets.form.DynamicForm#submitValues exists, it will be called, then immediately return.

Otherwise, default behavior varies based on canSubmit: if canSubmit is false, saveData() will be called to handle saving via Smart GWT databinding.

If canSubmit is true, the form will be submitted like an ordinary HTML form via submitForm().

The parameters to submit() apply only if submit() will be calling ValuesManager.saveData(). If you override submit(), you can safely ignore the parameters as Smart GWT framework code does not pass them.


submit

public void submit(DSCallback callback)
submit() is automatically called when a SubmitItem included in the form is clicked, or, if saveOnEnter is set, when the "Enter" key is pressed in a text input. Submit can also be manually called.

If com.smartgwt.client.widgets.form.DynamicForm#submitValues exists, it will be called, then immediately return.

Otherwise, default behavior varies based on canSubmit: if canSubmit is false, saveData() will be called to handle saving via Smart GWT databinding.

If canSubmit is true, the form will be submitted like an ordinary HTML form via submitForm().

The parameters to submit() apply only if submit() will be calling ValuesManager.saveData(). If you override submit(), you can safely ignore the parameters as Smart GWT framework code does not pass them.

Parameters:
callback - callback to invoke on completion. [Ignored if canSubmit is true]

submit

public void submit(DSCallback callback,
                   DSRequest requestProperties)
submit() is automatically called when a SubmitItem included in the form is clicked, or, if saveOnEnter is set, when the "Enter" key is pressed in a text input. Submit can also be manually called.

If com.smartgwt.client.widgets.form.DynamicForm#submitValues exists, it will be called, then immediately return.

Otherwise, default behavior varies based on canSubmit: if canSubmit is false, saveData() will be called to handle saving via Smart GWT databinding.

If canSubmit is true, the form will be submitted like an ordinary HTML form via submitForm().

The parameters to submit() apply only if submit() will be calling ValuesManager.saveData(). If you override submit(), you can safely ignore the parameters as Smart GWT framework code does not pass them.

Parameters:
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]

editRecord

public void editRecord(Record record)
Edit an existing record. Updates this editors values to match the values of the record passed in.

Subsequent calls to saveData() will use an update rather than an add operation.

Parameters:
record - the record to be edited as a map of field names to their corresponding values

focusInItem

public void focusInItem(int itemNumber)
Move the keyboard focus into a particular item.

Parameters:
itemNumber - the item number

focusInItem

public void focusInItem(String itemName)
Move the keyboard focus into a particular item.

Parameters:
itemName - the item name

focusInItem

public void focusInItem(FormItem formItem)
Move the keyboard focus into a particular item.

Parameters:
formItem - the form item

setErrors

public void setErrors(Map errors,
                      boolean showErrors)
Setter for validation errors on this form. Errors passed in should be a Map in the format {fieldName1:errors, fieldName2:errors} Where the errors value may be either a string (single error message) or an array of strings (if multiple errors should be applied to the field in question).

Parameters:
errors - list of errors as a map with the field names as keys
showErrors - 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.

getErrors

public Map getErrors()
Returns the set of errors.

Returns:
errors. key is field name, value is error. Returns null if no errors are present

setFieldErrors

public void setFieldErrors(String fieldName,
                           String error,
                           boolean showErrors)
Set field validation error for some field. The showErrors parameter allows the errors to be displayed immediately. Alternatively, an explicit call to showFieldErrors(java.lang.String) will display the errors for this field.

Parameters:
fieldName - field to apply the new errors to
error - error to apply to the field in question
showErrors - If true this method will fall through to DynamicForm.showFieldErrors() to update the display

setFieldErrors

public void setFieldErrors(String fieldName,
                           String[] errors,
                           boolean showErrors)
Set field validation errors for some field. The showErrors parameter allows the errors to be displayed immediately. Alternatively, an explicit call to showFieldErrors(java.lang.String) will display the errors for this field.

Parameters:
fieldName - field to apply the new errors to
errors - errors to apply to the field in question
showErrors - If true this method will fall through to DynamicForm.showFieldErrors() to update the display

getFieldErrors

public String[] getFieldErrors(String fieldName)
Returns any validation errors for some field in this valuesManager. If no errors are present, will return null.

Parameters:
fieldName - the field name
Returns:
error messages for the field.

rememberValues

public JavaScriptObject rememberValues()
Make a snapshot of the current set of values, so we can reset to them later. Creates a new object, then adds all non-method properties of values to the new object. Use resetValues() to revert to these values. Note that this method is automatically called when the values for this form are set programmatically via a call to DynamicForm.setValues().

Returns:
copy of current form values

valuesAreValid

public boolean valuesAreValid(boolean validateHiddenFields)
Method to determine whether the current form values would pass validation. This method will run validators on the form's values and return a value indicating whether validation was successful.

Unlike DynamicForm.validate() this method will not store the errors on the DynamicForm or display them to the user.

Parameters:
validateHiddenFields - Should validators be processed for non-visible fields such as dataSource fields with no associated item or fields with visibility set to "hidden"?
Returns:
boolean value indicating success or failure of validation

setItemHoverFormatter

public 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. Return null to suppress the hover canvas altogether.

Parameters:
hoverFormatter - the hover formatter

setItemTitleHoverFormatter

public 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. Return null to suppress the hover canvas altogether.

Parameters:
hoverFormatter - the hover formatter

setDataFetchMode

public void setDataFetchMode(FetchMode fetchMode)
Description copied from interface: DataBoundComponent
How to fetch and manage records retrieve from the server. See FetchMode.

This setting only applies to the ResultSet automatically created by calling fetchData. If a pre-existing ResultSet is passed to setData() instead, it's existing setting for fetchMode applies.

Specified by:
setDataFetchMode in interface DataBoundComponent
Parameters:
fetchMode - the fetch mode

getDataFetchMode

public FetchMode getDataFetchMode()
Description copied from interface: DataBoundComponent
How to fetch and manage records retrieve from the server. See FetchMode.

This setting only applies to the ResultSet automatically created by calling fetchData. If a pre-existing ResultSet is passed to setData() instead, it's existing setting for fetchMode applies.

Specified by:
getDataFetchMode in interface DataBoundComponent
Returns:
the fetch mode

setDataPageSize

public void setDataPageSize(int dataPageSize)
Description copied from interface: DataBoundComponent
When using data paging, how many records to fetch at a time. The value of this attribute is passed on to the auto-constructed 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.

Specified by:
setDataPageSize in interface DataBoundComponent
Parameters:
dataPageSize - dataPageSize Default value is 75

getDataPageSize

public int getDataPageSize()
Description copied from interface: DataBoundComponent
When using data paging, how many records to fetch at a time. The value of this attribute is passed on to the auto-constructed 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.

Specified by:
getDataPageSize in interface DataBoundComponent
Returns:
int

setUseAllDataSourceFields

public void setUseAllDataSourceFields(Boolean useAllDataSourceFields)
Description copied from interface: DataBoundComponent
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.

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.

Specified by:
setUseAllDataSourceFields in interface DataBoundComponent
Parameters:
useAllDataSourceFields - useAllDataSourceFields Default value is false

getUseAllDataSourceFields

public Boolean getUseAllDataSourceFields()
Description copied from interface: DataBoundComponent
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.

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.

Specified by:
getUseAllDataSourceFields in interface DataBoundComponent
Returns:
Boolean

setShowHiddenFields

public void setShowHiddenFields(Boolean showHiddenFields)
Description copied from interface: DataBoundComponent
Whether to show fields marked 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.

Specified by:
setShowHiddenFields in interface DataBoundComponent
Parameters:
showHiddenFields - showHiddenFields Default value is false

getShowHiddenFields

public Boolean getShowHiddenFields()
Description copied from interface: DataBoundComponent
Whether to show fields marked 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.

Specified by:
getShowHiddenFields in interface DataBoundComponent
Returns:
Boolean

setShowDetailFields

public void setShowDetailFields(Boolean showDetailFields)
Description copied from interface: DataBoundComponent
Whether to show fields marked 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.

Specified by:
setShowDetailFields in interface DataBoundComponent
Parameters:
showDetailFields - showDetailFields Default value is false

getShowDetailFields

public Boolean getShowDetailFields()
Description copied from interface: DataBoundComponent
Whether to show fields marked 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.

Specified by:
getShowDetailFields in interface DataBoundComponent
Returns:
Boolean

setShowComplexFields

public void setShowComplexFields(Boolean showComplexFields)
Description copied from interface: DataBoundComponent
Whether to show fields of non-atomic types when a DataBoundComponent is given a DataSource but no 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

Specified by:
setShowComplexFields in interface DataBoundComponent
Parameters:
showComplexFields - showComplexFields Default value is true

getShowComplexFields

public Boolean getShowComplexFields()
Description copied from interface: DataBoundComponent
Whether to show fields of non-atomic types when a DataBoundComponent is given a DataSource but no 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.

Specified by:
getShowComplexFields in interface DataBoundComponent
Returns:
Boolean

setFetchOperation

public void setFetchOperation(String fetchOperation)
Description copied from interface: DataBoundComponent
Operation ID this component should use when performing fetch operations.

Specified by:
setFetchOperation in interface DataBoundComponent
Parameters:
fetchOperation - fetchOperation Default value is null

getFetchOperation

public String getFetchOperation()
Description copied from interface: DataBoundComponent
Operation ID this component should use when performing fetch operations.

Specified by:
getFetchOperation in interface DataBoundComponent
Returns:
String

setUpdateOperation

public void setUpdateOperation(String updateOperation)
Description copied from interface: DataBoundComponent
Operation ID this component should use when performing update operations.

Specified by:
setUpdateOperation in interface DataBoundComponent
Parameters:
updateOperation - updateOperation Default value is null

getUpdateOperation

public String getUpdateOperation()
Description copied from interface: DataBoundComponent
Operation ID this component should use when performing update operations.

Specified by:
getUpdateOperation in interface DataBoundComponent
Returns:
String

setAddOperation

public void setAddOperation(String addOperation)
Description copied from interface: DataBoundComponent
Operation ID this component should use when performing add operations.

Specified by:
setAddOperation in interface DataBoundComponent
Parameters:
addOperation - addOperation Default value is null

getAddOperation

public String getAddOperation()
Description copied from interface: DataBoundComponent
Operation ID this component should use when performing add operations.

Specified by:
getAddOperation in interface DataBoundComponent
Returns:
String

setRemoveOperation

public void setRemoveOperation(String removeOperation)
Description copied from interface: DataBoundComponent
Operation ID this component should use when performing remove operations.

Specified by:
setRemoveOperation in interface DataBoundComponent
Parameters:
removeOperation - removeOperation Default value is null

getRemoveOperation

public String getRemoveOperation()
Description copied from interface: DataBoundComponent
Operation ID this component should use when performing remove operations.

Specified by:
getRemoveOperation in interface DataBoundComponent
Returns:
String

setExportFields

public void setExportFields(String[] exportFields)
Description copied from interface: DataBoundComponent
The list of field-names to export. If provided, the field-list in the exported output is limited and sorted as per the list.

If exportFields is not provided, the exported output includes all visible fields from this component, sorted as they appear.

Specified by:
setExportFields in interface DataBoundComponent
Parameters:
exportFields - exportFields Default value is null

getExportFields

public String[] getExportFields()
Description copied from interface: DataBoundComponent
The list of field-names to export. If provided, the field-list in the exported output is limited and sorted as per the list.

If exportFields is not provided, the exported output includes all visible fields from this component, sorted as they appear.

Specified by:
getExportFields in interface DataBoundComponent
Returns:
the list of field-names to export.

setExportAll

public void setExportAll(Boolean exportAll)
Description copied from interface: DataBoundComponent
Setting exportAll to true prevents the component from passing it's list of fields to the export call. The result is the export of all visible fields from 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.

Specified by:
setExportAll in interface DataBoundComponent
Parameters:
exportAll - exportAll Default value is false

getExportAll

public Boolean getExportAll()
Description copied from interface: DataBoundComponent
Setting exportAll to true prevents the component from passing it's list of fields to the export call. The result is the export of all visible fields from 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.

Specified by:
getExportAll in interface DataBoundComponent
Returns:
Boolean

setPreventDuplicates

public void setPreventDuplicates(Boolean preventDuplicates)
                          throws IllegalStateException
Description copied from interface: DataBoundComponent
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). 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.

Specified by:
setPreventDuplicates in interface DataBoundComponent
Parameters:
preventDuplicates - preventDuplicates Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getPreventDuplicates

public Boolean getPreventDuplicates()
Description copied from interface: DataBoundComponent
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). 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.

Specified by:
getPreventDuplicates in interface DataBoundComponent
Returns:
Boolean

setDuplicateDragMessage

public void setDuplicateDragMessage(String duplicateDragMessage)
                             throws IllegalStateException
Description copied from interface: DataBoundComponent
Message to show when a user attempts to transfer duplicate records into this component, and preventDuplicates is enabled.

Specified by:
setDuplicateDragMessage in interface DataBoundComponent
Parameters:
duplicateDragMessage - duplicateDragMessage Default value is "Duplicates not allowed"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getDuplicateDragMessage

public String getDuplicateDragMessage()
Description copied from interface: DataBoundComponent
Message to show when a user attempts to transfer duplicate records into this component, and preventDuplicates is enabled.

Specified by:
getDuplicateDragMessage in interface DataBoundComponent
Returns:
String

setAddDropValues

public void setAddDropValues(Boolean addDropValues)
Description copied from interface: DataBoundComponent
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. "Drop values" are properties of the dropped item that you wish to change (and persist) as a result of the item being dropped on this grid.

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

Specified by:
setAddDropValues in interface DataBoundComponent
Parameters:
addDropValues - addDropValues Default value is true

getAddDropValues

public Boolean getAddDropValues()
Description copied from interface: DataBoundComponent
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. "Drop values" are properties of the dropped item that you wish to change (and persist) as a result of the item being dropped on this grid.

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

Specified by:
getAddDropValues in interface DataBoundComponent
Returns:
Boolean

setDropValues

public void setDropValues(Map dropValues)
Description copied from interface: DataBoundComponent
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.

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

Specified by:
setDropValues in interface DataBoundComponent
Parameters:
dropValues - dropValues Default value is null

getDropValues

public Map getDropValues()
Description copied from interface: DataBoundComponent
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.

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.

Specified by:
getDropValues in interface DataBoundComponent
Returns:
Returns the "drop values" to apply to a record dropped on this component prior to update. Only applicable to databound components - see 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:

  • Nothing, if addDropValues is false
  • dropValues, if that property is set. If the component's criteria object is applicable (as explained in the next item), it is merged into dropValues, with properties in dropValues taking precedence.
  • The component's criteria object, if the most recent textMatchStyle for the component was "exact" and it is simple criteria (ie, not an AdvancedCriteria object)
  • Otherwise nothing

You can override this method if you need more complex setting of drop values than can be provided by simply supplying a dropValues object.


setUseFlatFields

public void setUseFlatFields(Boolean useFlatFields)
                      throws IllegalStateException
Description copied from interface: DataBoundComponent
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.

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.

Specified by:
setUseFlatFields in interface DataBoundComponent
Parameters:
useFlatFields - useFlatFields Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getUseFlatFields

public Boolean getUseFlatFields()
Description copied from interface: DataBoundComponent
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.

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.

Specified by:
getUseFlatFields in interface DataBoundComponent
Returns:
Boolean

setHiliteProperty

public void setHiliteProperty(String hiliteProperty)
Description copied from interface: DataBoundComponent
Marker that can be set on a record to flag that record as hilited. Should be set to a value that matches id for a hilite defined on this component.

Specified by:
setHiliteProperty in interface DataBoundComponent
Parameters:
hiliteProperty - hiliteProperty Default value is "_hilite"

getHiliteProperty

public String getHiliteProperty()
Description copied from interface: DataBoundComponent
Marker that can be set on a record to flag that record as hilited. Should be set to a value that matches id for a hilite defined on this component.

Specified by:
getHiliteProperty in interface DataBoundComponent
Returns:
String

setDragDataAction

public void setDragDataAction(DragDataAction dragDataAction)
Description copied from interface: DataBoundComponent
Indicates what to do with data dragged into another DataBoundComponent. See DragDataAction type for details.

Specified by:
setDragDataAction in interface DataBoundComponent
Parameters:
dragDataAction - dragDataAction Default value is Canvas.MOVE

getDragDataAction

public DragDataAction getDragDataAction()
Description copied from interface: DataBoundComponent
Indicates what to do with data dragged into another DataBoundComponent. See DragDataAction type for details.

Specified by:
getDragDataAction in interface DataBoundComponent
Returns:
DragDataAction

setDragTrackerStyle

public void setDragTrackerStyle(String dragTrackerStyle)
Description copied from interface: DataBoundComponent
CSS Style to apply to the drag tracker when dragging occurs on this component.

Specified by:
setDragTrackerStyle in interface DataBoundComponent
Parameters:
dragTrackerStyle - dragTrackerStyle Default value is "gridDragTracker"

getDragTrackerStyle

public String getDragTrackerStyle()
Description copied from interface: DataBoundComponent
CSS Style to apply to the drag tracker when dragging occurs on this component.

Specified by:
getDragTrackerStyle in interface DataBoundComponent
Returns:
String

setCanAddFormulaFields

public void setCanAddFormulaFields(Boolean canAddFormulaFields)
Description copied from interface: DataBoundComponent
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.

User-added formula fields can be persisted via ListGrid.getFieldState() and ListGrid.setFieldState(java.lang.String).

Specified by:
setCanAddFormulaFields in interface DataBoundComponent
Parameters:
canAddFormulaFields - canAddFormulaFields Default value is false

addSummaryField

public void addSummaryField()
Description copied from interface: DataBoundComponent
Convenience method to display a com.smartgwt.client..SummaryBuilder to create a new Summary Field. This is equivalent to calling DataBoundComponentGen#editSummaryField with no paramater.

Specified by:
addSummaryField in interface DataBoundComponent

addFormulaField

public void addFormulaField()
Description copied from interface: DataBoundComponent
Convenience method to display a com.smartgwt.client..FormulaBuilder to create a new Formula Field. This is equivalent to calling DataBoundComponentGen#editFormulaField with no paramater.

Specified by:
addFormulaField in interface DataBoundComponent

getCanAddFormulaFields

public Boolean getCanAddFormulaFields()
Description copied from interface: DataBoundComponent
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.

User-added formula fields can be persisted via ListGrid.getFieldState() and ListGrid.setFieldState(java.lang.String).

Specified by:
getCanAddFormulaFields in interface DataBoundComponent
Returns:
Boolean

setAddFormulaFieldText

public void setAddFormulaFieldText(String addFormulaFieldText)
Description copied from interface: DataBoundComponent
Text for a menu item allowing users to add a formula field

Specified by:
setAddFormulaFieldText in interface DataBoundComponent
Parameters:
addFormulaFieldText - addFormulaFieldText Default value is "Add formula column..."

getAddFormulaFieldText

public String getAddFormulaFieldText()
Description copied from interface: DataBoundComponent
Text for a menu item allowing users to add a formula field

Specified by:
getAddFormulaFieldText in interface DataBoundComponent
Returns:
String

setEditFormulaFieldText

public void setEditFormulaFieldText(String editFormulaFieldText)
Description copied from interface: DataBoundComponent
Text for a menu item allowing users to edit a formula field

Specified by:
setEditFormulaFieldText in interface DataBoundComponent
Parameters:
editFormulaFieldText - editFormulaFieldText Default value is "Edit formula..."

getEditFormulaFieldText

public String getEditFormulaFieldText()
Description copied from interface: DataBoundComponent
Text for a menu item allowing users to edit a formula field

Specified by:
getEditFormulaFieldText in interface DataBoundComponent
Returns:
String

setCanAddSummaryFields

public void setCanAddSummaryFields(Boolean canAddSummaryFields)
Description copied from interface: DataBoundComponent
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.

User-added summary fields can be persisted via ListGrid.getFieldState() and ListGrid.setFieldState(java.lang.String).

Specified by:
setCanAddSummaryFields in interface DataBoundComponent
Parameters:
canAddSummaryFields - canAddSummaryFields Default value is false

getCanAddSummaryFields

public Boolean getCanAddSummaryFields()
Description copied from interface: DataBoundComponent
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.

User-added summary fields can be persisted via ListGrid.getFieldState() and ListGrid.setFieldState(java.lang.String).

Specified by:
getCanAddSummaryFields in interface DataBoundComponent
Returns:
Boolean

setAddSummaryFieldText

public void setAddSummaryFieldText(String addSummaryFieldText)
Description copied from interface: DataBoundComponent
Text for a menu item allowing users to add a formula field

Specified by:
setAddSummaryFieldText in interface DataBoundComponent
Parameters:
addSummaryFieldText - addSummaryFieldText Default value is "Add summary column..."

getAddSummaryFieldText

public String getAddSummaryFieldText()
Description copied from interface: DataBoundComponent
Text for a menu item allowing users to add a formula field

Specified by:
getAddSummaryFieldText in interface DataBoundComponent
Returns:
String

setEditSummaryFieldText

public void setEditSummaryFieldText(String editSummaryFieldText)
Description copied from interface: DataBoundComponent
Text for a menu item allowing users to edit the formatter for a field

Specified by:
setEditSummaryFieldText in interface DataBoundComponent
Parameters:
editSummaryFieldText - editSummaryFieldText Default value is "Edit summary format..."

getEditSummaryFieldText

public String getEditSummaryFieldText()
Description copied from interface: DataBoundComponent
Text for a menu item allowing users to edit the formatter for a field

Specified by:
getEditSummaryFieldText in interface DataBoundComponent
Returns:
String

selectRecord

public void selectRecord(Record record)
Description copied from interface: DataBoundComponent
Select/deselect a Record passed in explicitly, or by index.

Specified by:
selectRecord in interface DataBoundComponent
Parameters:
record - record (or row number) to select

selectRecord

public void selectRecord(int record)
Description copied from interface: DataBoundComponent
Select/deselect a Record passed in explicitly, or by index.

Specified by:
selectRecord in interface DataBoundComponent
Parameters:
record - record (or row number) to select

selectRecord

public void selectRecord(int record,
                         boolean newState)
Description copied from interface: DataBoundComponent
Select/deselect a Record passed in explicitly, or by index.

Specified by:
selectRecord in interface DataBoundComponent
Parameters:
record - record (or row number) to select
newState - new selection state (if null, defaults to true)

selectRecord

public void selectRecord(Record record,
                         boolean newState)
Description copied from interface: DataBoundComponent
Select/deselect a Record passed in explicitly, or by index.

Specified by:
selectRecord in interface DataBoundComponent
Parameters:
record - record (or row number) to select
newState - new selection state (if null, defaults to true)

selectRecords

public void selectRecords(int[] records)
Description copied from interface: DataBoundComponent
Select/deselect a list of Records passed in explicitly, or by index.

Specified by:
selectRecords in interface DataBoundComponent
Parameters:
records - records (or row numbers) to select

selectRecords

public void selectRecords(int[] records,
                          boolean newState)
Description copied from interface: DataBoundComponent
Select/deselect a list of Records passed in explicitly, or by index.

Specified by:
selectRecords in interface DataBoundComponent
Parameters:
records - records (or row numbers) to select
newState - new selection state

selectRecords

public void selectRecords(Record[] records)
Description copied from interface: DataBoundComponent
Select/deselect a list of Records passed in explicitly, or by index.

Specified by:
selectRecords in interface DataBoundComponent
Parameters:
records - records (or row numbers) to select

selectRecords

public void selectRecords(Record[] records,
                          boolean newState)
Description copied from interface: DataBoundComponent
Select/deselect a list of Records passed in explicitly, or by index.

Specified by:
selectRecords in interface DataBoundComponent
Parameters:
records - records (or row numbers) to select
newState - new selection state (if null, defaults to true)

deselectRecord

public void deselectRecord(Record record)
Description copied from interface: DataBoundComponent
Deselect a Record passed in explicitly, or by index.

Synonym for selectRecord(record, false)

Specified by:
deselectRecord in interface DataBoundComponent
Parameters:
record - record (or row number) to deselect

deselectRecord

public void deselectRecord(int record)
Description copied from interface: DataBoundComponent
Deselect a Record passed in explicitly, or by index.

Synonym for selectRecord(record, false)

Specified by:
deselectRecord in interface DataBoundComponent
Parameters:
record - record (or row number) to deselect

deselectRecords

public void deselectRecords(int[] records)
Description copied from interface: DataBoundComponent
Deselect a list of Records passed in explicitly, or by index.

Synonym for selectRecords(records, false)

Specified by:
deselectRecords in interface DataBoundComponent
Parameters:
records - records (or row numbers) to deselect

deselectRecords

public void deselectRecords(Record[] records)
Description copied from interface: DataBoundComponent
Deselect a list of Records passed in explicitly, or by index.

Synonym for selectRecords(records, false)

Specified by:
deselectRecords in interface DataBoundComponent
Parameters:
records - records (or row numbers) to deselect

selectAllRecords

public void selectAllRecords()
Description copied from interface: DataBoundComponent
Select all records

Specified by:
selectAllRecords in interface DataBoundComponent

deselectAllRecords

public void deselectAllRecords()
Description copied from interface: DataBoundComponent
Deselect all records

Specified by:
deselectAllRecords in interface DataBoundComponent

anySelected

public Boolean anySelected()
Description copied from interface: DataBoundComponent
Whether at least one item is selected

Specified by:
anySelected in interface DataBoundComponent
Returns:
true == at least one item is selected false == nothing at all is selected

enableHilite

public void enableHilite(String hiliteID)
Description copied from interface: DataBoundComponent
Enable / disable a hilites

Specified by:
enableHilite in interface DataBoundComponent
Parameters:
hiliteID - ID of hilite to enable

enableHilite

public void enableHilite(String hiliteID,
                         boolean enable)
Description copied from interface: DataBoundComponent
Enable / disable a hilites

Specified by:
enableHilite in interface DataBoundComponent
Parameters:
hiliteID - ID of hilite to enable
enable - new enabled state to apply - if null, defaults to true

disableHilite

public void disableHilite(String hiliteID)
Description copied from interface: DataBoundComponent
Disable a hilite

Specified by:
disableHilite in interface DataBoundComponent
Parameters:
hiliteID - ID of hilite to disable

enableHiliting

public void enableHiliting()
Description copied from interface: DataBoundComponent
Enable all hilites.

Specified by:
enableHiliting in interface DataBoundComponent

enableHiliting

public void enableHiliting(boolean enable)
Description copied from interface: DataBoundComponent
Enable all hilites.

Specified by:
enableHiliting in interface DataBoundComponent
Parameters:
enable - new enabled state to apply - if null, defaults to true

disableHiliting

public void disableHiliting()
Description copied from interface: DataBoundComponent
Disable all hilites.

Specified by:
disableHiliting in interface DataBoundComponent

getDragData

public Record[] getDragData()
Description copied from interface: DataBoundComponent
During a drag-and-drop interaction, this method returns the set of records being dragged out of the component. In the default implementation, this is the list of currently selected records.

This method is generally called by com.smartgwt.client.widgets.DataBoundComponent#transferDragData and is consulted by ListGrid.willAcceptDrop().

Specified by:
getDragData in interface DataBoundComponent
Returns:
Array of Records that are currently selected.

transferSelectedData

public void transferSelectedData(DataBoundComponent source)
Description copied from interface: DataBoundComponent
Simulates a drag / drop type transfer of the selected records in some other component to this component, without requiring any user interaction. This method acts on the dropped records exactly as if they had been dropped in an actual drag / drop interaction, including any special databound behavior invoked by calling 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.

Specified by:
transferSelectedData in interface DataBoundComponent
Parameters:
source - source component from which the records will be tranferred

transferSelectedData

public void transferSelectedData(DataBoundComponent source,
                                 int index)
Description copied from interface: DataBoundComponent
Simulates a drag / drop type transfer of the selected records in some other component to this component, without requiring any user interaction. This method acts on the dropped records exactly as if they had been dropped in an actual drag / drop interaction, including any special databound behavior invoked by calling 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.

Specified by:
transferSelectedData in interface DataBoundComponent
Parameters:
source - source component from which the records will be tranferred
index - target index (drop position) of the rows within this grid.

getRecordIndex

public int getRecordIndex(Record record)
Description copied from interface: DataBoundComponent
Get the index of the provided record.

Override in subclasses to provide more specific behaviour, for instance, when data holds a large number of records

Specified by:
getRecordIndex in interface DataBoundComponent
Parameters:
record - the record whose index is to be retrieved
Returns:
indexindex of the record, or -1 if not found

getTitleFieldValue

public String getTitleFieldValue(Record record)
Description copied from interface: DataBoundComponent
Get the value of the titleField for the passed record

Override in subclasses

Specified by:
getTitleFieldValue in interface DataBoundComponent
Parameters:
record - the record whose index is to be retrieved
Returns:
valuethe value of the titleField for the passed record

setTitleField

public void setTitleField(String titleField)
Specified by:
setTitleField in interface DataBoundComponent

getTitleField

public String getTitleField()
Description copied from interface: DataBoundComponent
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". If we dont find any field-names that match these titles, the first field in the component will be used instead.

Specified by:
getTitleField in interface DataBoundComponent
Returns:
fieldName for title field for this component.

setDataSource

public void setDataSource(DataSource dataSource)
Description copied from interface: DataBoundComponent
The DataSource that this component should bind to for default fields and for performing 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().

Specified by:
setDataSource in interface DataBoundComponent
Parameters:
dataSource - DataSource to bind to. Default value is null

getDataSource

public DataSource getDataSource()
Description copied from interface: DataBoundComponent
The DataSource that this component should bind to for default fields and for performing DSRequest.

Can be specified as either a DataSource instance or the String ID of a DataSource.

Specified by:
getDataSource in interface DataBoundComponent
Returns:
DataSource

setAutoFetchData

public void setAutoFetchData(Boolean autoFetchData)
                      throws IllegalStateException
Description copied from interface: DataBoundComponent
If true, when this component is first drawn, automatically call DataBoundComponent.fetchData() or DataBoundComponent.filterData() depending on DataBoundComponent.getAutoFetchAsFilter() . Criteria for this fetch may be picked up from initialCriteria.

Specified by:
setAutoFetchData in interface DataBoundComponent
Parameters:
autoFetchData - autoFetchData
Throws:
IllegalStateException

getAutoFetchData

public Boolean getAutoFetchData()
Description copied from interface: DataBoundComponent
If true, when this component is first drawn, automatically call DataBoundComponent.fetchData() or DataBoundComponent.filterData() depending on DataBoundComponent.getAutoFetchAsFilter() . Criteria for this fetch may be picked up from initialCriteria.

Specified by:
getAutoFetchData in interface DataBoundComponent
Returns:
auto fetch data

setAutoFetchAsFilter

public void setAutoFetchAsFilter(Boolean autoFetchAsFilter)
                          throws IllegalStateException
Description copied from interface: DataBoundComponent
If DataBoundComponent.setAutoFetchData(Boolean) is true, this attribute determines whether the initial fetch operation should be performed via DataBoundComponent.fetchData() or DataBoundComponent.filterData()

Specified by:
setAutoFetchAsFilter in interface DataBoundComponent
Parameters:
autoFetchAsFilter - autoFetchAsFilter
Throws:
IllegalStateException

getAutoFetchAsFilter

public Boolean getAutoFetchAsFilter()
Description copied from interface: DataBoundComponent
If DataBoundComponent.setAutoFetchData(Boolean) is true, this attribute determines whether the initial fetch operation should be performed via DataBoundComponent.fetchData() or DataBoundComponent.filterData()

Specified by:
getAutoFetchAsFilter in interface DataBoundComponent
Returns:
auto fetch as filter

setInitialCriteria

public void setInitialCriteria(Criteria initialCriteria)
                        throws IllegalStateException
Description copied from interface: DataBoundComponent
Criteria to use when DataBoundComponent.setAutoFetchData(Boolean) is used.

Specified by:
setInitialCriteria in interface DataBoundComponent
Parameters:
initialCriteria - the initial criteria
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getInitialCriteria

public Criteria getInitialCriteria()
Description copied from interface: DataBoundComponent
Criteria to use when DataBoundComponent.setAutoFetchData(Boolean) is used.

Specified by:
getInitialCriteria in interface DataBoundComponent
Returns:
the criteria

fetchData

public void fetchData()
Description copied from interface: DataBoundComponent
Uses a "fetch" operation on the current 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 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 ResultSet.setCriteria(com.smartgwt.client.data.Criteria) 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 ResultSet.willFetchData(com.smartgwt.client.data.Criteria).

If you need to force a server fetch, you can call 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 ResultSet.willFetchData(com.smartgwt.client.data.Criteria) 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 ResultSet.dataArrived(int, int) 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.

Specified by:
fetchData in interface DataBoundComponent

fetchData

public void fetchData(Criteria criteria)
Description copied from interface: DataBoundComponent
Uses a "fetch" operation on the current 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 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 ResultSet.setCriteria(com.smartgwt.client.data.Criteria) 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 ResultSet.willFetchData(com.smartgwt.client.data.Criteria).

If you need to force a server fetch, you can call 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 ResultSet.willFetchData(com.smartgwt.client.data.Criteria) 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 ResultSet.dataArrived(int, int) 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.

Specified by:
fetchData in interface DataBoundComponent
Parameters:
criteria - Search criteria. If a DynamicForm is passed in as this argument instead of a raw criteria object, will be derived by calling getValuesAsCriteria()

fetchData

public void fetchData(Criteria criteria,
                      DSCallback callback)
Description copied from interface: DataBoundComponent
Uses a "fetch" operation on the current 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 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 ResultSet.setCriteria(com.smartgwt.client.data.Criteria) 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 ResultSet.willFetchData(com.smartgwt.client.data.Criteria).

If you need to force a server fetch, you can call 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 ResultSet.willFetchData(com.smartgwt.client.data.Criteria) 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 ResultSet.dataArrived(int, int) 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.

Specified by:
fetchData in interface DataBoundComponent
Parameters:
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

fetchData

public void fetchData(Criteria criteria,
                      DSCallback callback,
                      DSRequest requestProperties)
Description copied from interface: DataBoundComponent
Uses a "fetch" operation on the current 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 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 ResultSet.setCriteria(com.smartgwt.client.data.Criteria) 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 ResultSet.willFetchData(com.smartgwt.client.data.Criteria).

If you need to force a server fetch, you can call 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 ResultSet.willFetchData(com.smartgwt.client.data.Criteria) 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 ResultSet.dataArrived(int, int) 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.

Specified by:
fetchData in interface DataBoundComponent
Parameters:
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
requestProperties - additional properties to set on the DSRequest that will be issued

filterData

public void filterData()
Description copied from interface: DataBoundComponent
Retrieves data that matches the provided criteria and displays the matching data in this component.

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.

Specified by:
filterData in interface DataBoundComponent

filterData

public void filterData(Criteria criteria)
Description copied from interface: DataBoundComponent
Retrieves data that matches the provided criteria and displays the matching data in this component.

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.

Specified by:
filterData in interface DataBoundComponent
Parameters:
criteria - Search criteria. If a DynamicForm is passed in as this argument instead of a raw criteria object, will be derived by calling getValuesAsCriteria()

filterData

public void filterData(Criteria criteria,
                       DSCallback callback)
Description copied from interface: DataBoundComponent
Retrieves data that matches the provided criteria and displays the matching data in this component.

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.

Specified by:
filterData in interface DataBoundComponent
Parameters:
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 details

filterData

public void filterData(Criteria criteria,
                       DSCallback callback,
                       DSRequest requestProperties)
Description copied from interface: DataBoundComponent
Retrieves data that matches the provided criteria and displays the matching data in this component.

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.

Specified by:
filterData in interface DataBoundComponent
Parameters:
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 details
requestProperties - for databound components only - optional additional properties to set on the DSRequest that will be issued

invalidateCache

public void invalidateCache()
Description copied from interface: DataBoundComponent
Invalidate the current data cache for this databound component via a call to 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.

Specified by:
invalidateCache in interface DataBoundComponent

getResultSet

public ResultSet getResultSet()
                       throws IllegalStateException
Description copied from interface: DataBoundComponent
Return the underlying data of this DataBoundComponent as a ResultSet.

Note that this method should only be called after initial data has been fetched by this DataBoundComponent.

Specified by:
getResultSet in interface DataBoundComponent
Returns:
the ResultSet
Throws:
IllegalStateException - if called on a component with local array data, or a DataBoundComponent before the initial data is fetched.
See Also:
DataBoundComponent.fetchData()

getRecordList

public RecordList getRecordList()
Description copied from interface: DataBoundComponent
Return the underlying data of this DataBoundComponent as a RecordList.

If the underlying data in not local data, and the component is bound to a DataSource, then the actual instance of the RecordList will be of type ResultSet.

Specified by:
getRecordList in interface DataBoundComponent
Returns:
the RecordList