Class DynamicForm

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, DataBoundComponent, HasClearHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragCompleteHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropCompleteHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFetchDataHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers, HasAsyncValidationReplyHandlers, HasFormSubmitFailedHandlers, HasHiddenValidationErrorsHandlers, HasItemChangedHandlers, HasItemChangeHandlers, HasItemKeyPressHandlers, HasSubmitValuesHandlers, HasValuesChangedHandlers
Direct Known Subclasses:
PropertySheet, SearchForm

The DynamicForm manages a collection of FormItems which represent user input controls. The DynamicForm provides layout, value management, validation and databinding for the controls it manages.

To create a DynamicForm, create several FormItems and pass them to setItems(). For example:

     DynamicForm form = new DynamicForm();
     TextItem textItem = new TextItem("userName");
     SelectItem selectItem = new SelectItem("usState");
     form.setItems(textItem, selectItem);
  
The item name is an identifier for the item that must be unique just within this form. It is used:
  • as the name under which the item's value is stored in the form (the form's current values are accessible as form.getValues()
  • when retrieving the FormItem's current value (via form.getValue())
  • to retrieve the item itself via form.getItem()
FormItems can also be created by binding the form to a DataSource via setDataSource(). In this case, FormItems are chosen based on the data type of the field - see FormItemType. You can override the automatically chosen FormItem via DataSourceField.editorType.

FormItem lifecycle is managed by the DynamicForm itself. FormItem instances are created and destroyed automatically when new fields are added to the form.

When using DataSource binding, you can also add additional FormItems not specified in the DataSource, or override any properties on the automatically generated FormItems, without having to re-declare any information that comes from the DataSource. See the QuickStart Guide chapter on Data Binding for an overview.

All FormItems share a common set of properties for controlling form\n layout. Other properties common to all FormItems are documented on the FormItem class, and properties specific to particular FormItems are documented on the respective FormItems.

NOTE: For very simple forms consisting of exactly one item, you still use a DynamicForm. See the "fontSelector" form in the Toolstrip example.

  • Constructor Details

    • DynamicForm

      public DynamicForm()
    • DynamicForm

      public DynamicForm(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static DynamicForm getOrCreateRef(JavaScriptObject jsObj)
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • create

      protected JavaScriptObject create()
      Overrides:
      create in class Canvas
    • setAction

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

      If this method is called after the component has been drawn/initialized: Sets the action for this form.

      Parameters:
      action - New action URL. Default value is "#"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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:
      Current action value. Default value is "#"
      See Also:
    • setAllowExpressions

      public DynamicForm setAllowExpressions(Boolean allowExpressions)
      For a form that produces filter criteria (see form.getValuesAsCriteria()), allows the user to enter simple expressions in any field in this form that takes text input.

      Also note that enabling allowExpressions for an entire form changes the defaultSearchOperator to "iContainsPattern", so that simple search expressions similar to SQL "LIKE" patterns can be entered in most fields.

      See FormItem.allowExpressions for details.

      Parameters:
      allowExpressions - New allowExpressions value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getAllowExpressions

      public Boolean getAllowExpressions()
      For a form that produces filter criteria (see form.getValuesAsCriteria()), allows the user to enter simple expressions in any field in this form that takes text input.

      Also note that enabling allowExpressions for an entire form changes the defaultSearchOperator to "iContainsPattern", so that simple search expressions similar to SQL "LIKE" patterns can be entered in most fields.

      See FormItem.allowExpressions for details.

      Returns:
      Current allowExpressions value. Default value is null
      See Also:
    • setAutoComplete

      public DynamicForm setAutoComplete(AutoComplete autoComplete)
      Should this form allow browser auto-completion of its items' values? Applies only to items based on native HTML form elements (TextItem, PasswordItem, etc), and will only have a user-visible impact for browsers where native autoComplete behavior is actually supported and enabled via user settings.

      This property may be explicitly specified per item via FormItem.autoComplete.

      Note that even with this value set to "none", native browser auto-completion may occur for log in forms (forms containing username and password fields). This behavior varies by browser, and is a result of an intentional change by some browser developers to disregard the HTML setting autocomplete=off for password items or log-in forms.

      Parameters:
      autoComplete - New autoComplete value. Default value is "none"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getAutoComplete

      public AutoComplete getAutoComplete()
      Should this form allow browser auto-completion of its items' values? Applies only to items based on native HTML form elements (TextItem, PasswordItem, etc), and will only have a user-visible impact for browsers where native autoComplete behavior is actually supported and enabled via user settings.

      This property may be explicitly specified per item via FormItem.autoComplete.

      Note that even with this value set to "none", native browser auto-completion may occur for log in forms (forms containing username and password fields). This behavior varies by browser, and is a result of an intentional change by some browser developers to disregard the HTML setting autocomplete=off for password items or log-in forms.

      Returns:
      Current autoComplete value. Default value is "none"
      See Also:
    • setAutoFocus

      public DynamicForm 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 - New autoFocus value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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:
      Current autoFocus value. Default value is false
      See Also:
    • setAutoFocusOnError

      public DynamicForm setAutoFocusOnError(Boolean autoFocusOnError)
      If true, when validation fails focus will automatically be put into the first focusable field which failed validation.
      Parameters:
      autoFocusOnError - New autoFocusOnError value. Default value is true
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getAutoFocusOnError

      public Boolean getAutoFocusOnError()
      If true, when validation fails focus will automatically be put into the first focusable field which failed validation.
      Returns:
      Current autoFocusOnError value. Default value is true
      See Also:
    • setBrowserSpellCheck

      public DynamicForm setBrowserSpellCheck(Boolean browserSpellCheck)
      If this browser has a 'spellCheck' feature for text-based form item elements, should it be used for items in this form? Can be overridden at the item level via FormItem.browserSpellCheck

      Notes:
      - this property only applies to text based items such as TextItem and TextAreaItem.
      - this property is not supported on all browsers.

      Parameters:
      browserSpellCheck - New browserSpellCheck value. Default value is true
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getBrowserSpellCheck

      public Boolean getBrowserSpellCheck()
      If this browser has a 'spellCheck' feature for text-based form item elements, should it be used for items in this form? Can be overridden at the item level via FormItem.browserSpellCheck

      Notes:
      - this property only applies to text based items such as TextItem and TextAreaItem.
      - this property is not supported on all browsers.

      Returns:
      Current browserSpellCheck value. Default value is true
      See Also:
    • setCanEdit

      public DynamicForm setCanEdit(Boolean canEdit)
      If set to false, the form will be marked read-only. A widget on the form is editable if either (1) beginning with the widget and continuing up the containment hierarchy, including the form, the first widget to have a non-null canEdit attribute has canEdit:true, or (2) neither the widget nor any parent has a non-null canEdit attribute. This setting allows you to enable or disable the default editability of the form's items at one time.

      This setting differs from the enabled/disabled state in that most form items will allow copying of the contents while read-only but do not while disabled.

      Note that a form is considered editable if canEdit is null (default) or true.

      Note that this property may validly be null as a distinct state from false. See fieldIsEditable() for an API that will always return true or false and give a definitive answer as to whether editing is possible.

      If this method is called after the component has been drawn/initialized: Is this form editable or read-only? Setting the form to non-editable causes all form items to render as read-only unless a form item is specifically marked as editable (the item's canEdit attribute is true).

      Note : This is an advanced setting

      Parameters:
      canEdit - Can this form be edited?. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getCanEdit

      public Boolean getCanEdit()
      If set to false, the form will be marked read-only. A widget on the form is editable if either (1) beginning with the widget and continuing up the containment hierarchy, including the form, the first widget to have a non-null canEdit attribute has canEdit:true, or (2) neither the widget nor any parent has a non-null canEdit attribute. This setting allows you to enable or disable the default editability of the form's items at one time.

      This setting differs from the enabled/disabled state in that most form items will allow copying of the contents while read-only but do not while disabled.

      Note that a form is considered editable if canEdit is null (default) or true.

      Note that this property may validly be null as a distinct state from false. See fieldIsEditable() for an API that will always return true or false and give a definitive answer as to whether editing is possible.

      Returns:
      Current canEdit value. Default value is null
      See Also:
    • setCanEditFieldAttribute

      public DynamicForm setCanEditFieldAttribute(String canEditFieldAttribute) throws IllegalStateException
      If this component is bound to a dataSource, this attribute may be specified to customize what fields from the dataSource may be edited by default. For example the SearchForm class has this attribute set to "canFilter" which allows search forms to edit dataSource fields marked as canEdit:false (but not those marked as canFilter:false).

      Note that if canEdit is explicitly specified on a field in the DataBoundComponent.fields array, that property will be respected in preference to the canEditAttribute value. (See FormItem.canEdit, ListGridField.canEdit). Also note that individual dataBoundComponents may have additional logic around whether a field can be edited - for example ListGrid.canEditCell() may be overridden.

      Note : This is an advanced setting

      Parameters:
      canEditFieldAttribute - New canEditFieldAttribute value. Default value is "canEdit"
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getCanEditFieldAttribute

      public String getCanEditFieldAttribute()
      If this component is bound to a dataSource, this attribute may be specified to customize what fields from the dataSource may be edited by default. For example the SearchForm class has this attribute set to "canFilter" which allows search forms to edit dataSource fields marked as canEdit:false (but not those marked as canFilter:false).

      Note that if canEdit is explicitly specified on a field in the DataBoundComponent.fields array, that property will be respected in preference to the canEditAttribute value. (See FormItem.canEdit, ListGridField.canEdit). Also note that individual dataBoundComponents may have additional logic around whether a field can be edited - for example ListGrid.canEditCell() may be overridden.

      Returns:
      Current canEditFieldAttribute value. Default value is "canEdit"
      See Also:
    • setCanFocus

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

      Note : This is an advanced setting

      Overrides:
      setCanFocus in class Canvas
      Parameters:
      canFocus - New canFocus value. Default value is true
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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 receive focus. This property will only govern whether the form may receive focus if the form contains no focusable items.
      Overrides:
      getCanFocus in class Canvas
      Returns:
      Current canFocus value. Default value is true
      See Also:
    • setCanSubmit

      public DynamicForm 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 - New canSubmit value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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:
      Current canSubmit value. Default value is false
      See Also:
    • setCanTabToIcons

      public DynamicForm setCanTabToIcons(Boolean canTabToIcons)
      Should users be able to tab into the icons and picker icon for items within this form by default?

      May be overridden at the item level by FormItem.canTabToIcons.

      Developers may also suppress tabbing to individual icons by setting FormItemIcon.tabIndex to -1.

      Note : This is an advanced setting

      Parameters:
      canTabToIcons - New canTabToIcons value. Default value is true
      Returns:
      DynamicForm instance, for chaining setter calls
    • getCanTabToIcons

      public Boolean getCanTabToIcons()
      Should users be able to tab into the icons and picker icon for items within this form by default?

      May be overridden at the item level by FormItem.canTabToIcons.

      Developers may also suppress tabbing to individual icons by setting FormItemIcon.tabIndex to -1.

      Returns:
      Current canTabToIcons value. Default value is true
    • setCanTabToSectionHeaders

      public DynamicForm setCanTabToSectionHeaders(Boolean canTabToSectionHeaders) throws IllegalStateException
      If true, the headers for any SectionItems will be included in the page's tab order for accessibility. May also be set at the item level via SectionItem.canTabToHeader

      If unset, section headers will be focusable if SC.setScreenReaderMode() has been called. See Accessibility.

      Note : This is an advanced setting

      Parameters:
      canTabToSectionHeaders - New canTabToSectionHeaders value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getCanTabToSectionHeaders

      public Boolean getCanTabToSectionHeaders()
      If true, the headers for any SectionItems will be included in the page's tab order for accessibility. May also be set at the item level via SectionItem.canTabToHeader

      If unset, section headers will be focusable if SC.setScreenReaderMode() has been called. See Accessibility.

      Returns:
      Current canTabToSectionHeaders value. Default value is null
    • setCellBorder

      public DynamicForm setCellBorder(int cellBorder)
      Width of border for the table that form is drawn in. This is primarily used for debugging form layout.
      Parameters:
      cellBorder - New cellBorder value. Default value is 0
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getCellBorder

      public int getCellBorder()
      Width of border for the table that form is drawn in. This is primarily used for debugging form layout.
      Returns:
      Current cellBorder value. Default value is 0
      See Also:
    • setCellPadding

      public DynamicForm setCellPadding(int cellPadding)
      The amount of empty space, in pixels, surrounding each form item within its cell in the layout grid.
      Parameters:
      cellPadding - New cellPadding value. Default value is 2
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getCellPadding

      public int getCellPadding()
      The amount of empty space, in pixels, surrounding each form item within its cell in the layout grid.
      Returns:
      Current cellPadding value. Default value is 2
      See Also:
    • setCheckFileAccessOnSubmit

      public DynamicForm setCheckFileAccessOnSubmit(boolean checkFileAccessOnSubmit)
      For dynamicForms containing a FileItem for uploading files, should the browser verify that the file is accessible before submitting the uploaded file to the server?

      In some cases the browser may not be able to access the selected file.
      This can occur when the file has been modified in the file system after selection in the browser, or if the current user doesn't have permission to view the file.

      By default, before submitting the file to the server the browser will verify that it can access the file's contents and display the fileAccessFailedWarning if file access fails.
      Note that accessing the file's contents is an asynchronous process, so form submission is not performed synchronously.

      This means that if application code calls saveData() on a form containing a fileItem and then synchronously clears it from the DOM, the upload will never be kicked off.
      Setting checkFileAccessOnSubmit to false will suppress the (asynchronous) check, and can be used to bypass this limitation, but this is not recommended except as a short term backwards-compatibility workaround. Instead we'd recommend using the saveData callback to clear the form when the upload has completed. This also gives the user an opportunity to correct validation errors and re-submit the form if necessary.

      Note : This is an advanced setting

      Parameters:
      checkFileAccessOnSubmit - New checkFileAccessOnSubmit value. Default value is true
      Returns:
      DynamicForm instance, for chaining setter calls
    • getCheckFileAccessOnSubmit

      public boolean getCheckFileAccessOnSubmit()
      For dynamicForms containing a FileItem for uploading files, should the browser verify that the file is accessible before submitting the uploaded file to the server?

      In some cases the browser may not be able to access the selected file.
      This can occur when the file has been modified in the file system after selection in the browser, or if the current user doesn't have permission to view the file.

      By default, before submitting the file to the server the browser will verify that it can access the file's contents and display the fileAccessFailedWarning if file access fails.
      Note that accessing the file's contents is an asynchronous process, so form submission is not performed synchronously.

      This means that if application code calls saveData() on a form containing a fileItem and then synchronously clears it from the DOM, the upload will never be kicked off.
      Setting checkFileAccessOnSubmit to false will suppress the (asynchronous) check, and can be used to bypass this limitation, but this is not recommended except as a short term backwards-compatibility workaround. Instead we'd recommend using the saveData callback to clear the form when the upload has completed. This also gives the user an opportunity to correct validation errors and re-submit the form if necessary.

      Returns:
      Current checkFileAccessOnSubmit value. Default value is true
    • setClipItemTitles

      public DynamicForm setClipItemTitles(boolean clipItemTitles)
      Should the titles for form items be clipped if they are too large for the available space?

      Can be overridden for individual items via FormItem.clipTitle.

      Parameters:
      clipItemTitles - New clipItemTitles value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
    • getClipItemTitles

      public boolean getClipItemTitles()
      Should the titles for form items be clipped if they are too large for the available space?

      Can be overridden for individual items via FormItem.clipTitle.

      Returns:
      Current clipItemTitles value. Default value is false
    • setClipStaticValue

      public DynamicForm setClipStaticValue(Boolean clipStaticValue) throws IllegalStateException
      Default FormItem.clipStaticValue setting for items in this form. When unset, this is equivalent to false.
      Parameters:
      clipStaticValue - New clipStaticValue value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getClipStaticValue

      public Boolean getClipStaticValue()
      Default FormItem.clipStaticValue setting for items in this form. When unset, this is equivalent to false.
      Returns:
      Current clipStaticValue value. Default value is null
    • setDataArity

      public DynamicForm setDataArity(String dataArity)
      A DynamicForm is a dataArity:single component.

      Note : This is an advanced setting

      Parameters:
      dataArity - New dataArity value. Default value is "single"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getDataArity

      public String getDataArity()
      A DynamicForm is a dataArity:single component.
      Returns:
      Current dataArity value. Default value is "single"
      See Also:
    • setDataFetchMode

      public DynamicForm setDataFetchMode(FetchMode dataFetchMode)
      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 ResultSet.fetchMode applies.

      Specified by:
      setDataFetchMode in interface DataBoundComponent
      Parameters:
      dataFetchMode - New dataFetchMode value. Default value is "paged"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getDataFetchMode

      public FetchMode getDataFetchMode()
      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 ResultSet.fetchMode applies.

      Specified by:
      getDataFetchMode in interface DataBoundComponent
      Returns:
      Current dataFetchMode value. Default value is "paged"
      See Also:
    • setDataSource

      public DynamicForm setDataSource(DataSource dataSource)
      The DataSource that this component should bind to for default fields and for performing DataSource requests.

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

      Specified by:
      setDataSource in interface DataBoundComponent
      Parameters:
      dataSource - New dataSource value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • setDataSource

      public DynamicForm setDataSource(String dataSource)
      The DataSource that this component should bind to for default fields and for performing DataSource requests.

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

      Specified by:
      setDataSource in interface DataBoundComponent
      Parameters:
      dataSource - New dataSource value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • setDateFormatter

      public DynamicForm setDateFormatter(DateDisplayFormat dateFormatter)
      Default DateDisplayFormat for Date type values displayed in this form.

      If some field's value is set to a native Date object, how should it be displayed to the user? If specified this is the default display format to use, and will apply to all fields except those specified as type:"time" (See timeFormatter).

      May be overridden at the component level for fields of type datetime via datetimeFormatter.

      Note that if specified, FormItem.dateFormatter and FormItem.timeFormatter take precedence over the format specified at the component level.

      If no explicit formatter is specified at the field or component level, dates will be formatted according to the system-wide short date display format or short datetime display format depending on the specified field type.

      Parameters:
      dateFormatter - New dateFormatter value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
    • getDateFormatter

      public DateDisplayFormat getDateFormatter()
      Default DateDisplayFormat for Date type values displayed in this form.

      If some field's value is set to a native Date object, how should it be displayed to the user? If specified this is the default display format to use, and will apply to all fields except those specified as type:"time" (See timeFormatter).

      May be overridden at the component level for fields of type datetime via datetimeFormatter.

      Note that if specified, FormItem.dateFormatter and FormItem.timeFormatter take precedence over the format specified at the component level.

      If no explicit formatter is specified at the field or component level, dates will be formatted according to the system-wide short date display format or short datetime display format depending on the specified field type.

      Returns:
      Current dateFormatter value. Default value is null
    • setDatetimeFormatter

      public DynamicForm setDatetimeFormatter(DateDisplayFormat datetimeFormatter)
      Default DateDisplayFormat for Date type values displayed in this form in fields of type datetime.

      For datetime fields, this attribute will be used instead of dateFormatter when formatting Date values.

      Note that if specified, FormItem.dateFormatter and FormItem.timeFormatter take precedence over the format specified at the component level.

      If no explicit formatter is specified at the field or component level, datetime field values will be formatted according to the system-wide short datetime display format.

      Parameters:
      datetimeFormatter - New datetimeFormatter value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
    • getDatetimeFormatter

      public DateDisplayFormat getDatetimeFormatter()
      Default DateDisplayFormat for Date type values displayed in this form in fields of type datetime.

      For datetime fields, this attribute will be used instead of dateFormatter when formatting Date values.

      Note that if specified, FormItem.dateFormatter and FormItem.timeFormatter take precedence over the format specified at the component level.

      If no explicit formatter is specified at the field or component level, datetime field values will be formatted according to the system-wide short datetime display format.

      Returns:
      Current datetimeFormatter value. Default value is null
    • setDefaultSearchOperator

      public DynamicForm setDefaultSearchOperator(OperatorId defaultSearchOperator) throws IllegalStateException
      Default search operator to use for fields in a form that produces AdvancedCriteria. Default is "iContains" unless allowExpressions is enabled for the form as a whole, in which case the default is "iContainsPattern".

      Does not apply to special fields where exact match is obviously the right default setting, such as fields of type:"enum", or fields with a valueMap or optionDataSource.

      defaultSearchOperator also has no effect in a form that does not produce AdvancedCriteria - see getValuesAsCriteria() for settings that cause a form to produce AdvancedCriteria.

      Parameters:
      defaultSearchOperator - New defaultSearchOperator value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getDefaultSearchOperator

      public OperatorId getDefaultSearchOperator()
      Default search operator to use for fields in a form that produces AdvancedCriteria. Default is "iContains" unless allowExpressions is enabled for the form as a whole, in which case the default is "iContainsPattern".

      Does not apply to special fields where exact match is obviously the right default setting, such as fields of type:"enum", or fields with a valueMap or optionDataSource.

      defaultSearchOperator also has no effect in a form that does not produce AdvancedCriteria - see getValuesAsCriteria() for settings that cause a form to produce AdvancedCriteria.

      Returns:
      Current defaultSearchOperator value. Default value is null
    • setDisableValidation

      public DynamicForm setDisableValidation(Boolean disableValidation)
      If set to true, client-side validators will not run on the form when validate() is called. Server-side validators (if any) will still run on attempted save.
      Parameters:
      disableValidation - New disableValidation value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getDisableValidation

      public Boolean getDisableValidation()
      If set to true, client-side validators will not run on the form when validate() is called. Server-side validators (if any) will still run on attempted save.
      Returns:
      Current disableValidation value. Default value is null
      See Also:
    • setEditProxyConstructor

      public DynamicForm setEditProxyConstructor(String editProxyConstructor) throws IllegalStateException
      Default class used to construct the EditProxy for this component when the component is first placed into edit mode.
      Overrides:
      setEditProxyConstructor in class Canvas
      Parameters:
      editProxyConstructor - New editProxyConstructor value. Default value is "FormEditProxy"
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getEditProxyConstructor

      public String getEditProxyConstructor()
      Default class used to construct the EditProxy for this component when the component is first placed into edit mode.
      Overrides:
      getEditProxyConstructor in class Canvas
      Returns:
      Current editProxyConstructor value. Default value is "FormEditProxy"
      See Also:
    • setEncoding

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

      Note : This is an advanced setting

      Parameters:
      encoding - New encoding value. Default value is DynamicForm.NORMAL
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getEncoding

      public Encoding getEncoding()
      encoding for the form, use MULTIPART_ENCODING for file upload forms
      Returns:
      Current encoding value. Default value is DynamicForm.NORMAL
      See Also:
    • setErrorItemCellStyle

      public DynamicForm 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 - New errorItemCellStyle value. Default value is "formCellError"
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • 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:
      Current errorItemCellStyle value. Default value is "formCellError"
      See Also:
    • setErrorsPreamble

      public DynamicForm setErrorsPreamble(String errorsPreamble) throws IllegalStateException
      If showInlineErrors is false, all errors for the items in the form are rendered as a single item at the top of the form. This attribute specifies an introductory message rendered out before the individual error messages.
      Parameters:
      errorsPreamble - New errorsPreamble value. Default value is "The following errors were found"
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getErrorsPreamble

      public String getErrorsPreamble()
      If showInlineErrors is false, all errors for the items in the form are rendered as a single item at the top of the form. This attribute specifies an introductory message rendered out before the individual error messages.
      Returns:
      Current errorsPreamble value. Default value is "The following errors were found"
      See Also:
    • setFetchRequestProperties

      public DynamicForm setFetchRequestProperties(DSRequest fetchRequestProperties) throws IllegalStateException
      If autoFetchData is true, this attribute allows the developer to declaratively specify DSRequest properties for the initial fetchData() call.

      Note that any properties governing more specific request attributes for the initial fetch (such as autoFetchTextMatchStyle) will be applied on top of this properties block.

      Parameters:
      fetchRequestProperties - New fetchRequestProperties value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getFetchRequestProperties

      public DSRequest getFetchRequestProperties()
      If autoFetchData is true, this attribute allows the developer to declaratively specify DSRequest properties for the initial fetchData() call.

      Note that any properties governing more specific request attributes for the initial fetch (such as autoFetchTextMatchStyle) will be applied on top of this properties block.

      Returns:
      Current fetchRequestProperties value. Default value is null
      See Also:
    • setFileAccessFailedWarning

      public DynamicForm setFileAccessFailedWarning(String fileAccessFailedWarning)
      Warning to display to the user if a selected file in an UploadItem cannot be accessed. This will be displayed on form submission when the browser is unable to access the selected file for upload.

      Typically this indicates a browser-level security restriction - for example the file has been edited on the disk, or had its permissions changed after the user selected it, but before they attempted to submit the form.

      When this occurs the selected file will be cleared from the upload item and this message will be displayed to the user in a warn dialog.

      Parameters:
      fileAccessFailedWarning - New fileAccessFailedWarning value. Default value is "Unable to access the selected file(s) for upload. Please re-select the file and try again."
      Returns:
      DynamicForm instance, for chaining setter calls
    • getFileAccessFailedWarning

      public String getFileAccessFailedWarning()
      Warning to display to the user if a selected file in an UploadItem cannot be accessed. This will be displayed on form submission when the browser is unable to access the selected file for upload.

      Typically this indicates a browser-level security restriction - for example the file has been edited on the disk, or had its permissions changed after the user selected it, but before they attempted to submit the form.

      When this occurs the selected file will be cleared from the upload item and this message will be displayed to the user in a warn dialog.

      Returns:
      Current fileAccessFailedWarning value. Default value is "Unable to access the selected file(s) for upload. Please re-select the file and try again."
    • setFixedColWidths

      public DynamicForm 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 - New fixedColWidths value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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:
      Current fixedColWidths value. Default value is false
      See Also:
    • setFormSubmitFailedWarning

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

      Note : This is an advanced setting

      Parameters:
      formSubmitFailedWarning - New formSubmitFailedWarning value. Default value is "Form was unable to be submitted. The most likely cause for this is an invalid value in an upload field."
      Returns:
      DynamicForm instance, for chaining setter calls
    • getFormSubmitFailedWarning

      public String getFormSubmitFailedWarning()
      Warning to display to the user if an attempt to natively submit a form is unable to submit to the server. The most common cause for this failure is that the user has typed an invalid file-path into an upload type field.
      Returns:
      Current formSubmitFailedWarning value. Default value is "Form was unable to be submitted. The most likely cause for this is an invalid value in an upload field."
    • setHiliteRequiredFields

      public DynamicForm setHiliteRequiredFields(Boolean hiliteRequiredFields)
      Indicates whether the titles of required items in this form should use the special prefix and suffix specified by the requiredTitlePrefix and requiredTitleSuffix attributes, instead of the standard prefix and suffix.
      Parameters:
      hiliteRequiredFields - New hiliteRequiredFields value. Default value is true
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getHiliteRequiredFields

      public Boolean getHiliteRequiredFields()
      Indicates whether the titles of required items in this form should use the special prefix and suffix specified by the requiredTitlePrefix and requiredTitleSuffix attributes, instead of the standard prefix and suffix.
      Returns:
      Current hiliteRequiredFields value. Default value is true
      See Also:
    • setImplicitSave

      public DynamicForm setImplicitSave(Boolean implicitSave)
      When true, indicates that changes to items in this form will be automatically saved on a delay, as well as when the entire form is submitted. Unless form.implicitSaveOnBlur is set to false, changes will also be automatically saved on editorExit for each item. This attribute can also be set directly on FormItems.
      Parameters:
      implicitSave - New implicitSave value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
    • getImplicitSave

      public Boolean getImplicitSave()
      When true, indicates that changes to items in this form will be automatically saved on a delay, as well as when the entire form is submitted. Unless form.implicitSaveOnBlur is set to false, changes will also be automatically saved on editorExit for each item. This attribute can also be set directly on FormItems.
      Returns:
      Current implicitSave value. Default value is false
    • setImplicitSaveDelay

      public DynamicForm setImplicitSaveDelay(int implicitSaveDelay)
      When implicitSave is true, this attribute dictates the millisecond delay after which form items are automatically saved during editing.
      Parameters:
      implicitSaveDelay - New implicitSaveDelay value. Default value is 2000
      Returns:
      DynamicForm instance, for chaining setter calls
    • getImplicitSaveDelay

      public int getImplicitSaveDelay()
      When implicitSave is true, this attribute dictates the millisecond delay after which form items are automatically saved during editing.
      Returns:
      Current implicitSaveDelay value. Default value is 2000
    • setImplicitSaveOnBlur

      public DynamicForm setImplicitSaveOnBlur(Boolean implicitSaveOnBlur)
      If true, form item values will be automatically saved when each item's "editorExit" handler is fired as well as on a delay and when the entire form is submitted. This attribute can also be set directly on FormItems.
      Parameters:
      implicitSaveOnBlur - New implicitSaveOnBlur value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
    • getImplicitSaveOnBlur

      public Boolean getImplicitSaveOnBlur()
      If true, form item values will be automatically saved when each item's "editorExit" handler is fired as well as on a delay and when the entire form is submitted. This attribute can also be set directly on FormItems.
      Returns:
      Current implicitSaveOnBlur value. Default value is false
    • setInitialSort

      public DynamicForm setInitialSort(SortSpecifier... initialSort) throws IllegalStateException
      An array of SortSpecifier objects used to set up the initial sort configuration for this form.
      Parameters:
      initialSort - New initialSort value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getInitialSort

      public SortSpecifier[] getInitialSort()
      An array of SortSpecifier objects used to set up the initial sort configuration for this form.
      Returns:
      Current initialSort value. Default value is null
    • setItemHoverAlign

      public DynamicForm setItemHoverAlign(Alignment itemHoverAlign)
      Text alignment for hovers shown for items
      Parameters:
      itemHoverAlign - New itemHoverAlign value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getItemHoverAlign

      public Alignment getItemHoverAlign()
      Text alignment for hovers shown for items
      Returns:
      Current itemHoverAlign value. Default value is null
      See Also:
    • setItemHoverDelay

      public DynamicForm 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 - New itemHoverDelay value. Default value is 500
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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:
      Current itemHoverDelay value. Default value is 500
      See Also:
    • setItemHoverHeight

      public DynamicForm setItemHoverHeight(Integer itemHoverHeight)
      A default height for hovers shown for items
      Parameters:
      itemHoverHeight - New itemHoverHeight value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getItemHoverHeight

      public Integer getItemHoverHeight()
      A default height for hovers shown for items
      Returns:
      Current itemHoverHeight value. Default value is null
      See Also:
    • setItemHoverHeight

      public DynamicForm setItemHoverHeight(String itemHoverHeight)
      A default height for hovers shown for items
      Parameters:
      itemHoverHeight - New itemHoverHeight value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getItemHoverHeightAsString

      public String getItemHoverHeightAsString()
      A default height for hovers shown for items
      Returns:
      Current itemHoverHeight value. Default value is null
      See Also:
    • setItemHoverOpacity

      public DynamicForm setItemHoverOpacity(Integer itemHoverOpacity)
      Opacity for hovers shown for items
      Parameters:
      itemHoverOpacity - New itemHoverOpacity value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getItemHoverOpacity

      public Integer getItemHoverOpacity()
      Opacity for hovers shown for items
      Returns:
      Current itemHoverOpacity value. Default value is null
      See Also:
    • setItemHoverStyle

      public DynamicForm setItemHoverStyle(String itemHoverStyle)
      CSS Style for hovers shown for items
      Parameters:
      itemHoverStyle - New itemHoverStyle value. Default value is "formHover"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getItemHoverStyle

      public String getItemHoverStyle()
      CSS Style for hovers shown for items
      Returns:
      Current itemHoverStyle value. Default value is "formHover"
      See Also:
    • setItemHoverVAlign

      public DynamicForm setItemHoverVAlign(Integer itemHoverVAlign)
      Vertical text alignment for hovers shown for items
      Parameters:
      itemHoverVAlign - New itemHoverVAlign value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getItemHoverVAlign

      public Integer getItemHoverVAlign()
      Vertical text alignment for hovers shown for items
      Returns:
      Current itemHoverVAlign value. Default value is null
      See Also:
    • setItemHoverVAlign

      public DynamicForm setItemHoverVAlign(String itemHoverVAlign)
      Vertical text alignment for hovers shown for items
      Parameters:
      itemHoverVAlign - New itemHoverVAlign value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getItemHoverVAlignAsString

      public String getItemHoverVAlignAsString()
      Vertical text alignment for hovers shown for items
      Returns:
      Current itemHoverVAlign value. Default value is null
      See Also:
    • setItemHoverWidth

      public DynamicForm setItemHoverWidth(Integer itemHoverWidth)
      A default width for hovers shown for items
      Parameters:
      itemHoverWidth - New itemHoverWidth value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getItemHoverWidth

      public Integer getItemHoverWidth()
      A default width for hovers shown for items
      Returns:
      Current itemHoverWidth value. Default value is null
      See Also:
    • setItemHoverWidth

      public DynamicForm setItemHoverWidth(String itemHoverWidth)
      A default width for hovers shown for items
      Parameters:
      itemHoverWidth - New itemHoverWidth value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getItemHoverWidthAsString

      public String getItemHoverWidthAsString()
      A default width for hovers shown for items
      Returns:
      Current itemHoverWidth value. Default value is null
      See Also:
    • setItemLayout

      public DynamicForm 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:

      • titles, which normally take up an adjacent cell, are not shown. Use StaticTextItems to show titles
      • no automatic reflow when showing or hiding items. FormItem.setLeft() and FormItem.setTop() can be used for manual reflow.
      • only pixel and percent sizes are allowed, no "*". Percent widths mean percentage of the overall form size rather than the column size
      • with different font styling or internationalized titles, items may overlap that did not overlap in the skin used at design time

      Note : This is an advanced setting

      Parameters:
      itemLayout - New itemLayout value. Default value is "table"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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:

      • titles, which normally take up an adjacent cell, are not shown. Use StaticTextItems to show titles
      • no automatic reflow when showing or hiding items. FormItem.setLeft() and FormItem.setTop() can be used for manual reflow.
      • only pixel and percent sizes are allowed, no "*". Percent widths mean percentage of the overall form size rather than the column size
      • with different font styling or internationalized titles, items may overlap that did not overlap in the skin used at design time
      Returns:
      Current itemLayout value. Default value is "table"
      See Also:
    • setLinearAutoSpanItems

      public DynamicForm setLinearAutoSpanItems(Boolean linearAutoSpanItems)
      When a form is rendered in linearMode, should each item appear on its own row, spanning the full set of rendered columns by default?
      Parameters:
      linearAutoSpanItems - New linearAutoSpanItems value. Default value is true
      Returns:
      DynamicForm instance, for chaining setter calls
    • getLinearAutoSpanItems

      public Boolean getLinearAutoSpanItems()
      When a form is rendered in linearMode, should each item appear on its own row, spanning the full set of rendered columns by default?
      Returns:
      Current linearAutoSpanItems value. Default value is true
    • setLinearHintWidth

      public DynamicForm setLinearHintWidth(int linearHintWidth)
      When linearMode is true, this property sets the amount of space reserved for hint-text in formItems that set a hint. May be set to a pixel-size like 100 or a percentage, such as "30%".
      Parameters:
      linearHintWidth - New linearHintWidth value. Default value is 100
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getLinearHintWidth

      public int getLinearHintWidth()
      When linearMode is true, this property sets the amount of space reserved for hint-text in formItems that set a hint. May be set to a pixel-size like 100 or a percentage, such as "30%".
      Returns:
      Current linearHintWidth value. Default value is 100
      See Also:
    • setLinearHintWidth

      public DynamicForm setLinearHintWidth(String linearHintWidth)
      When linearMode is true, this property sets the amount of space reserved for hint-text in formItems that set a hint. May be set to a pixel-size like 100 or a percentage, such as "30%".
      Parameters:
      linearHintWidth - New linearHintWidth value. Default value is 100
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getLinearHintWidthAsString

      public String getLinearHintWidthAsString()
      When linearMode is true, this property sets the amount of space reserved for hint-text in formItems that set a hint. May be set to a pixel-size like 100 or a percentage, such as "30%".
      Returns:
      Current linearHintWidth value. Default value is 100
      See Also:
    • setLinearMode

      public DynamicForm setLinearMode(Boolean linearMode)
      Switches the entire form to render in a style that is typical for form on a mobile device with one FormItem per row.

      The linearOnMobile attribute allows linear mode to be enabled on mobile interfaces automatically.

      While linearMode is active, the form's table layout is determined using the following logic:

      • If TitleOrientation is not explicitly specified, it will be defaulted to top, causing each item's title to appear above its element.
        Note: in linear mode, each item will have the same title orientation. The item-level FormItem.titleOrientation attribute will be ignored.
      • For those items with a hint that support showing the hint in the field, showHintInField will be defaulted true if unset.
      • For items showing validation errors inline, by default error text will be displayed, and errors will be rendered above the item element.
      • The numCols property for the form is ignored. The form will render as a single column of items - or two columns if titleOrientation is specified as "left" or "right" by default. To override this, a developer may specify an explicit linearNumCols allowing multiple items to potentially be placed next to each other.
      • FormItem.width is ignored and all items receive "*" width unless FormItem.linearWidth is specified.
      Note that if column widths have been specified via colWidths, but the number of columns doesn't match the number of columns being rendered in linear mode, it will be ignored.

      If linearAutoSpanItems is true, each item in linear mode will span the full set of columns by default. With this setting enabled, linearNumCols can be understood as a way to allow some items that are known to not require the full width of the UI to appear next to each other in an otherwise single-column form.

      When linearAutoSpanItems is enabled, the following properties are available for further customizing the placement and sizing of items in a linear form:

      For the best appearance, try to get your form to horizontally fill the screen, or almost all of it, on handset-sized devices. Any kind of fixed width on mobile is probably not going to work as well. One way to achieve this is by using a SplitPane.
      Parameters:
      linearMode - New linearMode value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getLinearMode

      public Boolean getLinearMode()
      Switches the entire form to render in a style that is typical for form on a mobile device with one FormItem per row.

      The linearOnMobile attribute allows linear mode to be enabled on mobile interfaces automatically.

      While linearMode is active, the form's table layout is determined using the following logic:

      • If TitleOrientation is not explicitly specified, it will be defaulted to top, causing each item's title to appear above its element.
        Note: in linear mode, each item will have the same title orientation. The item-level FormItem.titleOrientation attribute will be ignored.
      • For those items with a hint that support showing the hint in the field, showHintInField will be defaulted true if unset.
      • For items showing validation errors inline, by default error text will be displayed, and errors will be rendered above the item element.
      • The numCols property for the form is ignored. The form will render as a single column of items - or two columns if titleOrientation is specified as "left" or "right" by default. To override this, a developer may specify an explicit linearNumCols allowing multiple items to potentially be placed next to each other.
      • FormItem.width is ignored and all items receive "*" width unless FormItem.linearWidth is specified.
      Note that if column widths have been specified via colWidths, but the number of columns doesn't match the number of columns being rendered in linear mode, it will be ignored.

      If linearAutoSpanItems is true, each item in linear mode will span the full set of columns by default. With this setting enabled, linearNumCols can be understood as a way to allow some items that are known to not require the full width of the UI to appear next to each other in an otherwise single-column form.

      When linearAutoSpanItems is enabled, the following properties are available for further customizing the placement and sizing of items in a linear form:

      For the best appearance, try to get your form to horizontally fill the screen, or almost all of it, on handset-sized devices. Any kind of fixed width on mobile is probably not going to work as well. One way to achieve this is by using a SplitPane.
      Returns:
      Current linearMode value. Default value is null
      See Also:
    • setLinearNumCols

      public DynamicForm setLinearNumCols(Integer linearNumCols)
      Specifies the number of columns when the form is being rendered in linearMode, overriding any automatically derived value in that mode.
      Parameters:
      linearNumCols - New linearNumCols value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getLinearNumCols

      public Integer getLinearNumCols()
      Specifies the number of columns when the form is being rendered in linearMode, overriding any automatically derived value in that mode.
      Returns:
      Current linearNumCols value. Default value is null
      See Also:
    • setLinearOnMobile

      public DynamicForm setLinearOnMobile(boolean linearOnMobile) throws IllegalStateException
      Switches the entire form to render in a style that is typical for form on a handset device with one FormItem per row by automatically defaulting linearMode to true on handsets.

      Note: This property should not be changed framework-wide via addProperties() as the framework itself assumes and relies upon normal behavior for forms. If you want most of your forms to use linearMode on mobile, create a subclass where linearOnMobile defaults to true, and pervasively use that subclass.

      Parameters:
      linearOnMobile - New linearOnMobile value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getLinearOnMobile

      public boolean getLinearOnMobile()
      Switches the entire form to render in a style that is typical for form on a handset device with one FormItem per row by automatically defaulting linearMode to true on handsets.

      Note: This property should not be changed framework-wide via addProperties() as the framework itself assumes and relies upon normal behavior for forms. If you want most of your forms to use linearMode on mobile, create a subclass where linearOnMobile defaults to true, and pervasively use that subclass.

      Returns:
      Current linearOnMobile value. Default value is false
      See Also:
    • setLongTextEditorThreshold

      public DynamicForm 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 - New longTextEditorThreshold value. Default value is 255
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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:
      Current longTextEditorThreshold value. Default value is 255
      See Also:
    • setLongTextEditorType

      public DynamicForm setLongTextEditorType(String longTextEditorType)
      Name of the Form Item class to use for text fields which exceed the longTextEditorThreshold for this form.
      Parameters:
      longTextEditorType - New longTextEditorType value. Default value is "textArea"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getLongTextEditorType

      public String getLongTextEditorType()
      Name of the Form Item class to use for text fields which exceed the longTextEditorThreshold for this form.
      Returns:
      Current longTextEditorType value. Default value is "textArea"
      See Also:
    • setMethod

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

      If this method is called after the component has been drawn/initialized: Sets the method for this form.

      Parameters:
      method - html form submission method (get or post). Default value is DynamicForm.POST
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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:
      Current method value. Default value is DynamicForm.POST
      See Also:
    • setMinColWidth

      public DynamicForm setMinColWidth(int minColWidth)
      Minimum width of a form column.
      Parameters:
      minColWidth - New minColWidth value. Default value is 20
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getMinColWidth

      public int getMinColWidth()
      Minimum width of a form column.
      Returns:
      Current minColWidth value. Default value is 20
      See Also:
    • setMinHintWidth

      public DynamicForm setMinHintWidth(Integer minHintWidth) throws IllegalStateException
      Minimum horizontal space made available for FormItem.hint text. Typically this reflects how much space the hint text takes up before it wraps. May be overridden at the item level via FormItem.minHintWidth.

      This setting does not apply to hints that are shown in field.

      Parameters:
      minHintWidth - New minHintWidth value. Default value is 80
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getMinHintWidth

      public Integer getMinHintWidth()
      Minimum horizontal space made available for FormItem.hint text. Typically this reflects how much space the hint text takes up before it wraps. May be overridden at the item level via FormItem.minHintWidth.

      This setting does not apply to hints that are shown in field.

      Returns:
      Current minHintWidth value. Default value is 80
      See Also:
    • setNoErrorDetailsMessage

      public DynamicForm setNoErrorDetailsMessage(String noErrorDetailsMessage)
      A message to display to the user if server-side validation fails with an error but the server did not provide an error message
      Parameters:
      noErrorDetailsMessage - New noErrorDetailsMessage value. Default value is "Error during validation; no error details were provided"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getNoErrorDetailsMessage

      public String getNoErrorDetailsMessage()
      A message to display to the user if server-side validation fails with an error but the server did not provide an error message
      Returns:
      Current noErrorDetailsMessage value. Default value is "Error during validation; no error details were provided"
      See Also:
    • setNumCols

      public DynamicForm 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 - New numCols value. Default value is 2
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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:
      Current numCols value. Default value is 2
      See Also:
    • setOperator

      public DynamicForm setOperator(OperatorId operator) throws IllegalStateException
      When FormItem.operator has been set for any FormItem in this form, what logical operator should be applied across the criteria produced by the form items? Only applicable to forms that have a dataSource.
      Parameters:
      operator - New operator value. Default value is "and"
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getOperator

      public OperatorId getOperator()
      When FormItem.operator has been set for any FormItem in this form, what logical operator should be applied across the criteria produced by the form items? Only applicable to forms that have a dataSource.
      Returns:
      Current operator value. Default value is "and"
    • setOriginalValueMessage

      public DynamicForm setOriginalValueMessage(String originalValueMessage)
      Default template HTML string when an item does not set its own FormItem.originalValueMessage.

      Variables in the template are substituted as follows:

      Variable Substitution
      $value The item's old value as stored in the map returned by getOldValues().
      $newValue The item's new value.

      For $value and $newValue, any formatters or stored/display value mapping will be applied.

      Note : This is an advanced setting

      Parameters:
      originalValueMessage - New originalValueMessage value. Default value is "Original value: $value"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getOriginalValueMessage

      public String getOriginalValueMessage()
      Default template HTML string when an item does not set its own FormItem.originalValueMessage.

      Variables in the template are substituted as follows:

      Variable Substitution
      $value The item's old value as stored in the map returned by getOldValues().
      $newValue The item's new value.

      For $value and $newValue, any formatters or stored/display value mapping will be applied.

      Returns:
      Current originalValueMessage value. Default value is "Original value: $value"
      See Also:
    • setReadOnlyDisplay

      public DynamicForm setReadOnlyDisplay(ReadOnlyDisplayAppearance readOnlyDisplay)
      If canEdit is set to false, how should the items in this form be displayed to the user?

      Can be overridden via FormItem.readOnlyDisplay on individual form items.

      If this method is called after the component has been drawn/initialized: Setter for the readOnlyDisplay attribute.

      Parameters:
      readOnlyDisplay - New read-only display appearance. Default value is "readOnly"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getReadOnlyDisplay

      public ReadOnlyDisplayAppearance getReadOnlyDisplay()
      If canEdit is set to false, how should the items in this form be displayed to the user?

      Can be overridden via FormItem.readOnlyDisplay on individual form items.

      Returns:
      Current readOnlyDisplay value. Default value is "readOnly"
      See Also:
    • setReadOnlyTextBoxStyle

      public DynamicForm setReadOnlyTextBoxStyle(String readOnlyTextBoxStyle)
      Default FormItem.readOnlyTextBoxStyle setting for items in this form.

      Note: The default style may vary depending on the skin.

      Parameters:
      readOnlyTextBoxStyle - New readOnlyTextBoxStyle value. Default value is "staticTextItem"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getReadOnlyTextBoxStyle

      public String getReadOnlyTextBoxStyle()
      Default FormItem.readOnlyTextBoxStyle setting for items in this form.

      Note: The default style may vary depending on the skin.

      Returns:
      Current readOnlyTextBoxStyle value. Default value is "staticTextItem"
      See Also:
    • setRejectInvalidValueOnChange

      public DynamicForm 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 - New rejectInvalidValueOnChange value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
    • 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:
      Current rejectInvalidValueOnChange value. Default value is null
    • setRequiredMessage

      public DynamicForm setRequiredMessage(String requiredMessage)
      The required message for required field errors.
      Parameters:
      requiredMessage - New requiredMessage value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getRequiredMessage

      public String getRequiredMessage()
      The required message for required field errors.
      Returns:
      Current requiredMessage value. Default value is null
      See Also:
    • setRequiredRightTitlePrefix

      public DynamicForm setRequiredRightTitlePrefix(String requiredRightTitlePrefix)
      The string pre-pended to the title of every required item in this form if hiliteRequiredFields is true and the TitleOrientation property is set to "right".
      Parameters:
      requiredRightTitlePrefix - New requiredRightTitlePrefix value. Default value is "<b>:&nbsp;"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getRequiredRightTitlePrefix

      public String getRequiredRightTitlePrefix()
      The string pre-pended to the title of every required item in this form if hiliteRequiredFields is true and the TitleOrientation property is set to "right".
      Returns:
      Current requiredRightTitlePrefix value. Default value is "<b>:&nbsp;"
      See Also:
    • setRequiredRightTitleSuffix

      public DynamicForm setRequiredRightTitleSuffix(String requiredRightTitleSuffix)
      The string appended to the title of every required item in this form if hiliteRequiredFields is true and the TitleOrientation property is set to "right".
      Parameters:
      requiredRightTitleSuffix - New requiredRightTitleSuffix value. Default value is "</b>"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getRequiredRightTitleSuffix

      public String getRequiredRightTitleSuffix()
      The string appended to the title of every required item in this form if hiliteRequiredFields is true and the TitleOrientation property is set to "right".
      Returns:
      Current requiredRightTitleSuffix value. Default value is "</b>"
      See Also:
    • setRequiredTitlePrefix

      public DynamicForm setRequiredTitlePrefix(String requiredTitlePrefix)
      The string pre-pended to the title of every required item in this form if hiliteRequiredFields is true.
      Parameters:
      requiredTitlePrefix - New requiredTitlePrefix value. Default value is "<b>"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getRequiredTitlePrefix

      public String getRequiredTitlePrefix()
      The string pre-pended to the title of every required item in this form if hiliteRequiredFields is true.
      Returns:
      Current requiredTitlePrefix value. Default value is "<b>"
      See Also:
    • setRequiredTitleSuffix

      public DynamicForm setRequiredTitleSuffix(String requiredTitleSuffix)
      The string appended to the title of every required item in this form if hiliteRequiredFields is true.
      Parameters:
      requiredTitleSuffix - New requiredTitleSuffix value. Default value is "&nbsp;:</b>"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getRequiredTitleSuffix

      public String getRequiredTitleSuffix()
      The string appended to the title of every required item in this form if hiliteRequiredFields is true.
      Returns:
      Current requiredTitleSuffix value. Default value is "&nbsp;:</b>"
      See Also:
    • setRevertValueKey

      public DynamicForm setRevertValueKey(KeyIdentifier revertValueKey) throws IllegalStateException
      Keyboard shortcut that causes the value of the currently focused form item to be reverted to whatever value would be shown if resetValues() were called.
      Parameters:
      revertValueKey - New revertValueKey value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getRevertValueKey

      public KeyIdentifier getRevertValueKey()
      Keyboard shortcut that causes the value of the currently focused form item to be reverted to whatever value would be shown if resetValues() were called.
      Returns:
      Current revertValueKey value. Default value is null
      See Also:
    • setRightTitlePrefix

      public DynamicForm setRightTitlePrefix(String rightTitlePrefix)
      The string pre-pended to the title of an item in this form if its titleOrientation property is set to "right".
      Parameters:
      rightTitlePrefix - New rightTitlePrefix value. Default value is ":&nbsp;"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getRightTitlePrefix

      public String getRightTitlePrefix()
      The string pre-pended to the title of an item in this form if its titleOrientation property is set to "right".
      Returns:
      Current rightTitlePrefix value. Default value is ":&nbsp;"
      See Also:
    • setRightTitleSuffix

      public DynamicForm 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 - New rightTitleSuffix value. Default value is ""
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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:
      Current rightTitleSuffix value. Default value is ""
      See Also:
    • setSaveOnEnter

      public DynamicForm setSaveOnEnter(Boolean saveOnEnter)
      If true, when the user hits the Enter key while focused in a text-item in this form, we automatically submit the form to the server using the submit() method.
      Parameters:
      saveOnEnter - New saveOnEnter value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getSaveOnEnter

      public Boolean getSaveOnEnter()
      If true, when the user hits the Enter key while focused in a text-item in this form, we automatically submit the form to the server using the submit() method.
      Returns:
      Current saveOnEnter value. Default value is false
      See Also:
    • setSaveOperationType

      public DynamicForm setSaveOperationType(DSOperationType saveOperationType)
      Default DSOperationType to be performed when saveData() is called. This property is automatically set on a call to editRecord() or editNewRecord(), or may be set directly via setSaveOperationType().

      If saveOperationType is unset, the form will heuristically determine whether an "add" or "update" operation is intended based on whether the primaryKey field is present and editable.

      If this method is called after the component has been drawn/initialized: Setter for the default DSOperationType when saveData() is called. Note that this property can also be set by calling editRecord() or editNewRecord()

      Parameters:
      saveOperationType - Operation type to use as a default. Valid values are "add" or "update". Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
    • getSaveOperationType

      public DSOperationType getSaveOperationType()
      Default DSOperationType to be performed when saveData() is called. This property is automatically set on a call to editRecord() or editNewRecord(), or may be set directly via setSaveOperationType().

      If saveOperationType is unset, the form will heuristically determine whether an "add" or "update" operation is intended based on whether the primaryKey field is present and editable.

      Returns:
      Returns the DSOperationType to be performed when saveData() or ValuesManager.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 this.saveOperationType will be returned if set. Note that saveOperationType is automatically set via calls to data binding methods such as editNewRecord(), or it may be set explicitly.

      If no explicit saveOperationType is present, the system will use the following heuristic to determine the save operationType:

      • If the form has no value for the primaryKey field this method will return "add". The assumption is that this is a new record, and the field will be populated when the record is created, (as with a "sequence" type field).
      • If, when the form's values were populated, the form had value for the primaryKey field but it has subsequently be changed, this method will return "add". In this case the value has been changed, either by the user or programmatically so a different (new) record is assumed. This is determined by looking at the oldValues for the form.
      • If the primaryKey field is editable and a value is now present for the primary key field, but was not present in the oldValues for the form, this method will return "add". In this case either no initial values were provided, or a 'sparse' set of values for a new record (with no primary key) were provided to the form and the user has subsequently explicitly entered a new primaryKey field value.
      • Otherwise this method will return "update". Either the primaryKey field is non editable, or the user has not changed it from its initial value.
      . Default value is null
    • setSectionVisibilityMode

      public DynamicForm setSectionVisibilityMode(VisibilityMode sectionVisibilityMode)
      If the form has sections, [implemented as SectionItems], this attribute controls whether multiple sections can be expanded at once.
      Parameters:
      sectionVisibilityMode - New sectionVisibilityMode value. Default value is "multiple"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getSectionVisibilityMode

      public VisibilityMode getSectionVisibilityMode()
      If the form has sections, [implemented as SectionItems], this attribute controls whether multiple sections can be expanded at once.
      Returns:
      Current sectionVisibilityMode value. Default value is "multiple"
      See Also:
    • setSelectOnClick

      public DynamicForm setSelectOnClick(Boolean selectOnClick)
      If this property is set to true, whenever a text-based field in this form (TextItem, TextAreaItem) is given focus - whether programmatically (see focusInItem()), or via a mouse click, all text within the item will be selected.

      If you only want the value to be selected when on programmatic focus or keyboard navigation (this is the native browser behavior), set selectOnFocus instead.

      May be overridden at the form item level via FormItem.selectOnClick.

      Parameters:
      selectOnClick - New selectOnClick value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getSelectOnClick

      public Boolean getSelectOnClick()
      If this property is set to true, whenever a text-based field in this form (TextItem, TextAreaItem) is given focus - whether programmatically (see focusInItem()), or via a mouse click, all text within the item will be selected.

      If you only want the value to be selected when on programmatic focus or keyboard navigation (this is the native browser behavior), set selectOnFocus instead.

      May be overridden at the form item level via FormItem.selectOnClick.

      Returns:
      Current selectOnClick value. Default value is false
      See Also:
    • setSelectOnFocus

      public DynamicForm 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()), all text within the item will be selected.

      Note that this flag affects only programmatic focus. It's the normal behavior of text fields to select all text if the user navigates into them via keyboard, or if the user navigates via mouse, to place the text insertion point at the mouse click, and Smart GWT preserves these behaviors. selectOnFocus is only needed for cases like a form within a pop-up dialog that should have the first field selected.

      If you also want the value to be selected when the user clicks on the field, set selectOnClick instead.

      If selectOnFocus is false, the selection is not modified on focus - any previous selection within the item will be maintained.

      May be overridden at the form item level via FormItem.selectOnFocus.

      Parameters:
      selectOnFocus - New selectOnFocus value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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()), all text within the item will be selected.

      Note that this flag affects only programmatic focus. It's the normal behavior of text fields to select all text if the user navigates into them via keyboard, or if the user navigates via mouse, to place the text insertion point at the mouse click, and Smart GWT preserves these behaviors. selectOnFocus is only needed for cases like a form within a pop-up dialog that should have the first field selected.

      If you also want the value to be selected when the user clicks on the field, set selectOnClick instead.

      If selectOnFocus is false, the selection is not modified on focus - any previous selection within the item will be maintained.

      May be overridden at the form item level via FormItem.selectOnFocus.

      Returns:
      Current selectOnFocus value. Default value is false
      See Also:
    • setShowComplexFieldsRecursively

      public DynamicForm 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 - New showComplexFieldsRecursively value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      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:
      Current showComplexFieldsRecursively value. Default value is null
    • setShowDeletions

      public DynamicForm setShowDeletions(Boolean showDeletions) throws IllegalStateException
      Default FormItem.showDeletions setting for items in this form.

      Note : This is an advanced setting

      Parameters:
      showDeletions - New showDeletions value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowDeletions

      public Boolean getShowDeletions()
      Default FormItem.showDeletions setting for items in this form.
      Returns:
      Current showDeletions value. Default value is null
    • setShowDetailFields

      public DynamicForm setShowDetailFields(Boolean showDetailFields) throws IllegalStateException
      For databound forms, whether to show fields marked as detail fields.
      Specified by:
      setShowDetailFields in interface DataBoundComponent
      Parameters:
      showDetailFields - New showDetailFields value. Default value is true
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowDetailFields

      public Boolean getShowDetailFields()
      For databound forms, whether to show fields marked as detail fields.
      Specified by:
      getShowDetailFields in interface DataBoundComponent
      Returns:
      Current showDetailFields value. Default value is true
    • setShowErrorIcons

      public DynamicForm setShowErrorIcons(Boolean showErrorIcons)
      showErrorIcons, showErrorText, errorOrientation, and showErrorStyle control how validation errors are displayed when they are displayed inline in the form (next to the form item where there is a validation error). To instead display all errors at the top of the form, set showInlineErrors:false.

      showErrorIcons, showErrorText, errorOrientation and showErrorStyle are all boolean properties, and can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.

      The HTML displayed next to a form item with errors is generated by FormItem.getErrorHTML(). The default implementation of that method respects showErrorIcons and showErrorText as follows:

      showErrorIcons, or showErrorIcon at the FormItem level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance is governed by FormItem.errorIconSrc, FormItem.errorIconWidth and FormItem.errorIconHeight

      showErrorText determines whether the text of the validation error should be displayed next to fields which have validation errors. The attribute showTitlesWithErrorMessages may be set to prefix error messages with the form item's title + ":" (may be desired if the item has FormItem.showTitle set to false).
      If showErrorText is unset, the error text will be shown if linearMode is true (or linearOnMobile is true for mobile devices), otherwise it will not be shown.

      In addition to this:

      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).
      If errorOrientation is unset, the error orientation will default to "top" if linearMode is enabled (or linearOnMobile is true for mobile devices) and error text is not showing, "left" otherwise.

      showErrorStyle determines whether fields with validation errors should have special styling applied to them. Error styling is achieved by applying suffixes to existing styling applied to various parts of the form item. See FormItemBaseStyle for more on this.

      Parameters:
      showErrorIcons - New showErrorIcons value. Default value is true
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getShowErrorIcons

      public Boolean getShowErrorIcons()
      showErrorIcons, showErrorText, errorOrientation, and showErrorStyle control how validation errors are displayed when they are displayed inline in the form (next to the form item where there is a validation error). To instead display all errors at the top of the form, set showInlineErrors:false.

      showErrorIcons, showErrorText, errorOrientation and showErrorStyle are all boolean properties, and can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.

      The HTML displayed next to a form item with errors is generated by FormItem.getErrorHTML(). The default implementation of that method respects showErrorIcons and showErrorText as follows:

      showErrorIcons, or showErrorIcon at the FormItem level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance is governed by FormItem.errorIconSrc, FormItem.errorIconWidth and FormItem.errorIconHeight

      showErrorText determines whether the text of the validation error should be displayed next to fields which have validation errors. The attribute showTitlesWithErrorMessages may be set to prefix error messages with the form item's title + ":" (may be desired if the item has FormItem.showTitle set to false).
      If showErrorText is unset, the error text will be shown if linearMode is true (or linearOnMobile is true for mobile devices), otherwise it will not be shown.

      In addition to this:

      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).
      If errorOrientation is unset, the error orientation will default to "top" if linearMode is enabled (or linearOnMobile is true for mobile devices) and error text is not showing, "left" otherwise.

      showErrorStyle determines whether fields with validation errors should have special styling applied to them. Error styling is achieved by applying suffixes to existing styling applied to various parts of the form item. See FormItemBaseStyle for more on this.

      Returns:
      Current showErrorIcons value. Default value is true
      See Also:
    • setShowErrorStyle

      public DynamicForm setShowErrorStyle(Boolean showErrorStyle)
      showErrorIcons, showErrorText, errorOrientation, and showErrorStyle control how validation errors are displayed when they are displayed inline in the form (next to the form item where there is a validation error). To instead display all errors at the top of the form, set showInlineErrors:false.

      showErrorIcons, showErrorText, errorOrientation and showErrorStyle are all boolean properties, and can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.

      The HTML displayed next to a form item with errors is generated by FormItem.getErrorHTML(). The default implementation of that method respects showErrorIcons and showErrorText as follows:

      showErrorIcons, or showErrorIcon at the FormItem level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance is governed by FormItem.errorIconSrc, FormItem.errorIconWidth and FormItem.errorIconHeight

      showErrorText determines whether the text of the validation error should be displayed next to fields which have validation errors. The attribute showTitlesWithErrorMessages may be set to prefix error messages with the form item's title + ":" (may be desired if the item has FormItem.showTitle set to false).
      If showErrorText is unset, the error text will be shown if linearMode is true (or linearOnMobile is true for mobile devices), otherwise it will not be shown.

      In addition to this:

      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).
      If errorOrientation is unset, the error orientation will default to "top" if linearMode is enabled (or linearOnMobile is true for mobile devices) and error text is not showing, "left" otherwise.

      showErrorStyle determines whether fields with validation errors should have special styling applied to them. Error styling is achieved by applying suffixes to existing styling applied to various parts of the form item. See FormItemBaseStyle for more on this.

      Parameters:
      showErrorStyle - New showErrorStyle value. Default value is true
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getShowErrorStyle

      public Boolean getShowErrorStyle()
      showErrorIcons, showErrorText, errorOrientation, and showErrorStyle control how validation errors are displayed when they are displayed inline in the form (next to the form item where there is a validation error). To instead display all errors at the top of the form, set showInlineErrors:false.

      showErrorIcons, showErrorText, errorOrientation and showErrorStyle are all boolean properties, and can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.

      The HTML displayed next to a form item with errors is generated by FormItem.getErrorHTML(). The default implementation of that method respects showErrorIcons and showErrorText as follows:

      showErrorIcons, or showErrorIcon at the FormItem level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance is governed by FormItem.errorIconSrc, FormItem.errorIconWidth and FormItem.errorIconHeight

      showErrorText determines whether the text of the validation error should be displayed next to fields which have validation errors. The attribute showTitlesWithErrorMessages may be set to prefix error messages with the form item's title + ":" (may be desired if the item has FormItem.showTitle set to false).
      If showErrorText is unset, the error text will be shown if linearMode is true (or linearOnMobile is true for mobile devices), otherwise it will not be shown.

      In addition to this:

      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).
      If errorOrientation is unset, the error orientation will default to "top" if linearMode is enabled (or linearOnMobile is true for mobile devices) and error text is not showing, "left" otherwise.

      showErrorStyle determines whether fields with validation errors should have special styling applied to them. Error styling is achieved by applying suffixes to existing styling applied to various parts of the form item. See FormItemBaseStyle for more on this.

      Returns:
      Current showErrorStyle value. Default value is true
      See Also:
    • setShowErrorText

      public DynamicForm setShowErrorText(Boolean showErrorText)
      showErrorIcons, showErrorText, errorOrientation, and showErrorStyle control how validation errors are displayed when they are displayed inline in the form (next to the form item where there is a validation error). To instead display all errors at the top of the form, set showInlineErrors:false.

      showErrorIcons, showErrorText, errorOrientation and showErrorStyle are all boolean properties, and can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.

      The HTML displayed next to a form item with errors is generated by FormItem.getErrorHTML(). The default implementation of that method respects showErrorIcons and showErrorText as follows:

      showErrorIcons, or showErrorIcon at the FormItem level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance is governed by FormItem.errorIconSrc, FormItem.errorIconWidth and FormItem.errorIconHeight

      showErrorText determines whether the text of the validation error should be displayed next to fields which have validation errors. The attribute showTitlesWithErrorMessages may be set to prefix error messages with the form item's title + ":" (may be desired if the item has FormItem.showTitle set to false).
      If showErrorText is unset, the error text will be shown if linearMode is true (or linearOnMobile is true for mobile devices), otherwise it will not be shown.

      In addition to this:

      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).
      If errorOrientation is unset, the error orientation will default to "top" if linearMode is enabled (or linearOnMobile is true for mobile devices) and error text is not showing, "left" otherwise.

      showErrorStyle determines whether fields with validation errors should have special styling applied to them. Error styling is achieved by applying suffixes to existing styling applied to various parts of the form item. See FormItemBaseStyle for more on this.

      Parameters:
      showErrorText - New showErrorText value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getShowErrorText

      public Boolean getShowErrorText()
      showErrorIcons, showErrorText, errorOrientation, and showErrorStyle control how validation errors are displayed when they are displayed inline in the form (next to the form item where there is a validation error). To instead display all errors at the top of the form, set showInlineErrors:false.

      showErrorIcons, showErrorText, errorOrientation and showErrorStyle are all boolean properties, and can be set on a DynamicForm to control the behavior form-wide, or set on individual FormItems.

      The HTML displayed next to a form item with errors is generated by FormItem.getErrorHTML(). The default implementation of that method respects showErrorIcons and showErrorText as follows:

      showErrorIcons, or showErrorIcon at the FormItem level controls whether an error icon should appear next to fields which have validation errors. The icon's appearance is governed by FormItem.errorIconSrc, FormItem.errorIconWidth and FormItem.errorIconHeight

      showErrorText determines whether the text of the validation error should be displayed next to fields which have validation errors. The attribute showTitlesWithErrorMessages may be set to prefix error messages with the form item's title + ":" (may be desired if the item has FormItem.showTitle set to false).
      If showErrorText is unset, the error text will be shown if linearMode is true (or linearOnMobile is true for mobile devices), otherwise it will not be shown.

      In addition to this:

      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).
      If errorOrientation is unset, the error orientation will default to "top" if linearMode is enabled (or linearOnMobile is true for mobile devices) and error text is not showing, "left" otherwise.

      showErrorStyle determines whether fields with validation errors should have special styling applied to them. Error styling is achieved by applying suffixes to existing styling applied to various parts of the form item. See FormItemBaseStyle for more on this.

      Returns:
      Current showErrorText value. Default value is false
      See Also:
    • setShowImageAsURL

      public DynamicForm setShowImageAsURL(boolean showImageAsURL)
      For fields of type:"image", if the field is non editable, and being displayed with readOnlyDisplay:"static", should the value (URL) be displayed as text, or should an image be rendered?

      May be overridden for individual items via FormItem.showImageAsURL.

      Parameters:
      showImageAsURL - New showImageAsURL value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
    • getShowImageAsURL

      public boolean getShowImageAsURL()
      For fields of type:"image", if the field is non editable, and being displayed with readOnlyDisplay:"static", should the value (URL) be displayed as text, or should an image be rendered?

      May be overridden for individual items via FormItem.showImageAsURL.

      Returns:
      Current showImageAsURL value. Default value is false
    • setShowInlineErrors

      public DynamicForm 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 - New showInlineErrors value. Default value is true
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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:
      Current showInlineErrors value. Default value is true
      See Also:
    • setShowOldValueInHover

      public DynamicForm setShowOldValueInHover(Boolean showOldValueInHover)
      Default setting for the form items' FormItem.showOldValueInHover setting.

      Note : This is an advanced setting

      Parameters:
      showOldValueInHover - New showOldValueInHover value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
    • getShowOldValueInHover

      public Boolean getShowOldValueInHover()
      Default setting for the form items' FormItem.showOldValueInHover setting.
      Returns:
      Current showOldValueInHover value. Default value is null
    • setShowPending

      public DynamicForm setShowPending(Boolean showPending) throws IllegalStateException
      This property applies to all of the items that a form has, and works according to FormItem.showPending.

      Also, in a form with showPending:true, an individual FormItem can set showPending:false and vice versa.

      Note : This is an advanced setting

      Parameters:
      showPending - New showPending value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowPending

      public Boolean getShowPending()
      This property applies to all of the items that a form has, and works according to FormItem.showPending.

      Also, in a form with showPending:true, an individual FormItem can set showPending:false and vice versa.

      Returns:
      Current showPending value. Default value is null
    • setShowTitlesWithErrorMessages

      public DynamicForm setShowTitlesWithErrorMessages(Boolean showTitlesWithErrorMessages)
      Indicates whether on validation failure, the error message displayed to the user should be pre-pended with the title for the item.
      Parameters:
      showTitlesWithErrorMessages - New showTitlesWithErrorMessages value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getShowTitlesWithErrorMessages

      public Boolean getShowTitlesWithErrorMessages()
      Indicates whether on validation failure, the error message displayed to the user should be pre-pended with the title for the item.
      Returns:
      Current showTitlesWithErrorMessages value. Default value is false
      See Also:
    • setStopOnError

      public DynamicForm setStopOnError(Boolean stopOnError) throws IllegalStateException
      Indicates that if validation fails, the user should not be allowed to exit the field - focus will be forced back into the field until the error is corrected.

      Enabling this property also implies FormItem.validateOnExit is automatically enabled. If there are server-based validators on this item, setting this property also implies that FormItem.synchronousValidation is forced on.

      Parameters:
      stopOnError - New stopOnError value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getStopOnError

      public Boolean getStopOnError()
      Indicates that if validation fails, the user should not be allowed to exit the field - focus will be forced back into the field until the error is corrected.

      Enabling this property also implies FormItem.validateOnExit is automatically enabled. If there are server-based validators on this item, setting this property also implies that FormItem.synchronousValidation is forced on.

      Returns:
      Current stopOnError value. Default value is null
    • setStoreDisplayValues

      public DynamicForm setStoreDisplayValues(Boolean storeDisplayValues) throws IllegalStateException
      For editable fields with a specified FormItem.displayField and FormItem.optionDataSource, if the user selects a new value (typically from PickList based item such as a SelectItem), should the selected displayValue be updated on the record being edited in addition to the value for the actual item.
      Note that this only applies for fields using local display field values - typically foreignKey fields where the display field is included from another dataSource.

      Default value is true. This is typically desirable for editing records with a displayField-mapped field, as it ensures the edited record will be be updated to contain the correct display value as well as the correct data value. As such, the expected display value is available on the record for display (for example in a ListGrid cell).

      It may not be desirable for an interface specifically intended for gathering criteria - in this case, results ought to be limited by an item's actual selected value, not by whatever text is displayed to the user.

      See DataSourceField.displayField for more details.

      Note: the modified display field value will be passed to the server along with the modified foreignKey field value if a databound update operation is performed. This occurs even if the displayField is included from another DataSource and therefore read-only. In this case the server will simply ignore the modified display field value. This is as expected - a subsequent fetch for the same record would recalculate the displayField value on the server using the updated foreignKey field value (and return the same display value previously displayed to the user).

      This attribute can also be set for individual items.

      Note : This is an advanced setting

      Parameters:
      storeDisplayValues - New storeDisplayValues value. Default value is true
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getStoreDisplayValues

      public Boolean getStoreDisplayValues()
      For editable fields with a specified FormItem.displayField and FormItem.optionDataSource, if the user selects a new value (typically from PickList based item such as a SelectItem), should the selected displayValue be updated on the record being edited in addition to the value for the actual item.
      Note that this only applies for fields using local display field values - typically foreignKey fields where the display field is included from another dataSource.

      Default value is true. This is typically desirable for editing records with a displayField-mapped field, as it ensures the edited record will be be updated to contain the correct display value as well as the correct data value. As such, the expected display value is available on the record for display (for example in a ListGrid cell).

      It may not be desirable for an interface specifically intended for gathering criteria - in this case, results ought to be limited by an item's actual selected value, not by whatever text is displayed to the user.

      See DataSourceField.displayField for more details.

      Note: the modified display field value will be passed to the server along with the modified foreignKey field value if a databound update operation is performed. This occurs even if the displayField is included from another DataSource and therefore read-only. In this case the server will simply ignore the modified display field value. This is as expected - a subsequent fetch for the same record would recalculate the displayField value on the server using the updated foreignKey field value (and return the same display value previously displayed to the user).

      This attribute can also be set for individual items.

      Returns:
      Current storeDisplayValues value. Default value is true
    • setSuppressBrowserClearIcons

      public DynamicForm setSuppressBrowserClearIcons(boolean suppressBrowserClearIcons)
      Default TextItem.suppressBrowserClearIcon value for TextItems within this form.
      Parameters:
      suppressBrowserClearIcons - New suppressBrowserClearIcons value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
    • getSuppressBrowserClearIcons

      public boolean getSuppressBrowserClearIcons()
      Default TextItem.suppressBrowserClearIcon value for TextItems within this form.
      Returns:
      Current suppressBrowserClearIcons value. Default value is false
    • setSuppressValidationErrorCallback

      public DynamicForm setSuppressValidationErrorCallback(Boolean suppressValidationErrorCallback)
      When calling saveData() on a form or valuesManager, by default if the server returns an error code, any callback passed into saveData() will not be fired. If the error code returned by the server indicates a validation error, it will be displayed to the user by updating the form items to show the error messages, and firing any specified hiddenValidationErrors handler, otherwise the standard RPCManager error handling logic would be invoked.

      Developers who want to handle errors themselves can override this default by specifying dsRequest.willHandleError on the DSRequest. In this case the callback passed in will be fired even if the server returns an error status code.

      If suppressValidationErrorCallback is set to true, if a save attempt returns a validation error code, the user-specified callback will not be fired even if willHandleError:true was specified on the dsRequest - though for other error codes, the callback would be fired if willHandleError is specified on the request. Note that this is the historical behavior for SmartGWT builds 4.0 and earlier

      Note : This is an advanced setting

      Parameters:
      suppressValidationErrorCallback - New suppressValidationErrorCallback value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
    • getSuppressValidationErrorCallback

      public Boolean getSuppressValidationErrorCallback()
      When calling saveData() on a form or valuesManager, by default if the server returns an error code, any callback passed into saveData() will not be fired. If the error code returned by the server indicates a validation error, it will be displayed to the user by updating the form items to show the error messages, and firing any specified hiddenValidationErrors handler, otherwise the standard RPCManager error handling logic would be invoked.

      Developers who want to handle errors themselves can override this default by specifying dsRequest.willHandleError on the DSRequest. In this case the callback passed in will be fired even if the server returns an error status code.

      If suppressValidationErrorCallback is set to true, if a save attempt returns a validation error code, the user-specified callback will not be fired even if willHandleError:true was specified on the dsRequest - though for other error codes, the callback would be fired if willHandleError is specified on the request. Note that this is the historical behavior for SmartGWT builds 4.0 and earlier

      Returns:
      Current suppressValidationErrorCallback value. Default value is false
    • setSynchronousValidation

      public DynamicForm setSynchronousValidation(Boolean synchronousValidation) throws IllegalStateException
      If enabled, whenever validation is triggered and a request to the server is required, user interactivity will be blocked until the request returns. Can be set for the entire form or individual FormItems.

      If false, the form will try to avoid blocking user interaction until it is strictly required. That is until the user attempts to use a FormItem whose state could be affected by a server request that has not yet returned.

      Parameters:
      synchronousValidation - New synchronousValidation value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getSynchronousValidation

      public Boolean getSynchronousValidation()
      If enabled, whenever validation is triggered and a request to the server is required, user interactivity will be blocked until the request returns. Can be set for the entire form or individual FormItems.

      If false, the form will try to avoid blocking user interaction until it is strictly required. That is until the user attempts to use a FormItem whose state could be affected by a server request that has not yet returned.

      Returns:
      Current synchronousValidation value. Default value is false
    • setTarget

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

      If this method is called after the component has been drawn/initialized: Sets the target for this form.

      Note : This is an advanced setting

      Parameters:
      target - New submission target. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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:
      Current target value. Default value is null
      See Also:
    • setTimeFormatter

      public DynamicForm setTimeFormatter(TimeDisplayFormat timeFormatter)
      Default TimeDisplayFormat for type:"time" field values displayed in this form.

      Note that if specified, FormItem.dateFormatter and FormItem.timeFormatter take precedence over the format specified at the component level.

      If no explicit formatter is specified at the field or component level, time values will be formatted according to the system-wide String. specified field type.

      Parameters:
      timeFormatter - New timeFormatter value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
    • getTimeFormatter

      public TimeDisplayFormat getTimeFormatter()
      Default TimeDisplayFormat for type:"time" field values displayed in this form.

      Note that if specified, FormItem.dateFormatter and FormItem.timeFormatter take precedence over the format specified at the component level.

      If no explicit formatter is specified at the field or component level, time values will be formatted according to the system-wide String. specified field type.

      Returns:
      Current timeFormatter value. Default value is null
    • setTitleAlign

      public DynamicForm setTitleAlign(Alignment titleAlign)
      Default alignment for item titles. If unset default alignment will be derived from text direction as described in getTitleAlign()
      Parameters:
      titleAlign - New titleAlign value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
    • getTitleAlign

      public Alignment getTitleAlign()
      Default alignment for item titles. If unset default alignment will be derived from text direction as described in getTitleAlign()
      Returns:
      Get the alignment for the title for some item. Default implementation is as follows:
      • If FormItem.titleAlign is specified, it will be respected
      • If not, and this.titleAlign is set, it will be respected
      • Otherwise titles will be aligned according to text direction; for titleOrientation "top", this method returns "left" if text direction is LTR, and "right" if not; for horizontal orientations, this method returns "right" if text direction is LTR, or "left" if text direction is RTL.
      . Default value is null
    • setTitleOrientation

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

      If this method is called after the component has been drawn/initialized: Modify this form's TitleOrientation at runtime

      Parameters:
      titleOrientation - new default item titleOrientation. Default value is "left"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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. Default value is "left"
      See Also:
    • setTitlePrefix

      public DynamicForm setTitlePrefix(String titlePrefix)
      The string pre-pended to the title of every item in this form. See also +{requiredTitlePrefix} for fields that are required.
      Parameters:
      titlePrefix - New titlePrefix value. Default value is ""
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getTitlePrefix

      public String getTitlePrefix()
      The string pre-pended to the title of every item in this form. See also +{requiredTitlePrefix} for fields that are required.
      Returns:
      Current titlePrefix value. Default value is ""
      See Also:
    • setTitleSuffix

      public DynamicForm setTitleSuffix(String titleSuffix)
      The string appended to the title of every item in this form. See also +{requiredTitleSuffix} for fields that are required.
      Parameters:
      titleSuffix - New titleSuffix value. Default value is "&nbsp;:"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getTitleSuffix

      public String getTitleSuffix()
      The string appended to the title of every item in this form. See also +{requiredTitleSuffix} for fields that are required.
      Returns:
      Current titleSuffix value. Default value is "&nbsp;:"
      See Also:
    • setUnknownErrorMessage

      public DynamicForm setUnknownErrorMessage(String unknownErrorMessage)
      The error message for a failed validator that does not specify its own errorMessage.
      Parameters:
      unknownErrorMessage - New unknownErrorMessage value. Default value is "Invalid value"
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getUnknownErrorMessage

      public String getUnknownErrorMessage()
      The error message for a failed validator that does not specify its own errorMessage.
      Returns:
      Current unknownErrorMessage value. Default value is "Invalid value"
      See Also:
    • setUserTask

      public DynamicForm setUserTask(UserTask userTask) throws IllegalStateException
      Associated userTask if current dynamic form used along with workflow. See userTask for more details.
      Parameters:
      userTask - New userTask value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getUserTask

      public UserTask getUserTask()
      Associated userTask if current dynamic form used along with workflow. See userTask for more details.
      Returns:
      Current userTask value. Default value is null
    • setValidateOnChange

      public DynamicForm 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 or on each validator to enable finer granularity validation in response to user interaction. If true at the form or field level, validators not explicitly set with validateOnChange:false will be fired on change - displaying errors and rejecting the change on validation failure.

      Parameters:
      validateOnChange - New validateOnChange value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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 or on each validator to enable finer granularity validation in response to user interaction. If true at the form or field level, validators not explicitly set with validateOnChange:false will be fired on change - displaying errors and rejecting the change on validation failure.

      Returns:
      Current validateOnChange value. Default value is false
      See Also:
    • setValidateOnExit

      public DynamicForm setValidateOnExit(Boolean validateOnExit)
      If true, form items will be validated when each item's "editorExit" handler is fired as well as when the entire form is submitted or validated.

      Note that this property can also be set at the item level to enable finer granularity validation in response to user interaction - if true at either level, validation will occur on editorExit.

      Parameters:
      validateOnExit - New validateOnExit value. Default value is false
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • getValidateOnExit

      public Boolean getValidateOnExit()
      If true, form items will be validated when each item's "editorExit" handler is fired as well as when the entire form is submitted or validated.

      Note that this property can also be set at the item level to enable finer granularity validation in response to user interaction - if true at either level, validation will occur on editorExit.

      Returns:
      Current validateOnExit value. Default value is false
      See Also:
    • setValidationURL

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

      Parameters:
      validationURL - New validationURL value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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-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.

      Returns:
      Current validationURL value. Default value is null
      See Also:
    • setValues

      public DynamicForm setValues(Map values)
      An Object containing the initial values of the form as properties, where each propertyName is the name of a form item in the form, and each property value is the value held by that form item.

      The form's values may contain values that are not managed by any FormItem, and these values will be preserved and available when the form values are subsequently retrieved via getValues().

      Providing values on initialization is equivalent to calling setValues().

      As the user manipulates form items to change values, change events fire on the items and on the form as a whole.

      Note that form values are logical values, for example, the value of a DateItem is a JavaScript Date object, not a String, even if the user enters the date via a text input. Likewise the value of a TextItem or CheckboxItem that started out null remains null until the user changes it; the value will not be automatically converted to the null string ("") or false respectively, as happens with native HTML elements.

      If this method is called after the component has been drawn/initialized: Replaces the current values of the entire form with the values passed in.

      Note: when working with a form that is saving to a DataSource, you would typically call either editRecord() for an existing record, or editNewRecord() for a new record. In addition to setting the current values of the form, these APIs establish the DSRequest.operationType used to save ("update" vs "add").

      Values should be provided as an Object containing the new values as properties, where each propertyName is the name of a form item in the form, and each property value is the value to apply to that form item via FormItem.setValue().

      Values with no corresponding form item may also be passed, will be tracked by the form and returned by subsequent calls to getValues().

      Any FormItem for which a value is not provided will revert to its defaultValue. To cause all FormItems to revert to default values, pass null.

      This method also calls rememberValues() so that a subsequent later call to resetValues() will revert to the passed values.

      Parameters:
      values - values for the form, or null to reset all items to default values. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
    • getValues

      public Map getValues()
      An Object containing the initial values of the form as properties, where each propertyName is the name of a form item in the form, and each property value is the value held by that form item.

      The form's values may contain values that are not managed by any FormItem, and these values will be preserved and available when the form values are subsequently retrieved via getValues().

      Providing values on initialization is equivalent to calling setValues().

      As the user manipulates form items to change values, change events fire on the items and on the form as a whole.

      Note that form values are logical values, for example, the value of a DateItem is a JavaScript Date object, not a String, even if the user enters the date via a text input. Likewise the value of a TextItem or CheckboxItem that started out null remains null until the user changes it; the value will not be automatically converted to the null string ("") or false respectively, as happens with native HTML elements.

      Returns:
      An Object containing the values of the form as properties, where each propertyName is the name of a form item in the form, and each property value is the value held by that form item.

      Note that modifying the returned object is not a supported way of adding or modifying values. Instead use setValue() or setValues(). Default value is null

    • setWrapHintText

      public DynamicForm setWrapHintText(Boolean wrapHintText) throws IllegalStateException
      Should items within this form that are showing a FormItem.hint have the hint text wrap? May be overridden at the item level via FormItem.wrapHintText. If wrapHintText is unset on both the form and item, then the default behavior is not wrapping the hint.

      This setting does not apply to hints that are shown in field.

      Parameters:
      wrapHintText - New wrapHintText value. Default value is true
      Returns:
      DynamicForm instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getWrapHintText

      public Boolean getWrapHintText()
      Should items within this form that are showing a FormItem.hint have the hint text wrap? May be overridden at the item level via FormItem.wrapHintText. If wrapHintText is unset on both the form and item, then the default behavior is not wrapping the hint.

      This setting does not apply to hints that are shown in field.

      Returns:
      Current wrapHintText value. Default value is true
      See Also:
    • setWrapItemTitles

      public DynamicForm 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 FormItem.wrapTitle
      Parameters:
      wrapItemTitles - New wrapItemTitles value. Default value is null
      Returns:
      DynamicForm instance, for chaining setter calls
      See Also:
    • 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 FormItem.wrapTitle
      Returns:
      Current wrapItemTitles value. Default value is null
      See Also:
    • assignItemsTabPositions

      public void assignItemsTabPositions()
      This method is called automatically by the DynamicForm when the set of items changes and ensures that items show up in the correct tab order positions.

      Makes use of sortItemsIntoTabOrder() to order the items and ensures the items are ordered in the TabIndexManager correctly.

    • cancel

      public void cancel(DSRequest requestProperties)
      Deprecated.
      As of Smartclient version 13.0, due to the removal of Apache Struts.
      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. You must pass the appropriate params property in the request properties as required by your server framework.

      For example:

        DSRequest requestProperties = new DSRequest();
        Map params = new HashMap();
        params.put("CANCEL", "cancel");
        requestProperties.setParams(params);
        
      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, include the following request properties:
        DSRequest requestProperties = new DSRequest();
        // other request property settings ...
        requestProperties.setIgnoreTimeout(true);
        requestProperties.setAttribute("target", null);
        
      Parameters:
      requestProperties - additional properties to set on the RPCRequest that will be issued
      See Also:
    • cancelEditing

      public void cancelEditing()
      If the form or valuesManager has associated userTask workflow task than notify it about cancelling the changes.
    • checkForValidationErrors

      public Map checkForValidationErrors(ValidationStatusCallback callback)
      Performs silent validation of the current form values, like valuesAreValid(). In contrast to valuesAreValid(), this method allows checking for server-side errors, and finding out what the errors are.

      The callback must be passed unless server-side validation is being skipped, and If passed, it always fires, errors or not, firing synchronously if server validation is skipped.

      Parameters:
      callback - callback to invoke after validation is complete
      Returns:
      null if server-side validation is required, or no errors are present; otherwise, a Map of field names to the associated errors, for those fields that failed validation.
      See Also:
    • checkForValidationErrors

      public Map checkForValidationErrors(ValidationStatusCallback callback, boolean validateHiddenFields)
      See Also:
    • checkForValidationErrors

      public Map checkForValidationErrors(ValidationStatusCallback callback, boolean validateHiddenFields, boolean skipServerValidation)
      Performs silent validation of the current form values, like valuesAreValid(). In contrast to valuesAreValid(), this method allows checking for server-side errors, and finding out what the errors are.

      The callback must be passed unless server-side validation is being skipped, and If passed, it always fires, errors or not, firing synchronously if server validation is skipped.

      Parameters:
      callback - callback to invoke after validation is complete
      validateHiddenFields - should validators be processed for non-visible fields such as dataSource fields with no associated item or fields with visibility set to "hidden"
      skipServerValidation - whether to skip doing server-side validation
      Returns:
      null if server-side validation is required, or no errors are present; otherwise, a Map of field names to the associated errors, for those fields that failed validation.
      See Also:
    • 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.
      See Also:
    • 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() to update the display
      See Also:
    • 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 DataPath may be used for clearing details of nested data structures.
    • clearValues

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

      public void completeEditing()
      Finish editing and store edited values in process state.
    • editNewRecord

      public void editNewRecord()
      Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified).
      This method will also call setSaveOperationType() to ensure subsequent calls to saveData() will use an add rather than an update operation.
      See Also:
    • editNewRecord

      public void editNewRecord(Record initialValues)
      Prepare to edit a new record by clearing the current set of values (or replacing them with initialValues if specified).
      This method will also call setSaveOperationType() to ensure 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
      See Also:
    • 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).
      This method will also call setSaveOperationType() to ensure 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
      See Also:
    • editRecord

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

      This method will also call setSaveOperationType() to ensure 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
      See Also:
    • fetchRelatedData

      public void fetchRelatedData(ListGridRecord record, Canvas schema)
      Based on the relationship between the DataSource this component is bound to and the DataSource specified as the "schema" argument, call fetchData() to retrieve records in this data set that are related to the passed-in record.

      Relationships between DataSources are declared via DataSourceField.foreignKey.

      For example, given two related DataSources "orders" and "orderItems", where we want to fetch the "orderItems" that belong to a given "order". "orderItems" should declare a field that is a foreignKey to the "orders" table (for example, it might be named "orderId" with foreignKey="orders.id"). Then, to load the records related to a given "order", call fetchRelatedData() on the component bound to "orderItems", pass the "orders" DataSource as the "schema" and pass a record from the "orders" DataSource as the "record" argument.

      Parameters:
      record - DataSource record
      schema - schema of the DataSource record, or DataBoundComponent already bound to that schema
      See Also:
    • fetchRelatedData

      public void fetchRelatedData(ListGridRecord record, Canvas schema, DSCallback callback)
      See Also:
    • fetchRelatedData

      public void fetchRelatedData(ListGridRecord record, Canvas schema, DSCallback callback, DSRequest requestProperties)
      Based on the relationship between the DataSource this component is bound to and the DataSource specified as the "schema" argument, call fetchData() to retrieve records in this data set that are related to the passed-in record.

      Relationships between DataSources are declared via DataSourceField.foreignKey.

      For example, given two related DataSources "orders" and "orderItems", where we want to fetch the "orderItems" that belong to a given "order". "orderItems" should declare a field that is a foreignKey to the "orders" table (for example, it might be named "orderId" with foreignKey="orders.id"). Then, to load the records related to a given "order", call fetchRelatedData() on the component bound to "orderItems", pass the "orders" DataSource as the "schema" and pass a record from the "orders" DataSource as the "record" argument.

      Parameters:
      record - DataSource record
      schema - schema of the DataSource record, or DataBoundComponent already bound to that schema
      callback - callback to invoke on completion
      requestProperties - additional properties to set on the DSRequest that will be issued
      See Also:
    • fieldIsEditable

      public boolean fieldIsEditable(FormItem field)
      Can the field be edited? This method looks at canEdit for the grid as well as the FormItem.canEdit value, to determine whether editing is actually allowed. For a detailed discussion, see the documentation at canEdit.
      Parameters:
      field - field object or identifier
      Returns:
      whether field can be edited
      See Also:
    • fieldIsEditable

      public boolean fieldIsEditable(int field)
      Can the field be edited? This method looks at canEdit for the grid as well as the FormItem.canEdit value, to determine whether editing is actually allowed. For a detailed discussion, see the documentation at canEdit.
      Parameters:
      field - field object or identifier
      Returns:
      whether field can be edited
      See Also:
    • fieldIsEditable

      public boolean fieldIsEditable(String field)
      Can the field be edited? This method looks at canEdit for the grid as well as the FormItem.canEdit value, to determine whether editing is actually allowed. For a detailed discussion, see the documentation at canEdit.
      Parameters:
      field - field object or identifier
      Returns:
      whether field can be edited
      See Also:
    • focus

      public void focus()
      Give keyboard focus to this form. If this form has had focus before, focus will be passed to the item which last had focus (see getFocusItem()) - otherwise focus will be passed to the first focusable item in the form.

      To put focus in a specific item, use focusInItem() instead.

      Overrides:
      focus in class Canvas
      See Also:
    • addFormSubmitFailedHandler

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

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

      Note: This is very unlikely to occur with modern versions of IE, which don't allow the path of a file to be edited by hand (only selected via file navigation). It was last seen in IE6-7 under Windows XP.

      Rather than throwing an exception on the client during submit(), normally all failures in native form submission are handled by the server. For further information, see File Uploading.

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

      public FormItem getEventItem()
      If the current mouse event occurred over an item in this dynamicForm, returns that item.
      Returns:
      the current event target item
    • getFocusItem

      public FormItem getFocusItem()
      Return the current focus item for this form.

      This is the item which either currently has focus, or if focus is not currently within this form, would be given focus on a call to focus(). May return null if this form has never had focus, in which case a call to form.focus() would put focus into the first focusable item within the the form.

      Note that if focus is currently in a sub-item of a DateItem or RadioGroupItem, this method will return the parent item, not the sub-item.

      Returns:
      Current focus item within this form. May be null.
      See Also:
    • 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 FormItem.operator

      Returns:
      a AdvancedCriteria based on the form's current values
      See Also:
    • getValuesAsAdvancedCriteria

      public AdvancedCriteria getValuesAsAdvancedCriteria(TextMatchStyle textMatchStyle)
      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 FormItem.operator

      Parameters:
      textMatchStyle - If specified the text match style will be used to generate the appropriate operator for per field criteria.
      Returns:
      a AdvancedCriteria based on the form's current values
      See Also:
    • addAsyncValidationReplyHandler

      public HandlerRegistration addAsyncValidationReplyHandler(AsyncValidationReplyHandler handler)
      Add a asyncValidationReply handler.

      Notification fired when an asynchronous validation completes.

      Specified by:
      addAsyncValidationReplyHandler in interface HasAsyncValidationReplyHandlers
      Parameters:
      handler - the asyncValidationReply handler
      Returns:
      HandlerRegistration used to remove this handler
    • addHiddenValidationErrorsHandler

      public HandlerRegistration addHiddenValidationErrorsHandler(HiddenValidationErrorsHandler handler)
      Add a hiddenValidationErrors handler.

      Method to display validation error messages for fields that are not currently visible in this form.
      This will be called when validation fails for
      - a hidden field in this form
      - if this form is databound, a datasource field with specified validators, for which we have no specified form item.
      Implement this to provide custom validation error handling for these fields.
      By default hidden validation errors will be logged as warnings in the developerConsole. Call HiddenValidationErrorsEvent.cancel() from within HiddenValidationErrorsHandler.onHiddenValidationErrors(com.smartgwt.client.widgets.form.events.HiddenValidationErrorsEvent) from this method to suppress that behavior.

      Specified by:
      addHiddenValidationErrorsHandler in interface HasHiddenValidationErrorsHandlers
      Parameters:
      handler - the hiddenValidationErrors handler
      Returns:
      HandlerRegistration used to remove this handler
    • hasErrors

      public Boolean hasErrors()
      Returns whether there are currently any errors visible to the user for this form, without performing validation.

      Note that validation errors are set up automatically by validation (see validate()), or may be explicitly set via setErrors() or setFieldErrors().

      Returns:
      true if the form currently has validation errors.
      See Also:
    • hasFieldErrors

      public Boolean hasFieldErrors(String fieldName)
      Returns whether there are currently any errors visible to the user for the specified field in this form, without performing any validation.

      Note that validation errors are set up automatically by validation (see validate()), or may be explicitly set via setErrors() or setFieldErrors().

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

      public void hideItem(String itemName)
      Hide a form item via FormItem.hide()
      Parameters:
      itemName - Name of the item to show
    • isFocused

      public Boolean isFocused()
      Returns true if this DynamicForm has the keyboard focus.

      Unlike standard canvases, for a DynamicForm this method will return true when keyboard focus is currently on one of the form's items.

      Note that in some cases the items of a form may be written directly into a different canvas. In this case the dynamicForm containing the items may not have been drawn on the page itself, but this method can still return true if one of the items has focus.

      Overrides:
      isFocused in class Canvas
      Returns:
      whether focus is currently in one of this form's items.
      See Also:
    • isNewRecord

      public Boolean isNewRecord()
      Returns true if saveOperationType is currently "add". See saveOperationType.
      Returns:
      whether this form will use an "add" operation when saving
    • isPendingAsyncValidation

      public Boolean isPendingAsyncValidation()
      Is this component waiting for an asynchronous validation to complete? This method will return true after validate() is called on a component with server-side validators for some field(s), until the server responds.

      Note that the notification method DynamicForm.asyncValidationReply() will be fired when validation completes.

      Returns:
      true if this widget has pending asynchronous validations in process
    • 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
    • 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
    • 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
    • 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 initial values at init time.
    • resetValues

      public void resetValues()
      Same as reset().
    • saveData

      public void saveData()
      Validate and then save the form's current values to the DataSource this form is bound to.

      If client-side validators are defined, they are executed first, and if any errors are found the save is aborted and the form will show the errors.

      If client-side validation passes, a DSRequest will be sent, exactly as though DataSource.addData() or DataSource.updateData() had been called with the form's values as data. The DSRequest.operationType will be either "update" or "add", depending on the current saveOperationType.

      On either a client-side or server-side validation failure, validation errors will be displayed in the form. Visible items within a DynamicForm will be redrawn to display errors. Validation failure occurring on hidden items, or DataSource fields with no associated form items may be handled via DynamicForm.hiddenValidationErrors() or ValuesManager.hiddenValidationErrors().

      In the case of a validation error, the callback will not be called by default since the form has already handled the failed save by displaying the validation errors to the user. If you need to do something additional in this case, you can set RPCRequest.willHandleError via the requestProperties parameter to force your callback to be invoked. However, first consider:

      • if you are trying to customize display of validation errors, there are several built-in modes and showErrors() may be a better place to put customizations.
      • for unrecoverable general errors (eg server is down), central error handling in invoked, so consider placing customizations there unless an unrecoverable error should be handled specially by this specific form.
      Note: If a form is to be cleared after saving data, we recommend clearing the form from the callback rather than calling saveData() and then synchronously clearing the form. This gives users a chance to view and respond to any validation errors returned by the server. It is also required to ensure forms containing an upload field, have a chance to upload the file to the server.
      See Also:
    • saveData

      public void saveData(DSCallback callback)
      See Also:
    • saveData

      public void saveData(DSCallback callback, DSRequest requestProperties)
      Validate and then save the form's current values to the DataSource this form is bound to.

      If client-side validators are defined, they are executed first, and if any errors are found the save is aborted and the form will show the errors.

      If client-side validation passes, a DSRequest will be sent, exactly as though DataSource.addData() or DataSource.updateData() had been called with the form's values as data. The DSRequest.operationType will be either "update" or "add", depending on the current saveOperationType.

      On either a client-side or server-side validation failure, validation errors will be displayed in the form. Visible items within a DynamicForm will be redrawn to display errors. Validation failure occurring on hidden items, or DataSource fields with no associated form items may be handled via DynamicForm.hiddenValidationErrors() or ValuesManager.hiddenValidationErrors().

      In the case of a validation error, the callback will not be called by default since the form has already handled the failed save by displaying the validation errors to the user. If you need to do something additional in this case, you can set RPCRequest.willHandleError via the requestProperties parameter to force your callback to be invoked. However, first consider:

      • if you are trying to customize display of validation errors, there are several built-in modes and showErrors() may be a better place to put customizations.
      • for unrecoverable general errors (eg server is down), central error handling in invoked, so consider placing customizations there unless an unrecoverable error should be handled specially by this specific form.
      Note: If a form is to be cleared after saving data, we recommend clearing the form from the callback rather than calling saveData() and then synchronously clearing the form. This gives users a chance to view and respond to any validation errors returned by the server. It is also required to ensure forms containing an upload field, have a chance to upload the file to the server.
      Parameters:
      callback - callback to invoke on completion
      requestProperties - additional properties to set on the DSRequest that will be issued
      See Also:
    • setValue

      public void setValue(String fieldName, String value)
      Sets the value for some field
      Parameters:
      fieldName - Name of the field being updated. A DataPath may be passed to set nested values
      value - New value.
    • setValuesAsCriteria

      public void setValuesAsCriteria(Criterion criteria)
      This method will display the specified criteria in this form for editing. The criteria parameter may be a simple Criterion object or an AdvancedCriteria object.

      For simple criteria, the specified fieldName will be used to apply criteria to form items, as with a standard setValues() call.

      For AdvancedCriteria, behavior is as follows:

      • If the top level operator doesn't match the operator for this form, the entire criteria will be nested in an outer advanced criteria object with the appropriate operator.
      • Each criterion within AdvancedCriteria will be applied to a form item if FormItem.shouldSaveValue is true for the item and FormItem.canEditCriterion() returns true for the criterion in question. By default this method checks for a match with both the fieldName and operator of the criterion. The criterion is actually passed to the item for editing via the FormItemCriterionSetter's setCriterion() method. Note that these methods may be overridden for custom handling. Also note that the default FormItemCriterionSetter.setCriterion() implementation used by CanvasItem handles editing nested criteria via embedded dynamicForms.
      • Criteria which don't map to any form item will be stored directly on the form and recombined with the edited values from each item when getValuesAsCriteria() is called.
      Parameters:
      criteria - criteria to edit.
      See Also:
    • 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() / addFieldErrors() / clearFieldErrors().
      Default implementation simply falls through to showErrors().
      Parameters:
      fieldName - field to show errors for
      See Also:
    • showItem

      public void showItem(String itemName)
      Show a form item via FormItem.show()
      Parameters:
      itemName - Name of the item to show
    • showItemContextMenu

      public boolean showItemContextMenu(FormItem item)
      Called when the mouse is right-clicked in some formItem. If the implementation returns false, default browser behavior is cancelled.

      Note that it can be bad practice to cancel this method if the mouse is over the data element of an item, because doing so would replace the builtin browser-default menus that users may expect. You can use getEventItemInfo() to return an info object that can be used to determine which part of the item is under the mouse.

      Parameters:
      item - the form item showing its context menu
      Returns:
      return false to cancel default behavior
    • sortItemsIntoTabOrder

      public FormItem[] sortItemsIntoTabOrder()
      Helper method to take our specified items and sort them into their desired tab sequence

      Default behavior will respect explicitly specified tab index as a local tab index, otherwise just use specified order within the items array

      Returns:
      Returns an array containing our items in the desired tab sequence.
    • 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 this form is part of a ValuesManager, this method will simply fall through to the submit method on the valuesManager. If not, and form.submitValues() exists, it will be called, and no further action will be taken.

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

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

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

      See Also:
    • submit

      public void submit(DSCallback callback)
      See Also:
    • submit

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

      If this form is part of a ValuesManager, this method will simply fall through to the submit method on the valuesManager. If not, and form.submitValues() exists, it will be called, and no further action will be taken.

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

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

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

      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]
      See Also:
    • 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:

      • 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.
      • For this method to reliably include values for every field in the grid, canSubmit must be set to true
      • To submit values for fields that do not have an editor, use HiddenItem with a FormItem.defaultValue set. This is analogous to <input type="hidden"> in HTML forms.
      See Also:
    • 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
    • titleClipped

      public boolean titleClipped(FormItem item)
      Is the title for the given form item clipped? The form item must have title clipping enabled.
      Parameters:
      item - the form item.
      Returns:
      true if the title is clipped; false otherwise.
      See Also:
    • 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 DynamicForm.hiddenValidationErrors().

      If this form has any fields which require server-side validation (see Validator.serverCondition) this will also be initialized. Such validation will occur asynchronously. Developers can use isPendingAsyncValidation() and DynamicForm.asyncValidationReply() to detect and respond to asynchronous validation.

      Note that for silent validation, valuesAreValid() (client-side) and checkForValidationErrors() (client and server-side) can be used instead.

      Returns:
      true if validation succeeds, or false if validation fails.
      See Also:
    • 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 DynamicForm.hiddenValidationErrors().

      If this form has any fields which require server-side validation (see Validator.serverCondition) this will also be initialized. Such validation will occur asynchronously. Developers can use isPendingAsyncValidation() and DynamicForm.asyncValidationReply() to detect and respond to asynchronous validation.

      Note that for silent validation, valuesAreValid() (client-side) and checkForValidationErrors() (client and server-side) can be used instead.

      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.
      See Also:
    • validateData

      public boolean validateData(DSCallback callback)
      See Also:
    • validateData

      public boolean validateData(DSCallback callback, DSRequest requestProperties)
      validateData() can be used to check for errors in server-side validators without showing such errors to the user. Errors, if any, can be discovered by looking at the DSResponse object returned in the callback.

      validateData() will first call validate() to check for client-side errors, and will return false without contacting the server if errors are present. In this case, any errors detected client-side will be displayed; to avoid this and purely perform silent, server-side validation, you can use DataSource.validateData() with the form's current values. valuesAreValid() can be used in lieu of a call to validate() if silent checking of client-side errors is also desired.

      Parameters:
      callback - callback to invoke on completion
      requestProperties - additional properties to set on the DSRequest that will be issued
      Returns:
      true if the server will be contacted, false otherwise
      See Also:
    • valuesAreValid

      public boolean valuesAreValid(boolean validateHiddenFields)
      Method to determine whether the current form values would pass validation. This method operates client-side, without contacting the server, running validators on the form's values and returning a value indicating whether validation was successful.

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

      Note that checkForValidationErrors() allows for checking for server-side errors, and finding out what those errors are via a callback.

      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 validation success, or if returnErrors was specified, a map of field names to the associated errors, for those fields that failed validation, or null if validation succeeded.
      See Also:
    • addValuesChangedHandler

      public HandlerRegistration addValuesChangedHandler(ValuesChangedHandler handler)
      Add a valuesChanged handler.

      Handler fired when the entire set of values is replaced, as by a call to DynamicForm.setValues(), DynamicForm.resetValues() or DynamicForm.editRecord().

      Note that it is invalid to call such methods from this handler because doing so would result in an infinite loop.

      Specified by:
      addValuesChangedHandler in interface HasValuesChangedHandlers
      Parameters:
      handler - the valuesChanged handler
      Returns:
      HandlerRegistration used to remove this handler
    • valuesHaveChanged

      public Boolean valuesHaveChanged()
      Compares the current set of values with the values stored by the call to the rememberValues() method. rememberValues() runs when the form is initialized and on every call to setValues(). Returns true if the values have changed, and false otherwise.
      Returns:
      true if current values do not match remembered values
      See Also:
    • viewSelectedData

      public void viewSelectedData(ListGrid selectionComponent)
      Displays the currently selected record(s) of the selectionComponent widget (typically a listGrid) in this component.

      For a DynamicForm the first record of the selection is shown after the form is placed into read-only mode. A subsequent call to editRecord() or similar will return the form to editability.

      Note that since field-level canEdit:true settings override the form-level canEdit setting the automatic change to read-only may not change every field.

      Parameters:
      selectionComponent - the ListGrid or TileGrid or ID of a ListGrid/TileGrid whose currently selected record(s) is/are to be viewed
      See Also:
    • viewSelectedData

      public void viewSelectedData(TileGrid selectionComponent)
      Displays the currently selected record(s) of the selectionComponent widget (typically a listGrid) in this component.

      For a DynamicForm the first record of the selection is shown after the form is placed into read-only mode. A subsequent call to editRecord() or similar will return the form to editability.

      Note that since field-level canEdit:true settings override the form-level canEdit setting the automatic change to read-only may not change every field.

      Parameters:
      selectionComponent - the ListGrid or TileGrid or ID of a ListGrid/TileGrid whose currently selected record(s) is/are to be viewed
      See Also:
    • viewSelectedData

      public void viewSelectedData(String selectionComponent)
      Displays the currently selected record(s) of the selectionComponent widget (typically a listGrid) in this component.

      For a DynamicForm the first record of the selection is shown after the form is placed into read-only mode. A subsequent call to editRecord() or similar will return the form to editability.

      Note that since field-level canEdit:true settings override the form-level canEdit setting the automatic change to read-only may not change every field.

      Parameters:
      selectionComponent - the ListGrid or TileGrid or ID of a ListGrid/TileGrid whose currently selected record(s) is/are to be viewed
      See Also:
    • setDefaultProperties

      public static void setDefaultProperties(DynamicForm dynamicFormProperties)
      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties set on the SmartGWT class instance passed to this function before its underlying SmartClient JS object was created. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
      dynamicFormProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • onInit

      protected void onInit()
      Overrides:
      onInit in class Canvas
    • onInit_DynamicForm

      protected void onInit_DynamicForm()
    • showErrors

      public void showErrors()
      If this form has any outstanding validation errors, show them now.
      &#010 This method is called when the set of errors are changed by setErrors(java.util.Map, boolean) or&#010 validate().
      &#010 Default implementation will redraw the form to display error messages and call&#010 com.smartgwt.client.widgets.form.DynamicForm#handleHiddenValidationErrors to&#010 display errors with no visible field.


      Note: This is an override point.&#010 This method may be overridden to perform custom display of validation errors.

    • setValuesManager

      public DynamicForm setValuesManager(ValuesManager valuesManager) throws IllegalStateException
      Adds this DynamicForm as a member of the specified valuesManager. After init, this method is functionally equivalent to 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
      Returns:
      DynamicForm instance, for chaining setter calls
      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
      Deprecated.
      Set the cellSpacing.
      Parameters:
      cellSpacing - the cellSpacing
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getCellSpacing

      public int getCellSpacing()
      Deprecated.
      use getCellPadding() instead
      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
    • getChangedValues

      public Map getChangedValues()
      Returns all values within this DynamicForm that have changed since DynamicForm.rememberValues last ran. Note that DynamicForm.rememberValues runs on dynamicForm initialization, and with every call to DynamicForm.setValues so this will typically contain all values the user has explicitly edited since then.
      Returns:
      the values
    • getOldValues

      public Map getOldValues()
      Returns the set of values last stored by DynamicForm.rememberValues. Note that rememberValues() is called automatically by DynamicForm.setValues, and on form initialization, so this typically contains all values as they were before the user edited them.
      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, int[] value)
      Set the value for some field.
      Parameters:
      fieldName - Name of the field being updated
      value - New value.
    • setValue

      public void setValue(String fieldName, Date value)
      Set the value for some field.
      Parameters:
      fieldName - Name of the field being updated
      value - New value.
    • setValue

      public void setValue(String fieldName, String[] 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.
    • setValue

      public void setValue(String fieldName, RelativeDate value)
      Set the value for some field.
      Parameters:
      fieldName - Name of the field being updated
      value - New value.
    • setItems

      public void setItems(FormItem... items)
      Parameters:
      items - the items
    • 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 the form fields.

      If the DynamicForm has not been created in JavaScript, this method will force it to be created. This is required to ensure that if the form has a specified dataSource, fields from the datasource are combined with fields specified explicitly on the component. It also ensures that if fields were specified explicitly as JavaScriptObjects using setFields(), the returned FormItems will be of the correct subclass.

      To retrieve the form fields as specified without forcing creation in JavaScript, use getFields(false)

      Returns:
      the form fields
    • getFields

      public FormItem[] getFields(Boolean forceCreation)
      Return the form fields. Passing a forceCreation parameter of false to this method will avoid creating the DynamicForm in in JavaScript if this has not yet happened.

      If you've installed the fields as JavaScriptObjects using setFields(), it's not recommended to call this method or otherwise try to access the fields as FormItems before the DynamicForm has been created, as this may result in the incorrect subclass of FormItem being built. Instead, use getFieldsAsJavaScriptObjects().

      If the situation is unavoidable, you can set the "editorType" attribute of the JavaScriptObject field to the desired subclass to ensure it will be used.

      Also, prior to creation any fields derived from a dataSource will not be returned from this method.

      Parameters:
      forceCreation - controls whether the DynamicForm should be created if this has not already happened
      Returns:
      the form fields
    • getItem

      public FormItem getItem(String name)
      Retrieve a FormItem in this form by name or dataPath. This method will always create its parent form in JavaScript.
      Parameters:
      name -
      Returns:
    • getField

      public FormItem getField(String name)
      Retrieve a field from this form by name.

      If the DynamicForm has not been created in JavaScript, this method will force it to be created. This is required to ensure that if the form has a specified dataSource, fields from the datasource are combined with fields specified explicitly on the component. It also ensures that if fields were specified explicitly as JavaScriptObjects using setFields(), the returned FormItem will be of the correct subclass.

      To retrieve a form field as specified without forcing creation in JavaScript, use getField(fieldName, false)

      Parameters:
      name - name of the field to return
      Returns:
      FormItem with the appropriate name
    • getField

      public FormItem getField(String name, Boolean forceCreation)
      Retrieve a field from this form by name.

      Passing a forceCreation parameter of false to this method will avoid creating the DynamicForm in in JavaScript if this has not yet happened.

      See getFields(Boolean) for considerations about retrieving fields before a DynamicForm has been created in JavaScript

      Parameters:
      name - name of the field to return
      forceCreation - controls whether the DynamicForm should be created if this has not already happened
      Returns:
      FormItem with the appropriate name
    • getValueAsString

      public String getValueAsString(String fieldName)
    • getValue

      public Object getValue(String fieldName)
    • getEventItemInfo

      public FormItemEventInfo getEventItemInfo(String fieldName)
      If the current mouse event occurred over an item, or the title of an item in this dynamicForm, return details about where the event occurred.
      Parameters:
      fieldName - the field name
      Returns:
      the form item event info
    • editSelectedData

      public void editSelectedData(ListGrid selectionComponent)
      Edit the record selected in the specified ListGrid.

      Updates the values of this editor to match the selected record's values.

      If this form has a dataSource, then saving via saveData() will use the "update" operation type.
      Parameters:
      selectionComponent - the List Grid whose currently selected record(s) is/are to be edited
      See Also:
    • editSelectedData

      public void editSelectedData(String listGridID)
      Edit the record selected in the specified ListGrid.

      Updates the values of this editor to match the selected record's values.

      If this form has a dataSource, then saving via saveData() will use the "update" operation type.
      Parameters:
      listGridID - the List Grid ID whose currently selected record(s) is/are to be edited
      See Also:
    • getValuesAsCriteria

      public Criteria getValuesAsCriteria()
      Return search criteria based on the current set of values within this form. For simple criteria, each form item simply maps its value to it's fieldName.

      See FormItem.getCriterion() for details on how form items generate advanced criteria. Note that any values or criteria specified via DynamicForm.setValues() or DynamicForm.setValuesAsCriteria() which do not correspond to an item within the form will be combined with the live item values when criteria are generated.

      The returned criteria object can be used to filter data via methods such as ListGrid.fetchData(), DataSource.fetchData(), or, for more advanced usage, ResultSet.setCriteria().

      Note that any form field which the user has left blank is omitted as criteria, that is, a blank field is assumed to mean "allow any value for this field" and not "this field must be blank". Examples of empty values include a blank text field or SelectItem with an empty selection.
      Returns:
      the criteria
    • getValuesAsRecord

      public Record getValuesAsRecord()
      Return the current set of values within this form as a Record.
      Returns:
      a Record object containing the form's current values
    • 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:

      • A number (e.g. 100) representing the number of pixel widths to allocate to a column.
      • A percent (e.g. 20%) representing the percentage of the total form.width to allocate to a column.
      • "*" (all) to allocate remaining width (form.width minus all specified column widths). Multiple columns can use "*", in which case remaining width is divided between all columns marked
      Parameters:
      colWidths - the column widths
    • getSaveOperationType

      public DSOperationType getSaveOperationType(DSRequest requestProperties)
      Default DSOperationType to be performed when DynamicForm.saveData is called. This property is automatically set on a call to DynamicForm.editRecord or DynamicForm.editNewRecord, or may be set directly via DynamicForm.setSaveOperationType.

      If saveOperationType is unset, the form will heuristically determine whether an "add" or "update" operation is intended based on whether the primaryKey field is present and editable.

      Parameters:
      requestProperties - Optional DSRequest config properties for the save operation
      Returns:
      Returns the DSOperationType to be performed when DynamicForm.saveData is called. Valid options are "add" or "update".

      If a DSRequest configuration object is passed in containing an explicit operationType this will be returned. Otherwise saveOperationType will be returned.

    • 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
    • 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
    • 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 an item's title and the title is clipped. Return null to suppress the hover canvas altogether.
      Parameters:
      hoverFormatter - the hover formatter
      See Also:
    • setItemValueHoverFormatter

      public void setItemValueHoverFormatter(FormItemHoverFormatter hoverFormatter)
      The FormItemHoverFormatter should return the HTML to display in a hover canvas when the user holds the mousepointer over an item's value and the value is clipped. Return null to suppress the hover canvas altogether.
      Parameters:
      hoverFormatter - the hover formatter
      See Also:
    • setDataSource

      public void setDataSource(DataSource dataSource, FormItem... fields)
      Bind to a DataSource.

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

      Parameters:
      dataSource -
      fields -
    • setSkipConversionOnMapping

      public static void setSkipConversionOnMapping(Boolean convert)
      Call this method passing true to skip conversion of the Javascript object to a Java Map when calling the mapDisplayToValue() API. By default, we do convert the value, and your methods will be returned a Java Map of native Java types. Passing true to this method switches off conversion, and your methods will be passed a JavaScriptObject
      Parameters:
      convert - Whether the mapDisplayTovalue() method should skip conversion of its return value to a native Java Map
    • getSkipConversionOnMapping

      public static Boolean getSkipConversionOnMapping()
      Returns true if the system is set to skip conversion of the Javascript object to a Java Map when calling the mapDisplayToValue() API. See setSkipConversionOnMapping(java.lang.Boolean)
      Returns:
      Boolean indicating whether the mapDisplayTovalue() method will skip conversion of its return value to a native Java Map
    • setDataPageSize

      public DynamicForm setDataPageSize(int dataPageSize)
      Description copied from interface: DataBoundComponent
      When using data paging, how many records to fetch at a time. If set to a positive integer, dataPageSize will override the default resultSize for ResultSets automatically created when you call fetchData() (and similarly for the resultSize of ResultTrees). The default of 0 means to just use the default page size of the data container.

      Note that regardless of the dataPageSize setting, a component will always fetch all of data that it needs to draw. Settings such as showAllRecords:true, drawAllMaxCells and drawAheadRatio can cause more rows than the configured dataPageSize to be fetched.

      Specified by:
      setDataPageSize in interface DataBoundComponent
      Parameters:
      dataPageSize - dataPageSize Default value is 0
      Returns:
      DataBoundComponent instance, for chaining setter calls
      See Also:
    • getDataPageSize

      public int getDataPageSize()
      Description copied from interface: DataBoundComponent
      When using data paging, how many records to fetch at a time. If set to a positive integer, dataPageSize will override the default resultSize for ResultSets automatically created when you call fetchData() (and similarly for the resultSize of ResultTrees). The default of 0 means to just use the default page size of the data container.

      Note that regardless of the dataPageSize setting, a component will always fetch all of data that it needs to draw. Settings such as showAllRecords:true, drawAllMaxCells and drawAheadRatio can cause more rows than the configured dataPageSize to be fetched.

      Specified by:
      getDataPageSize in interface DataBoundComponent
      Returns:
      int
      See Also:
    • setUseAllDataSourceFields

      public DynamicForm setUseAllDataSourceFields(Boolean useAllDataSourceFields)
      Description copied from interface: DataBoundComponent
      If true, the set of fields given by the "default binding" (see &#010 fields) is used, with any fields specified in&#010 component.fields acting as overrides that can suppress or modify the&#010 display of individual fields, without having to list the entire set of fields that&#010 should be shown.&#010

      &#010 If component.fields contains fields that are not found in the DataSource,&#010 they will be shown after the most recently referred to DataSource field. If the new&#010 fields appear first, they will be shown first.

      Specified by:
      setUseAllDataSourceFields in interface DataBoundComponent
      Parameters:
      useAllDataSourceFields - useAllDataSourceFields Default value is false
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getUseAllDataSourceFields

      public Boolean getUseAllDataSourceFields()
      Description copied from interface: DataBoundComponent
      If true, the set of fields given by the "default binding" (see &#010 fields) is used, with any fields specified in&#010 component.fields acting as overrides that can suppress or modify the&#010 display of individual fields, without having to list the entire set of fields that&#010 should be shown.&#010

      &#010 If component.fields contains fields that are not found in the DataSource,&#010 they will be shown after the most recently referred to DataSource field. If the new&#010 fields appear first, they will be shown first.

      Specified by:
      getUseAllDataSourceFields in interface DataBoundComponent
      Returns:
      Boolean
    • setSparseFieldState

      public DynamicForm setSparseFieldState(Boolean sparseFieldState)
      Description copied from interface: DataBoundComponent
      If true, ListGrid.getFieldState() and ListGrid.setFieldState(java.lang.String) will omit state information for hidden fields by default.
      Specified by:
      setSparseFieldState in interface DataBoundComponent
      Parameters:
      sparseFieldState - sparseFieldState Default value is false
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getSparseFieldState

      public Boolean getSparseFieldState()
      Description copied from interface: DataBoundComponent
      If true, ListGrid.getFieldState() and ListGrid.setFieldState(java.lang.String) will omit state information for hidden fields by default.
      Specified by:
      getSparseFieldState in interface DataBoundComponent
      Returns:
      Boolean
    • setShowHiddenFields

      public DynamicForm setShowHiddenFields(Boolean showHiddenFields)
      Description copied from interface: DataBoundComponent
      Whether to show fields marked hidden:true when a DataBoundComponent is given a&#010 DataSource but no component.fields.&#010

      &#010 The hidden property is used on DataSource fields to mark fields that are&#010 never of meaning to an end user.

      Specified by:
      setShowHiddenFields in interface DataBoundComponent
      Parameters:
      showHiddenFields - showHiddenFields Default value is false
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getShowHiddenFields

      public Boolean getShowHiddenFields()
      Description copied from interface: DataBoundComponent
      Whether to show fields marked hidden:true when a DataBoundComponent is given a&#010 DataSource but no component.fields.&#010

      &#010 The hidden property is used on DataSource fields to mark fields that are&#010 never of meaning to an end user.

      Specified by:
      getShowHiddenFields in interface DataBoundComponent
      Returns:
      Boolean
    • setShowComplexFields

      public DynamicForm setShowComplexFields(Boolean showComplexFields)
      Description copied from interface: DataBoundComponent
      Whether to show fields of non-atomic types when a DataBoundComponent is given a&#010 DataSource but no component.fields.&#010

      &#010 If true, the component will show fields that declare a complex type, for example, a&#010 field 'shippingAddress' that declares type 'Address', where 'Address' is the ID of a&#010 DataSource that declares the fields of a shipping address (city, street name, etc).&#010

      &#010 Such fields may need custom formatters or editors in order to create a usable interface,&#010 for example, an Address field in a ListGrid might use a custom formatter to combine the&#010 relevant fields of an address into one column, and might use a pop-up dialog for&#010 editing.

      Note : This is an advanced setting

      Specified by:
      setShowComplexFields in interface DataBoundComponent
      Parameters:
      showComplexFields - showComplexFields Default value is true
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getShowComplexFields

      public Boolean getShowComplexFields()
      Description copied from interface: DataBoundComponent
      Whether to show fields of non-atomic types when a DataBoundComponent is given a&#010 DataSource but no component.fields.&#010

      &#010 If true, the component will show fields that declare a complex type, for example, a&#010 field 'shippingAddress' that declares type 'Address', where 'Address' is the ID of a&#010 DataSource that declares the fields of a shipping address (city, street name, etc).&#010

      &#010 Such fields may need custom formatters or editors in order to create a usable interface,&#010 for example, an Address field in a ListGrid might use a custom formatter to combine the&#010 relevant fields of an address into one column, and might use a pop-up dialog for&#010 editing.

      Specified by:
      getShowComplexFields in interface DataBoundComponent
      Returns:
      Boolean
    • setFetchOperation

      public DynamicForm 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
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • 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 DynamicForm setUpdateOperation(String updateOperation)
      Description copied from interface: DataBoundComponent
      operationId this component should use when performing update operations.
      Specified by:
      setUpdateOperation in interface DataBoundComponent
      Parameters:
      updateOperation - Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
      See Also:
    • getUpdateOperation

      public String getUpdateOperation()
      Description copied from interface: DataBoundComponent
      operationId this component should use when performing update operations.
      Specified by:
      getUpdateOperation in interface DataBoundComponent
      Returns:
      String
      See Also:
    • setAddOperation

      public DynamicForm setAddOperation(String addOperation)
      Description copied from interface: DataBoundComponent
      operationId this component should use when performing add operations.
      Specified by:
      setAddOperation in interface DataBoundComponent
      Parameters:
      addOperation - Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
      See Also:
    • getAddOperation

      public String getAddOperation()
      Description copied from interface: DataBoundComponent
      operationId this component should use when performing add operations.
      Specified by:
      getAddOperation in interface DataBoundComponent
      Returns:
      String
      See Also:
    • setRemoveOperation

      public DynamicForm setRemoveOperation(String removeOperation)
      Description copied from interface: DataBoundComponent
      operationId this component should use when performing remove operations.
      Specified by:
      setRemoveOperation in interface DataBoundComponent
      Parameters:
      removeOperation - Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
      See Also:
    • getRemoveOperation

      public String getRemoveOperation()
      Description copied from interface: DataBoundComponent
      operationId this component should use when performing remove operations.
      Specified by:
      getRemoveOperation in interface DataBoundComponent
      Returns:
      String
      See Also:
    • setExportFields

      public DynamicForm 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 &#010 limited and sorted as per the list.&#010

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

      Specified by:
      setExportFields in interface DataBoundComponent
      Parameters:
      exportFields - exportFields Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • 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 &#010 limited and sorted as per the list.&#010

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

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

      public DynamicForm setExportAll(Boolean exportAll)
      Description copied from interface: DataBoundComponent
      Setting exportAll to true prevents the component from passing its list of fields to the &#010 export call. The result is the export of all visible fields from fields.&#010

      &#010 If exportAll is false, an export operation will first consider &#010 exportFields, if it's set, and fall back on all visible fields from&#010 fields otherwise.

      Specified by:
      setExportAll in interface DataBoundComponent
      Parameters:
      exportAll - exportAll Default value is false
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getExportAll

      public Boolean getExportAll()
      Description copied from interface: DataBoundComponent
      Setting exportAll to true prevents the component from passing its list of fields to the &#010 export call. The result is the export of all visible fields from fields.&#010

      &#010 If exportAll is false, an export operation will first consider &#010 exportFields, if it's set, and fall back on all visible fields from&#010 fields otherwise.

      Specified by:
      getExportAll in interface DataBoundComponent
      Returns:
      Boolean
    • setExportIncludeSummaries

      public DynamicForm setExportIncludeSummaries(Boolean exportIncludeSummaries)
      Description copied from interface: DataBoundComponent
      If Summary rows exist for this component, whether to include them when exporting client data. Defaults to true if not set
      Specified by:
      setExportIncludeSummaries in interface DataBoundComponent
      Parameters:
      exportIncludeSummaries - exportIncludeSummaries Default value is true
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getExportIncludeSummaries

      public Boolean getExportIncludeSummaries()
      Description copied from interface: DataBoundComponent
      If Summary rows exist for this component, whether to include them when exporting client data. Defaults to true if not set
      Specified by:
      getExportIncludeSummaries in interface DataBoundComponent
      Returns:
      Boolean
    • setPreventDuplicates

      public DynamicForm 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&#010 drag and drop or via DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent). When a duplicate transfer is detected,&#010 a dialog will appear showing the duplicateDragMessage.&#010

      &#010 If the component either does not have a DataSource or has a DataSource with no&#010 primaryKey declared, duplicate checking is off by&#010 default. If duplicate checking is enabled, it looks for an existing record in the dataset&#010 that has all of the properties of the dragged record, and considers that a duplicate.&#010

      &#010 For DragDataAction:"copy" where the target DataSource is related to the source&#010 DataSource by foreignKey, a duplicate means that the target list, as filtered by the current&#010 criteria, already has a record whose value for the foreignKey field matches the&#010 primaryKey of the record being transferred.&#010

      &#010 For example, consider dragging "employees" to "teams", where "teams" has a field&#010 "teams.employeeId" which is a foreignKey pointing to "employees.id", and the target&#010 grid has search criteria causing it to show all the members of one team. A duplicate -&#010 adding an employee to the same team twice - is when the target grid's dataset contains an&#010 record with "employeeId" matching the "id" field of the dropped employee.

      Specified by:
      setPreventDuplicates in interface DataBoundComponent
      Parameters:
      preventDuplicates - preventDuplicates Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
      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&#010 drag and drop or via DataBoundComponent.transferSelectedData(com.smartgwt.client.widgets.DataBoundComponent). When a duplicate transfer is detected,&#010 a dialog will appear showing the duplicateDragMessage.&#010

      &#010 If the component either does not have a DataSource or has a DataSource with no&#010 primaryKey declared, duplicate checking is off by&#010 default. If duplicate checking is enabled, it looks for an existing record in the dataset&#010 that has all of the properties of the dragged record, and considers that a duplicate.&#010

      &#010 For DragDataAction:"copy" where the target DataSource is related to the source&#010 DataSource by foreignKey, a duplicate means that the target list, as filtered by the current&#010 criteria, already has a record whose value for the foreignKey field matches the&#010 primaryKey of the record being transferred.&#010

      &#010 For example, consider dragging "employees" to "teams", where "teams" has a field&#010 "teams.employeeId" which is a foreignKey pointing to "employees.id", and the target&#010 grid has search criteria causing it to show all the members of one team. A duplicate -&#010 adding an employee to the same team twice - is when the target grid's dataset contains an&#010 record with "employeeId" matching the "id" field of the dropped employee.

      Specified by:
      getPreventDuplicates in interface DataBoundComponent
      Returns:
      Boolean
    • setDuplicateDragMessage

      public DynamicForm 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&#010 preventDuplicates is enabled. If set to null, duplicates will not be reported and the dragged duplicates will not be saved.
      Specified by:
      setDuplicateDragMessage in interface DataBoundComponent
      Parameters:
      duplicateDragMessage - duplicateDragMessage Default value is "Duplicates not allowed"
      Returns:
      DataBoundComponent instance, for chaining setter calls
      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&#010 preventDuplicates is enabled. If set to null, duplicates will not be reported and the dragged duplicates will not be saved.
      Specified by:
      getDuplicateDragMessage in interface DataBoundComponent
      Returns:
      String
    • setAddDropValues

      public DynamicForm 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
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • 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 DynamicForm 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 Smart GWT will apply to the dropped object before updating it.

      If this property is not defined, Smart GWT defaults to returning the selection criteria currently in place for this component. Thus, any databound items (for example, rows from other grids bound to the same DataSource) dropped on the grid will, by default, be subjected to an update that makes them conform to the grid's current filter criteria.

      Note : This is an advanced setting

      Specified by:
      setDropValues in interface DataBoundComponent
      Parameters:
      dropValues - dropValues Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • 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 Smart GWT will apply to the dropped object before updating it.

      If this property is not defined, Smart GWT defaults to returning the selection criteria currently in place for this component. Thus, any databound items (for example, rows from other grids bound to the same DataSource) dropped on the grid will, by default, be subjected to an update that makes them conform to the grid's current filter criteria.

      Note : This is an advanced setting

      Specified by:
      getDropValues in interface DataBoundComponent
      Returns:
      Returns the "drop values" to apply to a record dropped on this component prior to update. Only&#010 applicable to databound components - see dropValues for more details. If multiple records &#010 are being dropped, this method is called for each of them in turn.&#010

      &#010 This method returns the following:&#010

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

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

    • setProgressiveLoading

      public DynamicForm setProgressiveLoading(Boolean progressiveLoading)
      Indicates whether or not this component will load its data progressively
      Parameters:
      progressiveLoading -
      Returns:
      DataBoundComponent instance, for chaining setter calls
      See Also:
    • getProgressiveLoading

      public Boolean getProgressiveLoading()
      Indicates whether or not this component will load its data progressively
      Returns:
      See Also:
    • setUseFlatFields

      public DynamicForm setUseFlatFields(Boolean useFlatFields) throws IllegalStateException
      Description copied from interface: DataBoundComponent
      The useFlatFields flag causes all simple type fields anywhere in a nested&#010 set of DataSources to be exposed as a flat list for form binding. &#010

      &#010 useFlatFields is typically used with imported metadata, such as &#010 XMLTools.loadXMLSchema(java.lang.String, com.smartgwt.client.data.XSDLoadCallback) from a &#010 XMLTools.loadWSDL(java.lang.String, com.smartgwt.client.data.WSDLLoadCallback), as a means of eliminating levels of XML&#010 nesting that aren't meaningful in a user interface, without the cumbersome and fragile&#010 process of mapping form fields to XML structures.&#010

      &#010 For example, having called WebService.getInputDS(java.lang.String) to retrieve the input message&#010 schema for a web service operation whose input message looks like this:&#010

      &#010 <FindServices>&#010     <searchFor>search text</searchFor>&#010     <Options>&#010         <caseSensitive>false</caseSensitive>&#010     </Options>&#010     <IncludeInSearch>&#010         <serviceName>true</serviceName>&#010         <documentation>true</documentation>&#010         <keywords>true</keywords>&#010     </IncludeInSearch>&#010 </FindServices>&#010 
      &#010 Setting useFlatFields on a DynamicForm that is bound to this input&#010 message schema would result in 5 FormItem reflecting the 5 simple type&#010 fields in the message.&#010

      &#010 For this form, the result of getValues() might look&#010 like:&#010

      &#010

      {&#010    searchFor: "search text",&#010    caseSensitive: false,&#010    serviceName: true,&#010    documentation : true,&#010    keywords : true&#010 }
      &#010 When contacting a WebService, these values can be automatically&#010 mapped to the structure of the input message for a web service operation by setting&#010 {@link com.smartgwt.client..WSRequest#getUseFlatFields useFlatFields} (for use with WebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback)) or by setting&#010 useFlatFields (for use with a DataSource that is&#010 'bound to a WSDL web service' via&#010 wsOperation). &#010

      &#010 Using these two facilities in conjunction (component.useFlatFields and&#010 request.useFlatFields) allows gratuitous nesting to be consistently bypassed in both the user&#010 presentation and when providing the data for XML messages.&#010

      &#010 You can also set useFlatFields to automatically enable &#010 "flattened" XML serialization (request.useFlatFields) for all DataSource requests of a&#010 particular operationType.&#010

      &#010 Note that useFlatFields is not generally recommended for use with structures&#010 where multiple simple type fields exist with the same name, however if used with such a&#010 structure, the first field to use a given name wins. "first" means the first field&#010 encountered in a depth first search. "wins" means only the first field will be present as a&#010 field when data binding.

      Specified by:
      setUseFlatFields in interface DataBoundComponent
      Parameters:
      useFlatFields - useFlatFields Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
      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&#010 set of DataSources to be exposed as a flat list for form binding. &#010

      &#010 useFlatFields is typically used with imported metadata, such as &#010 XMLTools.loadXMLSchema(java.lang.String, com.smartgwt.client.data.XSDLoadCallback) from a &#010 XMLTools.loadWSDL(java.lang.String, com.smartgwt.client.data.WSDLLoadCallback), as a means of eliminating levels of XML&#010 nesting that aren't meaningful in a user interface, without the cumbersome and fragile&#010 process of mapping form fields to XML structures.&#010

      &#010 For example, having called WebService.getInputDS(java.lang.String) to retrieve the input message&#010 schema for a web service operation whose input message looks like this:&#010

      &#010 <FindServices>&#010     <searchFor>search text</searchFor>&#010     <Options>&#010         <caseSensitive>false</caseSensitive>&#010     </Options>&#010     <IncludeInSearch>&#010         <serviceName>true</serviceName>&#010         <documentation>true</documentation>&#010         <keywords>true</keywords>&#010     </IncludeInSearch>&#010 </FindServices>&#010 
      &#010 Setting useFlatFields on a DynamicForm that is bound to this input&#010 message schema would result in 5 FormItem reflecting the 5 simple type&#010 fields in the message.&#010

      &#010 For this form, the result of getValues() might look&#010 like:&#010

      &#010

      {&#010    searchFor: "search text",&#010    caseSensitive: false,&#010    serviceName: true,&#010    documentation : true,&#010    keywords : true&#010 }
      &#010 When contacting a WebService, these values can be automatically&#010 mapped to the structure of the input message for a web service operation by setting&#010 {@link com.smartgwt.client..WSRequest#getUseFlatFields useFlatFields} (for use with WebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback)) or by setting&#010 useFlatFields (for use with a DataSource that is&#010 'bound to a WSDL web service' via&#010 wsOperation). &#010

      &#010 Using these two facilities in conjunction (component.useFlatFields and&#010 request.useFlatFields) allows gratuitous nesting to be consistently bypassed in both the user&#010 presentation and when providing the data for XML messages.&#010

      &#010 You can also set useFlatFields to automatically enable &#010 "flattened" XML serialization (request.useFlatFields) for all DataSource requests of a&#010 particular operationType.&#010

      &#010 Note that useFlatFields is not generally recommended for use with structures&#010 where multiple simple type fields exist with the same name, however if used with such a&#010 structure, the first field to use a given name wins. "first" means the first field&#010 encountered in a depth first search. "wins" means only the first field will be present as a&#010 field when data binding.

      Specified by:
      getUseFlatFields in interface DataBoundComponent
      Returns:
      Boolean
    • setHiliteProperty

      public DynamicForm 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&#010 that matches {@link com.smartgwt.client..Hilite#getId id} for a hilite defined on this component.
      Specified by:
      setHiliteProperty in interface DataBoundComponent
      Parameters:
      hiliteProperty - hiliteProperty Default value is "_hilite"
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • 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&#010 that matches {@link com.smartgwt.client..Hilite#getId id} for a hilite defined on this component.
      Specified by:
      getHiliteProperty in interface DataBoundComponent
      Returns:
      String
    • editFields

      public void editFields()
      Shows a FieldPicker interface allowing end-users to rearrange the order and visibiility of the fields in the associated DataBoundComponent.
    • editHilites

      public void editHilites()
      Description copied from interface: DataBoundComponent
      Shows a HiliteEditor interface allowing end-users to edit the data-hilites currently in use by this DataBoundComponent.
      Specified by:
      editHilites in interface DataBoundComponent
    • getHiliteState

      public String getHiliteState()
      Description copied from interface: DataBoundComponent
      Get the current hilites encoded as a String, for saving.
      Specified by:
      getHiliteState in interface DataBoundComponent
      Returns:
      the hilite state
    • setHiliteState

      public DynamicForm setHiliteState(String hiliteState)
      Description copied from interface: DataBoundComponent
      Set the current hilites based on a hiliteState String previously returned from getHilitesState.
      Specified by:
      setHiliteState in interface DataBoundComponent
      Parameters:
      hiliteState - hilites state encoded as a String
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • setHilites

      public DynamicForm setHilites(Hilite[] hilites)
      Description copied from interface: DataBoundComponent
      Accepts an array of hilite objects and applies them to this DataBoundComponent. See also getHilites for a method of retrieving the hilite array for storage, including hilites manually added by the user.

      NOTE: This is only supported on ListGrid for now.

      Specified by:
      setHilites in interface DataBoundComponent
      Parameters:
      hilites - array of hilite objects
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getHilites

      public Hilite[] getHilites()
      Description copied from interface: DataBoundComponent
      Return the set of hilite-objects currently applied to this DataBoundComponent. These can be saved for storage and then restored to a component later via setHilites().
      Specified by:
      getHilites in interface DataBoundComponent
      Returns:
      array of hilite objects
    • setDragDataAction

      public DynamicForm setDragDataAction(DragDataAction dragDataAction)
      Description copied from interface: DataBoundComponent
      Indicates what to do with data dragged into another DataBoundComponent. See&#010 DragDataAction type for details.
      Specified by:
      setDragDataAction in interface DataBoundComponent
      Parameters:
      dragDataAction - dragDataAction Default value is Canvas.MOVE
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getDragDataAction

      public DragDataAction getDragDataAction()
      Description copied from interface: DataBoundComponent
      Indicates what to do with data dragged into another DataBoundComponent. See&#010 DragDataAction type for details.
      Specified by:
      getDragDataAction in interface DataBoundComponent
      Returns:
      DragDataAction
    • setDragTrackerStyle

      public DynamicForm 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"
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • 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 DynamicForm 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&#010 field based on values present in other fields, using the {@link com.smartgwt.client..FormulaBuilder}.&#010

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

      Specified by:
      setCanAddFormulaFields in interface DataBoundComponent
      Parameters:
      canAddFormulaFields - canAddFormulaFields Default value is false
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • addSummaryField

      public void addSummaryField()
      Description copied from interface: DataBoundComponent
      Convenience method to display a {@link com.smartgwt.client..SummaryBuilder} to create a new Summary Field. This &#010 is equivalent to calling DataBoundComponentGen#editSummaryField with &#010 no parameter.&#010&#010
      Specified by:
      addSummaryField in interface DataBoundComponent
    • addFormulaField

      public void addFormulaField()
      Description copied from interface: DataBoundComponent
      Convenience method to display a {@link com.smartgwt.client..FormulaBuilder} to create a new Formula Field. This &#010 is equivalent to calling DataBoundComponentGen#editFormulaField with &#010 no parameter.&#010&#010
      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&#010 field based on values present in other fields, using the {@link com.smartgwt.client..FormulaBuilder}.&#010

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

      Specified by:
      getCanAddFormulaFields in interface DataBoundComponent
      Returns:
      Boolean
    • setAddFormulaFieldText

      public DynamicForm 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..."
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • 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 DynamicForm 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..."
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • 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 DynamicForm 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&#010 text field that can contain both user-defined text and the formatted values present in other &#010 fields, using the {@link com.smartgwt.client..SummaryBuilder}.&#010

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

      Specified by:
      setCanAddSummaryFields in interface DataBoundComponent
      Parameters:
      canAddSummaryFields - canAddSummaryFields Default value is false
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • 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&#010 text field that can contain both user-defined text and the formatted values present in other &#010 fields, using the {@link com.smartgwt.client..SummaryBuilder}.&#010

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

      Specified by:
      getCanAddSummaryFields in interface DataBoundComponent
      Returns:
      Boolean
    • setAddSummaryFieldText

      public DynamicForm 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..."
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • 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 DynamicForm 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..."
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • 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
    • setSavedSearchId

      public DynamicForm setSavedSearchId(String savedSearchId)
      Description copied from interface: DataBoundComponent
      Optional identifier for saved searches that should be applied to this component.

      By default SavedSearches are associated with a component via its local ID and DataSource ID. This property allows developers to override this behavior and explicitly associate a component with a set of saved searches. This can provide a couple of benefits:
      Firstly this ensures that saved searches will be unambiguously associated with the particular component even if the page changes such that a stored minimal locator would no longer applied to the component, without requiring an explicit Canvas.ID.
      Secondly this allows the same set of saved searches to be applied to more than one component on a page. This may be valueable for cases where the same information from the same dataSource is presented to users in multiple places.

      Note: This is an advanced setting.

      Specified by:
      setSavedSearchId in interface DataBoundComponent
      Parameters:
      savedSearchId - New savedSearchId value. Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getSavedSearchId

      public String getSavedSearchId()
      Description copied from interface: DataBoundComponent
      Optional identifier for saved searches that should be applied to this component.

      By default SavedSearches are associated with a component via its local ID and DataSource ID. This property allows developers to override this behavior and explicitly associate a component with a set of saved searches. This can provide a couple of benefits:
      Firstly this ensures that saved searches will be unambiguously associated with the particular component even if the page changes such that a stored minimal locator would no longer applied to the component, without requiring an explicit Canvas.ID.
      Secondly this allows the same set of saved searches to be applied to more than one component on a page. This may be valueable for cases where the same information from the same dataSource is presented to users in multiple places.

      Specified by:
      getSavedSearchId in interface DataBoundComponent
      Returns:
      Current savedSearchId value. Default value is null
    • setShowSavedSearchesByDS

      public DynamicForm setShowSavedSearchesByDS(boolean showSavedSearchesByDS) throws IllegalStateException
      Description copied from interface: DataBoundComponent
      Whether to associate saved searches by default with the current DataSource of a component when a savedSearchId is not provided. If this property is true, then when the DataSource is changed, existing saved searches will disappear and only be available if the DataSource is set back to its original value.

      If this property is false, saved searches will persist across DataSource changes so that searches that aren't applicable to the current DataSource might still be shown.

      Note: This is an advanced setting

      Specified by:
      setShowSavedSearchesByDS in interface DataBoundComponent
      Parameters:
      showSavedSearchesByDS - New showSavedSearchesByDS value. Default value is true
      Returns:
      DataBoundComponent instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowSavedSearchesByDS

      public boolean getShowSavedSearchesByDS()
      Description copied from interface: DataBoundComponent
      Whether to associate saved searches by default with the current DataSource of a component when a savedSearchId is not provided. If this property is true, then when the DataSource is changed, existing saved searches will disappear and only be available if the DataSource is set back to its original value.

      If this property is false, saved searches will persist across DataSource changes so that searches that aren't applicable to the current DataSource might still be shown.

      Specified by:
      getShowSavedSearchesByDS in interface DataBoundComponent
      Returns:
      Current showSavedSearchesByDS value. Default value is true
    • findAll

      public Record[] findAll(AdvancedCriteria adCriteria)
      Filters all objects according to the AdvancedCriteria passed
      Parameters:
      adCriteria - AdvancedCriteria to use to filter results
      Returns:
      all matching Objects or null if none found
    • find

      public Record find(AdvancedCriteria adCriteria)
      Filters all objects according to the AdvancedCriteria passed and returns the first matching object or null if not found
      Parameters:
      adCriteria - AdvancedCriteria to use to filter results
      Returns:
      first matching object or null if not found
    • findIndex

      public int findIndex(AdvancedCriteria adCriteria)
      Finds the index of the first Record that matches with the AdvacendCriteria passed.
      Parameters:
      adCriteria - AdvancedCriteria to use to filter results
      Returns:
      index of the first matching Record or -1 if not found
    • findNextIndex

      public int findNextIndex(int startIndex, AdvancedCriteria adCriteria, int endIndex)
      Like RecordList.findIndex(java.util.Map), but considering the startIndex and endIndex parameters.
      Parameters:
      startIndex - first index to consider
      adCriteria - AdvancedCriteria to use to filter results
      endIndex - last index to consider
      Returns:
      index of the first matching Record or -1 if not found
    • findNextIndex

      public int findNextIndex(int startIndex, AdvancedCriteria adCriteria)
      Like RecordList.findIndex(java.util.Map), but considering the startIndex parameter.
      Parameters:
      startIndex - first index to consider
      adCriteria - AdvancedCriteria to use to filter results
      Returns:
      index of the first matching Record or -1 if not found
    • 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&#010&#010
      Specified by:
      selectAllRecords in interface DataBoundComponent
    • deselectAllRecords

      public void deselectAllRecords()
      Description copied from interface: DataBoundComponent
      &#010 Deselect all records&#010&#010
      Specified by:
      deselectAllRecords in interface DataBoundComponent
    • anySelected

      public Boolean anySelected()
      Description copied from interface: DataBoundComponent
      Whether at least one item is selected&#010
      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&#010&#010
      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&#010&#010
      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&#010&#010
      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.&#010&#010
      Specified by:
      enableHiliting in interface DataBoundComponent
    • enableHiliting

      public void enableHiliting(boolean enable)
      Description copied from interface: DataBoundComponent
      Enable all hilites.&#010&#010
      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.&#010&#010
      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 consulted by&#010 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.

      Note that drag/drop type transfers of records between components are asynchronous operations: Smart GWT may need to perform server turnarounds to establish whether dropped records already exist in the target component. Therefore, it is possible to issue a call to transferSelectedData() and/or the drop() method of a databound component whilst a transfer is still active. When this happens, Smart GWT adds the second and subsequent transfer requests to a queue and runs them one after the other. If you want to be notified when a transfer process has actually completed, use HasDropCompleteHandlers.addDropCompleteHandler(com.smartgwt.client.widgets.events.DropCompleteHandler). 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.

      Note that drag/drop type transfers of records between components are asynchronous operations: Smart GWT may need to perform server turnarounds to establish whether dropped records already exist in the target component. Therefore, it is possible to issue a call to transferSelectedData() and/or the drop() method of a databound component whilst a transfer is still active. When this happens, Smart GWT adds the second and subsequent transfer requests to a queue and runs them one after the other. If you want to be notified when a transfer process has actually completed, use HasDropCompleteHandlers.addDropCompleteHandler(com.smartgwt.client.widgets.events.DropCompleteHandler). 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 transferred
      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.&#010

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

      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&#010

      &#010 Override in subclasses &#010&#010

      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 DynamicForm setTitleField(String titleField)
      Description copied from interface: DataBoundComponent
      Sets the best field to use for a user-visible title for an individual record from this component.
      Specified by:
      setTitleField in interface DataBoundComponent
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getTitleField

      public String getTitleField()
      Description copied from interface: DataBoundComponent
      Method to return the fieldName which represents the "title" for records in this&#010 Component.
      &#010 If this.titleField is explicitly specified it will always be used.&#010 Otherwise, default implementation will check titleField for databound&#010 components.
      &#010 For non databound components returns the first defined field name of "title", &#010 "name", or "id". If we dont find any field-names that match these&#010 titles, the first field in the component will be used instead.&#010
      Specified by:
      getTitleField in interface DataBoundComponent
      Returns:
      fieldName the title field for this component.
    • getDataSource

      public DataSource getDataSource()
      Description copied from interface: DataBoundComponent
      The DataSource that this component should bind to for default fields and for performing DataSource requests.
      Specified by:
      getDataSource in interface DataBoundComponent
      Returns:
      DataSource
    • setAutoFetchData

      public DynamicForm 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 and textMatchStyle may be specified via DataBoundComponent.getAutoFetchTextMatchStyle().

      NOTE: If autoFetchData is set, calling ListGrid.fetchData() before draw will cause two requests to be issued, one from the manual call to fetchData() and one from the autoFetchData setting. The second request will use only initialCriteria and not any other criteria or settings from the first request. Generally, turn off autoFetchData if you are going to manually call fetchData() at any time.

      Specified by:
      setAutoFetchData in interface DataBoundComponent
      Parameters:
      autoFetchData - autoFetchData
      Returns:
      DataBoundComponent instance, for chaining setter calls
      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 and textMatchStyle may be specified via DataBoundComponent.getAutoFetchTextMatchStyle().

      NOTE: If autoFetchData is set, calling ListGrid.fetchData() before draw will cause two requests to be issued, one from the manual call to fetchData() and one from the autoFetchData setting. The second request will use only initialCriteria and not any other criteria or settings from the first request. Generally, turn off autoFetchData if you are going to manually call fetchData() at any time.

      Specified by:
      getAutoFetchData in interface DataBoundComponent
      Returns:
      autoFetchData autoFetchData
    • setAutoFetchTextMatchStyle

      public DynamicForm setAutoFetchTextMatchStyle(TextMatchStyle autoFetchTextMatchStyle) throws IllegalStateException
      Description copied from interface: DataBoundComponent
      If autoFetchData is true, this attribute allows the developer to specify a textMatchStyle for the initial DataBoundComponent.fetchData() call.
      Specified by:
      setAutoFetchTextMatchStyle in interface DataBoundComponent
      Returns:
      DataBoundComponent instance, for chaining setter calls
      Throws:
      IllegalStateException
    • getAutoFetchTextMatchStyle

      public TextMatchStyle getAutoFetchTextMatchStyle()
      Description copied from interface: DataBoundComponent
      If autoFetchData is true, this attribute allows the developer to specify a textMatchStyle for the initial DataBoundComponent.fetchData() call.
      Specified by:
      getAutoFetchTextMatchStyle in interface DataBoundComponent
      Returns:
      autoFetchTextMatchStyle autoFetchTextMatchStyle
    • setAutoFetchAsFilter

      public DynamicForm 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
      Returns:
      DataBoundComponent instance, for chaining setter calls
      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 DynamicForm 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
      Returns:
      DataBoundComponent instance, for chaining setter calls
      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
    • setImplicitCriteria

      public DynamicForm setImplicitCriteria(Criteria implicitCriteria)
      Description copied from interface: DataBoundComponent
      Criteria that are never shown to or edited by the user and are cumulative with any criteria provided via DataBoundComponent.initialCriteria, DataBoundComponent.setCriteria() etc.
      Specified by:
      setImplicitCriteria in interface DataBoundComponent
      Parameters:
      implicitCriteria - New implicitCriteria value. Default value is null
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • setImplicitCriteria

      public Boolean setImplicitCriteria(Criteria implicitCriteria, DSCallback callback)
    • setImplicitCriteria

      public Boolean setImplicitCriteria(Criteria criteria, DSCallback callback, Boolean initialFetch)
    • getImplicitCriteria

      public Criteria getImplicitCriteria()
      Description copied from interface: DataBoundComponent
      Criteria that are never shown to or edited by the user and are cumulative with any criteria provided via DataBoundComponent.initialCriteria, DataBoundComponent.setCriteria() etc.
      Specified by:
      getImplicitCriteria in interface DataBoundComponent
      Returns:
      Current implicitCriteria value. Default value is null
    • fetchData

      public void fetchData()
      Description copied from interface: DataBoundComponent
      Retrieves data from the DataSource that matches the specified criteria.

      When fetchData() is first called, if data has not already been provided via setData(), this method will create a ResultSet, which will be configured based on component settings such as fetchOperation and dataPageSize, as well as the general purpose dataProperties. The created ResultSet will automatically send a DSRequest to retrieve data from the dataSource, and from then on will automatically manage paging through large datasets, as well as performing filtering and sorting operations inside the browser when possible - see the ResultSet docs for details.

      NOTE: do not use both autoFetchData and a call to fetchData() - this may result in two DSRequests to fetch data. Use either autoFetchData and setAutoFetchCriteria() or a manual call to fetchData() passing criteria.

      Whether a ResultSet was automatically created or provided via setData(), subsequent calls to fetchData() will simply call resultSet.setCriteria().

      Changes to criteria may or may not result in a DSRequest to the server due to client-side filtering. You can call willFetchData(criteria) to determine if new criteria will result in a server fetch.

      If you need to force data to be re-fetched, you can call invalidateCache() and new data will automatically be fetched from the server using the current criteria and sort direction. NOTE: when using invalidateCache() there is no need to also call fetchData() and in fact this could produce unexpected results.

      This method takes an optional callback parameter (set to a DSCallback) to fire when the fetch completes. Note that this callback will not fire if no server fetch is performed. In this case the data is updated synchronously, so as soon as this method completes you can interact with the new data. If necessary, you can use resultSet.willFetchData() to determine whether or not a server fetch will occur when fetchData() is called with new criteria.

      In addition to the callback parameter for this method, developers can use resultSet.addDataArrivedHandler to be notified every time data is loaded.

      Specified by:
      fetchData in interface DataBoundComponent
    • fetchData

      public void fetchData(Criteria criteria)
      Description copied from interface: DataBoundComponent
      Retrieves data from the DataSource that matches the specified criteria.

      When fetchData() is first called, if data has not already been provided via setData(), this method will create a ResultSet, which will be configured based on component settings such as fetchOperation and dataPageSize, as well as the general purpose dataProperties. The created ResultSet will automatically send a DSRequest to retrieve data from the dataSource, and from then on will automatically manage paging through large datasets, as well as performing filtering and sorting operations inside the browser when possible - see the ResultSet docs for details.

      NOTE: do not use both autoFetchData and a call to fetchData() - this may result in two DSRequests to fetch data. Use either autoFetchData and setAutoFetchCriteria() or a manual call to fetchData() passing criteria.

      Whether a ResultSet was automatically created or provided via setData(), subsequent calls to fetchData() will simply call resultSet.setCriteria().

      Changes to criteria may or may not result in a DSRequest to the server due to client-side filtering. You can call willFetchData(criteria) to determine if new criteria will result in a server fetch.

      If you need to force data to be re-fetched, you can call invalidateCache() and new data will automatically be fetched from the server using the current criteria and sort direction. NOTE: when using invalidateCache() there is no need to also call fetchData() and in fact this could produce unexpected results.

      This method takes an optional callback parameter (set to a DSCallback) to fire when the fetch completes. Note that this callback will not fire if no server fetch is performed. In this case the data is updated synchronously, so as soon as this method completes you can interact with the new data. If necessary, you can use resultSet.willFetchData() to determine whether or not a server fetch will occur when fetchData() is called with new criteria.

      In addition to the callback parameter for this method, developers can use resultSet.addDataArrivedHandler to be notified every time data is loaded.

      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
      Retrieves data from the DataSource that matches the specified criteria.

      When fetchData() is first called, if data has not already been provided via setData(), this method will create a ResultSet, which will be configured based on component settings such as fetchOperation and dataPageSize, as well as the general purpose dataProperties. The created ResultSet will automatically send a DSRequest to retrieve data from the dataSource, and from then on will automatically manage paging through large datasets, as well as performing filtering and sorting operations inside the browser when possible - see the ResultSet docs for details.

      NOTE: do not use both autoFetchData and a call to fetchData() - this may result in two DSRequests to fetch data. Use either autoFetchData and setAutoFetchCriteria() or a manual call to fetchData() passing criteria.

      Whether a ResultSet was automatically created or provided via setData(), subsequent calls to fetchData() will simply call resultSet.setCriteria().

      Changes to criteria may or may not result in a DSRequest to the server due to client-side filtering. You can call willFetchData(criteria) to determine if new criteria will result in a server fetch.

      If you need to force data to be re-fetched, you can call invalidateCache() and new data will automatically be fetched from the server using the current criteria and sort direction. NOTE: when using invalidateCache() there is no need to also call fetchData() and in fact this could produce unexpected results.

      This method takes an optional callback parameter (set to a DSCallback) to fire when the fetch completes. Note that this callback will not fire if no server fetch is performed. In this case the data is updated synchronously, so as soon as this method completes you can interact with the new data. If necessary, you can use resultSet.willFetchData() to determine whether or not a server fetch will occur when fetchData() is called with new criteria.

      In addition to the callback parameter for this method, developers can use resultSet.addDataArrivedHandler to be notified every time data is loaded.

      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
      Retrieves data from the DataSource that matches the specified criteria.

      When fetchData() is first called, if data has not already been provided via setData(), this method will create a ResultSet, which will be configured based on component settings such as fetchOperation and dataPageSize, as well as the general purpose dataProperties. The created ResultSet will automatically send a DSRequest to retrieve data from the dataSource, and from then on will automatically manage paging through large datasets, as well as performing filtering and sorting operations inside the browser when possible - see the ResultSet docs for details.

      NOTE: do not use both autoFetchData and a call to fetchData() - this may result in two DSRequests to fetch data. Use either autoFetchData and setAutoFetchCriteria() or a manual call to fetchData() passing criteria.

      Whether a ResultSet was automatically created or provided via setData(), subsequent calls to fetchData() will simply call resultSet.setCriteria().

      Changes to criteria may or may not result in a DSRequest to the server due to client-side filtering. You can call willFetchData(criteria) to determine if new criteria will result in a server fetch.

      If you need to force data to be re-fetched, you can call invalidateCache() and new data will automatically be fetched from the server using the current criteria and sort direction. NOTE: when using invalidateCache() there is no need to also call fetchData() and in fact this could produce unexpected results.

      This method takes an optional callback parameter (set to a DSCallback) to fire when the fetch completes. Note that this callback will not fire if no server fetch is performed. In this case the data is updated synchronously, so as soon as this method completes you can interact with the new data. If necessary, you can use resultSet.willFetchData() to determine whether or not a server fetch will occur when fetchData() is called with new criteria.

      In addition to the callback parameter for this method, developers can use resultSet.addDataArrivedHandler to be notified every time data is loaded.

      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 the dataset's invalidateCache() method, for example, ResultSet.invalidateCache().

      NOTE: there is no need to call invalidateCache() when a save operation is performed on a DataSource. Automatic cache synchronization features will automatically update caches - see ResultSet for details. If automatic cache synchronization isn't working, troubleshoot the problem using the steps suggested in the FAQ rather than just calling invalidateCache(). Calling invalidateCache() unnecessarily causes extra server load and added code complexity.

      Calling invalidateCache() will automatically cause a new fetch to be performed with the current set of criteria if data had been previously fetched and the component is currently drawn with data visible - there is no need to manually call fetchData() after invalidateCache() and this could result in duplicate fetches.

      While data is being re-loaded after a call to invalidateCache(), the widget is in a state similar to initial data load - it doesn't know the total length of the dataset and any APIs that act on records or row indices will necessarily fail and should not be called. To detect that the widget is in this state, call ResultSet.lengthIsKnown().

      invalidateCache() only has an effect if this component's dataset is a data manager class that manages a cache (eg ResultSet or ResultTree). If data was provided as a simple Array or List, invalidateCache() does nothing.

      Specified by:
      invalidateCache in interface DataBoundComponent
      See Also:
    • getResultSet

      public ResultSet getResultSet()
      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:
      ResultSet, or null if the underlying data is not a ResultSet
      See Also:
    • getRecordList

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

      Depending on the component configuration, the actual JavaScript instance of the returned RecordList may be one of several types:

      • If the component is not bound to a DataSource, the instance is generally an Array of Record.
      • If the component is bound to a DataSource, the instance is a ResultSet.
      • If the component is a grouped ListGrid, the instance is a Tree. To access the ungrouped record list regardless of grouping status, use
        isGrouped() ? getOriginalRecordList() : getRecordList()
      • If the component is a TreeGrid, the instance is a ResultTree.
      The underlying type determines the structure of the returned data. An Array or ResultSet represents a list of records, but a Tree or ResultTree represents a list of open rows in the tree, including groups or other nodes which contain no records.
      Specified by:
      getRecordList in interface DataBoundComponent
      Returns:
      the RecordList
    • getDataAsJSList

      public JavaScriptObject getDataAsJSList()
      Specified by:
      getDataAsJSList in interface DataBoundComponent
    • exportData

      public void exportData()
      Description copied from interface: DataBoundComponent
      Specified by:
      exportData in interface DataBoundComponent
    • exportData

      public void exportData(DSRequest requestProperties)
      Description copied from interface: DataBoundComponent
      Specified by:
      exportData in interface DataBoundComponent
    • exportData

      public void exportData(DSRequest requestProperties, RPCCallback callback)
      Description copied from interface: DataBoundComponent
      Uses a "fetch" operation on the current DataSource to retrieve data that matches the current filter and sort criteria for this component, then exports the resulting data to a file or window in the requested format.

      A variety of DSRequest settings, such as exportAs and exportFilename, affect the exporting process: see exportResults for further detail.

      Note that data exported via this method does not include any client-side formatting and relies on both the Smart GWT server and server-side DataSources. To export client-data with formatters applied, see exportClientData, which still requires the Smart GWT server but does not rely on server-side DataSources.

      For more information on exporting data, see DataSource.exportData.

      Specified by:
      exportData in interface DataBoundComponent
      Parameters:
      requestProperties - additional properties to set on DSRequest that will be issued
      callback - Optional callback. Note that this parameter only applies if you specify exportToClient: false in the request properties, because file downloads don't provide ordinary framework callbacks
      See Also:
    • addFetchDataHandler

      public HandlerRegistration addFetchDataHandler(FetchDataHandler handler)
      Add a fetchData handler.

      Notification function fired on fetchData() or filterData()

      Specified by:
      addFetchDataHandler in interface HasFetchDataHandlers
      Parameters:
      handler - the filterData handler
      Returns:
      HandlerRegistration used to remove this handler
    • addDropCompleteHandler

      public HandlerRegistration addDropCompleteHandler(DropCompleteHandler handler)
      Add a com.smartgwt.client.widgets.DropCompleteHandler. See that class's documentation for a definition of "drop complete", and how it differs from "drag complete" (com.smartgwt.client.widgets.DragCompleteHandler).
      Specified by:
      addDropCompleteHandler in interface HasDropCompleteHandlers
      Parameters:
      handler - the DropCompleteHandler
      Returns:
      HandlerRegistration used to remove this handler
    • addDragCompleteHandler

      public HandlerRegistration addDragCompleteHandler(DragCompleteHandler handler)
      Add a com.smartgwt.client.widgets.DragCompleteHandler. See that class's documentation for a definition of "drag complete", and how it differs from "drop complete" (com.smartgwt.client.widgets.DropCompleteHandler).
      Specified by:
      addDragCompleteHandler in interface HasDragCompleteHandlers
      Parameters:
      handler - the DropCompleteHandler
      Returns:
      HandlerRegistration used to remove this handler
    • getFieldAlignments

      public Alignment[] getFieldAlignments()
      Description copied from interface: DataBoundComponent
      Returna an array of field alignments for this grid
      Specified by:
      getFieldAlignments in interface DataBoundComponent
      Returns:
      array of Alignments
    • getDeepCloneOnEdit

      public Boolean getDeepCloneOnEdit()
      Description copied from interface: DataBoundComponent
      Before we start editing values in this DataBoundComponent, should we perform a deep clone of the underlying values. See DataSource.getDeepCloneOnEdit() for details of what this means.

      If this value is not explicitly set, it defaults to the DataSource deepCloneOnEdit value. This value can also be overridden per-field with DataSourceField.setDeepCloneOnEdit(java.lang.Boolean).

      Like the other deepCloneOnEdit settings, this flag only has an effect if you are editing a values object that contains nested objects or arrays, using Canvas.setDataPath(java.lang.String)

      Specified by:
      getDeepCloneOnEdit in interface DataBoundComponent
    • setDeepCloneOnEdit

      public DynamicForm setDeepCloneOnEdit(Boolean deepCloneOnEdit)
      Description copied from interface: DataBoundComponent
      Before we start editing values in this DataBoundComponent, should we perform a deep clone of the underlying values. See DataSource.getDeepCloneOnEdit() for details of what this means.

      If this value is not explicitly set, it defaults to the DataSource deepCloneOnEdit value. This value can also be overridden per-field with DataSourceField.setDeepCloneOnEdit(java.lang.Boolean).

      Like the other deepCloneOnEdit settings, this flag only has an effect if you are editing a values object that contains nested objects or arrays, using Canvas.setDataPath(java.lang.String)

      Specified by:
      setDeepCloneOnEdit in interface DataBoundComponent
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • setFields

      public DynamicForm setFields(JavaScriptObject... fields)
      Description copied from interface: DataBoundComponent
      Field setter variant (alternative to setFields(FormItem...), setFields(ListGridField...), etc.) that will accept an array of JavaScriptObject, rather than an array of SmartGWT Java wrappers of the field class type (e.g. FormItem, ListGridField, etc.) This is an advanced method and only for cases where you have the JavaScriptObject for each field but want to avoid having to create each associated SmartGWT Java wrapper.

      Note: use toArray() to create a Java array of JavaScriptObject if you only have the array itself as a single JavaScriptObject.

      Specified by:
      setFields in interface DataBoundComponent
      Parameters:
      fields - the component fields
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getFieldsAsJavaScriptObjects

      public JavaScriptObject[] getFieldsAsJavaScriptObjects()
      Description copied from interface: DataBoundComponent
      Return the fields as JavaScriptObjects rather than as SmartGWT Java wrappers of the field class type (e.g. FormItem, ListGridField, etc.) This avoids building the SmartGWT Java wrappers for the fields in situations where they aren't needed - and for FormItems in particular - where there may not be enough information to determine the correct subclass, such as before the SmartClient instance underlying the DynamicForm has been created.
      Specified by:
      getFieldsAsJavaScriptObjects in interface DataBoundComponent
      Returns:
      the component fields
    • getFieldCount

      public int getFieldCount()
      Description copied from interface: DataBoundComponent
      Return the number of fields.
      Specified by:
      getFieldCount in interface DataBoundComponent
      Returns:
      the number of fields
    • transferRecords

      public void transferRecords(Record[] records, Record targetRecord, Integer index, Canvas sourceWidget, TransferRecordsCallback callback)
      Description copied from interface: DataBoundComponent
      Transfer a list of Records from another component (does not have to be a databound component) into this component. This method is only applicable to list-type components, such as ListGrid or com.smartgwt.client.widgets.tile.TileGridTileGrid. Notably, it does not apply to TreeGrid; the equivalent for treeGrids is transferNodes.

      This method implements the automatic drag-copy and drag-move behaviors of components like ListGrid, and calling it is equivalent to completing a drag and drop of the dropRecords (the default record drop behavior is simply to call transferRecords(), passing in the dropped nodes)

      Note that this method is asynchronous - it may need to perform server turnarounds to prevent duplicates in the target component's data. If you wish to be notified when the transfer process has completed, you can either pass a non-null callback to this method or add a DropCompleteHandler to this component.

      See also transferSelectedData()

      Specified by:
      transferRecords in interface DataBoundComponent
      Parameters:
      records - Recordss to transfer to this component
      targetRecord - The target record (eg, of a drop interaction), for context
      index - Insert point relative to the target record for the transferred records
      sourceWidget - The databound or non-databound component from which the records are to be transferred.
      callback - optional TransferRecordsCallback to be fired when the transfer process has completed (pass null if your code does not need to be called back). The callback will be passed the list of records actually transferred to this component
    • setDragDataCustomizer

      public DynamicForm setDragDataCustomizer(DragDataCustomizer customizer)
      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 consulted by willAcceptDrop().

      Parameters:
      DragDataCustomizer - customizer
      Returns:
      DataBoundComponent instance, for chaining setter calls
    • getSort

      public SortSpecifier[] getSort()
      Description copied from interface: DataBoundComponent
      Returns the current SortSpecifiers for this component. Will return null if this component has never been sorted, or the underlying SmartClient widget does not exist.
      Specified by:
      getSort in interface DataBoundComponent
      Returns:
      current sort specifiers for this component (null if unsorted or no SC widget)
    • setSort

      public DynamicForm setSort(SortSpecifier... sortSpecifiers)
      Description copied from interface: DataBoundComponent
      Sort the component on one or more fields.

      Pass in an array of SortSpecifiers to have the component's data sorted by the fields in each specifier.property and in the directions specified. The component can be sorted by any combination of fields, including fields specified in the fields array and unused fields from the underlying dataSource, if there is one.

      If setSort() is called on a component which doesn't yet have a SmartClient widget, the widget will be created. If autoFetchData is set and a DataSource has been set, this will result in data being fetched.

      Specified by:
      setSort in interface DataBoundComponent
      Parameters:
      sortSpecifiers - Array of SortSpecifier objects
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(DynamicFormLogicalStructure s)
      Setter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
    • getLogicalStructure

      public LogicalStructureObject getLogicalStructure()
      Getter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
      Specified by:
      getLogicalStructure in interface LogicalStructure
      Overrides:
      getLogicalStructure in class Canvas