Class RecordEditor

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, HasFormulaUpdatedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers, HasBodyKeyPressHandlers, HasCellClickHandlers, HasCellContextClickHandlers, HasCellDoubleClickHandlers, HasCellErrorIconHoverHandlers, HasCellErrorIconOutHandlers, HasCellErrorIconOverHandlers, HasCellHoverHandlers, HasCellMouseDownHandlers, HasCellMouseUpHandlers, HasCellOutHandlers, HasCellOverHandlers, HasCellSavedHandlers, HasCellSelectionChangedHandlers, HasCellValueHoverHandlers, HasCriteriaChangedHandlers, HasDataArrivedHandlers, HasDataChangedHandlers, HasDrawAreaChangedHandlers, HasEditCompleteHandlers, HasEditFailedHandlers, HasEditorEnterHandlers, HasEditorExitHandlers, HasFieldStateChangedHandlers, HasFilterEditorSubmitHandlers, HasGroupByCompleteHandlers, HasGroupByHandlers, HasGroupStateChangedHandlers, HasGroupTreeChangedHandlers, HasHeaderClickHandlers, HasHeaderDoubleClickHandlers, HasHeaderHoverHandlers, HasHilitesChangedHandlers, HasRecordClickHandlers, HasRecordCollapseHandlers, HasRecordDoubleClickHandlers, HasRecordDropHandlers, HasRecordExpandHandlers, HasRegroupHandlers, HasRemoveRecordClickHandlers, HasRowContextClickHandlers, HasRowEditorEnterHandlers, HasRowEditorExitHandlers, HasRowHoverHandlers, HasRowMouseDownHandlers, HasRowMouseUpHandlers, HasRowOutHandlers, HasRowOverHandlers, HasSelectionChangedHandlers, HasSelectionUpdatedHandlers, HasSetSortHandlers, HasSortChangedHandlers, HasSorterClickHandlers, HasSorterContextClickHandlers, HasViewStateChangedHandlers, HasMembersChangedHandlers

public class RecordEditor extends ListGrid
Component for editing a single record.
RecordEditors are implemented as a subclass of ListGrid, showing no header and a single row always drawn in the editable state, allowing the user to modify the values at any time. The actionButton is automatically shown as a way for the user to act upon the edited values.

The RecordEditor class exists as a helper class for ListGrids, used to provide an interface for editing criteria when filterEditor is set to true.

See Also:
  • Constructor Details

    • RecordEditor

      public RecordEditor()
    • RecordEditor

      public RecordEditor(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static RecordEditor getOrCreateRef(JavaScriptObject jsObj)
    • getTestInstance

      protected RecordEditor getTestInstance()
      Overrides:
      getTestInstance in class ListGrid
    • 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 ListGrid
    • setActionButtonProperties

      public RecordEditor setActionButtonProperties(Button actionButtonProperties) throws IllegalStateException
      Properties to apply to the automatically generated actionButton.

      Note that for a recordEditor being used as a ListGrid.filterEditor, the ListGrid.filterButtonProperties can be used to specify actionButton properties directly at the grid level.

      Note : This is an advanced setting

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

      public Button getActionButtonProperties()
      Properties to apply to the automatically generated actionButton.

      Note that for a recordEditor being used as a ListGrid.filterEditor, the ListGrid.filterButtonProperties can be used to specify actionButton properties directly at the grid level.

      Returns:
      Current actionButtonProperties value. Default value is null
    • setActionButtonStyle

      public RecordEditor setActionButtonStyle(String actionButtonStyle) throws IllegalStateException
      Parameters:
      actionButtonStyle - New actionButtonStyle value. Default value is "normal"
      Returns:
      RecordEditor instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getActionButtonStyle

      public String getActionButtonStyle()
      Returns:
      Current actionButtonStyle value. Default value is "normal"
      See Also:
    • setBaseStyle

      public RecordEditor setBaseStyle(String baseStyle) throws IllegalStateException
      base cell style for this listGrid. If this property is unset, base style may be derived from ListGrid.normalBaseStyle or ListGrid.tallBaseStyle as described in ListGrid.getBaseStyle().

      See CellStyleSuffixes for details on how stateful suffixes are combined with the base style to generate stateful cell styles.

      Overrides:
      setBaseStyle in class ListGrid
      Parameters:
      baseStyle - New baseStyle value. Default value is "recordEditorCell"
      Returns:
      RecordEditor instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getBaseStyle

      public String getBaseStyle()
      base cell style for this listGrid. If this property is unset, base style may be derived from ListGrid.normalBaseStyle or ListGrid.tallBaseStyle as described in ListGrid.getBaseStyle().

      See CellStyleSuffixes for details on how stateful suffixes are combined with the base style to generate stateful cell styles.

      Overrides:
      getBaseStyle in class ListGrid
      Returns:
      Current baseStyle value. Default value is "recordEditorCell"
      See Also:
    • setCanSaveSearches

      public RecordEditor setCanSaveSearches(boolean canSaveSearches) throws IllegalStateException
      CanSaveSearches is explicitly disabled for RecordEditors by default.
      Overrides:
      setCanSaveSearches in class ListGrid
      Parameters:
      canSaveSearches - New canSaveSearches value. Default value is false
      Returns:
      RecordEditor instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getCanSaveSearches

      public boolean getCanSaveSearches()
      CanSaveSearches is explicitly disabled for RecordEditors by default.
      Overrides:
      getCanSaveSearches in class ListGrid
      Returns:
      Current canSaveSearches value. Default value is false
    • setFilterImg

      public RecordEditor setFilterImg(String filterImg) throws IllegalStateException
      Icon to show on the actionButton if this component is being used as a ListGrid.filterEditor.

      Note that this SCImgURL will be resolved using the skinImgDir defined for the RecordEditor.

      Parameters:
      filterImg - New filterImg value. Default value is "[SKIN]filter.png"
      Returns:
      RecordEditor instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getFilterImg

      public String getFilterImg()
      Icon to show on the actionButton if this component is being used as a ListGrid.filterEditor.

      Note that this SCImgURL will be resolved using the skinImgDir defined for the RecordEditor.

      Returns:
      Current filterImg value. Default value is "[SKIN]filter.png"
      See Also:
    • setRecordSummaryBaseStyle

      public RecordEditor setRecordSummaryBaseStyle(String recordSummaryBaseStyle) throws IllegalStateException
      If showing any record summary fields (IE: fields of type:"summary"), this attribute specifies a custom base style to apply to cells in the summary field
      Overrides:
      setRecordSummaryBaseStyle in class ListGrid
      Parameters:
      recordSummaryBaseStyle - New recordSummaryBaseStyle value. Default value is "recordEditorCell"
      Returns:
      RecordEditor instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getRecordSummaryBaseStyle

      public String getRecordSummaryBaseStyle()
      If showing any record summary fields (IE: fields of type:"summary"), this attribute specifies a custom base style to apply to cells in the summary field
      Overrides:
      getRecordSummaryBaseStyle in class ListGrid
      Returns:
      Current recordSummaryBaseStyle value. Default value is "recordEditorCell"
      See Also:
    • setSkinImgDir

      public RecordEditor setSkinImgDir(String skinImgDir) throws IllegalStateException
      Where do 'skin' images (those provided with the class) live?
      Overrides:
      setSkinImgDir in class ListGrid
      Parameters:
      skinImgDir - New skinImgDir value. Default value is "images/RecordEditor/"
      Returns:
      RecordEditor instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getSkinImgDir

      public String getSkinImgDir()
      Where do 'skin' images (those provided with the class) live?
      Overrides:
      getSkinImgDir in class ListGrid
      Returns:
      Current skinImgDir value. Default value is "images/RecordEditor/"
      See Also:
    • setSuppressNullValueFormat

      public RecordEditor setSuppressNullValueFormat(boolean suppressNullValueFormat) throws IllegalStateException
      Should non-editable fields within this record-editor always display the empty cell value for null values rather than running any specified static formatters?

      This setting allows developers to easily account for the fact that a custom formatter for empty cells in a listGrid is often not appropriate to display in the filter editor for a canFilter:false field with no specified criterion.

      Note : This is an advanced setting

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

      public boolean getSuppressNullValueFormat()
      Should non-editable fields within this record-editor always display the empty cell value for null values rather than running any specified static formatters?

      This setting allows developers to easily account for the fact that a custom formatter for empty cells in a listGrid is often not appropriate to display in the filter editor for a canFilter:false field with no specified criterion.

      Returns:
      Current suppressNullValueFormat value. Default value is true
    • performAction

      public void performAction()
      Fired when the user clicks the actionButton for this RecordEditor. May also be triggered from other user interaction with edit values (for example filter-editor change - see ListGrid.filterOnKeypress).

      This is the method which initiates a filter in a listGrid filter editor. Note that for custom filtering behavior, developers can use the ListGrid.filterEditorSubmit() notification method rather than overriding this method directly.

    • setDefaultProperties

      public static void setDefaultProperties(RecordEditor recordEditorProperties)
      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:
      recordEditorProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • getActionButton

      @Deprecated public Button getActionButton() throws IllegalStateException
      Deprecated.
      in favor of getActionCanvas()
      Throws:
      IllegalStateException
    • getActionCanvas

      public StatefulCanvas getActionCanvas() throws IllegalStateException
      Automatically created Button auto-child shown at the edge of the recordEditor. For a recordEditor acting as a ListGrid.filterEditor, this button will show the filterImg as an Button.icon by default.

      Clicking this button will call performAction() on the editor.

      May be customized using the standard com.smartgwt.client.types.AutoChild pattern, by overriding actionButtonProperties.

      This component is an AutoChild named "actionButton". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current actionButton value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(RecordEditorLogicalStructure 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 ListGrid