com.smartgwt.client.util.workflow

## Class GridEditRecordTask

- java.lang.Object
- - com.smartgwt.client.core.BaseClass
  - - com.smartgwt.client.util.workflow.ProcessElement
    - - com.smartgwt.client.util.workflow.ComponentTask
      - - com.smartgwt.client.util.workflow.GridEditRecordTask

- All Implemented Interfaces:
    com.google.gwt.event.shared.HasHandlers

      public class GridEditRecordTask
      extends ComponentTask

  Edit an existing record in a grid or start editing a new one. A new record is added unless `criteria` is specified. Alternatively, if `editFirstRecord` is specified, the first record is edited.

  If criteria is provided and the criteria matches more than one record, the first matched record is edited. Additionally, if the record to be edited is not visible, the record will be scrolled into view.

  Note that the record to be matched must already be loaded in the grid - no fetch will be performed.

  See Also:
    `ListGrid.editExistingRecord()`, `ListGrid.startEditingNew()`

- - ### Field Summary

    - ### Fields inherited from class com.smartgwt.client.core.BaseClass

      `config, configOnly, factoryCreated, factoryProperties, id, scClassName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GridEditRecordTask()`
    `GridEditRecordTask(com.google.gwt.core.client.JavaScriptObject jsObj)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.google.gwt.core.client.JavaScriptObject` | `create()`
    `Criteria` | `getCriteria()` Criteria (including AdvancedCriteria) used to locate the record to be edited.
    `java.lang.Boolean` | `getEditFirstRecord()` When neither `initialValues` nor `Criteria` are provided should the first record in the grid be edited? If not set, a new record is added.
    `Record` | `getInitialValues()` Initial values for a new edit record.
    `static GridEditRecordTask` | `getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `GridEditRecordTask` | `setCriteria(Criteria criteria)` Criteria (including AdvancedCriteria) used to locate the record to be edited.
    `GridEditRecordTask` | `setEditFirstRecord(java.lang.Boolean editFirstRecord)` When neither `initialValues` nor `Criteria` are provided should the first record in the grid be edited? If not set, a new record is added.
    `GridEditRecordTask` | `setInitialValues(Record initialValues)` Initial values for a new edit record.

    - ### Methods inherited from class com.smartgwt.client.util.workflow.ComponentTask

      `getComponentBaseClass, getComponentBaseClassAsStringArray, getComponentId, getComponentRequiresDataSource, getTargetBaseClass, getTargetBaseClassAsStringArray, getTargetComponent, getTargetComponent, getUnsupportedComponentMessage, setComponentBaseClass, setComponentBaseClass, setComponentId, setComponentRequiresDataSource, setTargetBaseClass, setTargetBaseClass, setUnsupportedComponentMessage`

    - ### Methods inherited from class com.smartgwt.client.util.workflow.ProcessElement

      `completeElement, convertToJavaScriptArray, executeElement, getBindOutput, getClassDescription, getComponentReferences, getDescription, getDynamicValue, getEditorType, getElementDescription, getForceSingle, getID, getInvalidTaskMessage, getJsObj, getMockMode, getNextElement, getOrCreateJsObj, getPassThruOutput, getProcessElements, getSupportsMultipleInputRecords, getTextFormulaValue, getTypeTitle, getUndefinedComponentMessage, getUnresolvedComponentMessage, getWaitDuration, getWaitFor, getWaitLocator, isCreated, isValid, objectReferencesLastTaskOutput, onInit, reset, setAttribute, setBindOutput, setClassDescription, setDescription, setEditorType, setForceSingle, setID, setJavaScriptObject, setMockMode, setNextElement, setPassThruOutput, setSupportsMultipleInputRecords, setTypeTitle, setUndefinedComponentMessage, setUnresolvedComponentMessage, setWaitDuration, setWaitFor, setWaitLocator, updateGlobalIDInCriteria, updateGlobalIDInTextFormula, updateGlobalIDInValueProperty, updateGlobalIDInValues, updateGlobalIDReferences, updateLastElementBindingReferences, updateLastElementInCriteria, updateLastElementInValueProperty, updateLastElementInValues`

    - ### Methods inherited from class com.smartgwt.client.core.BaseClass

      `addDynamicProperty, addDynamicProperty, addDynamicProperty, addDynamicProperty, applyFactoryProperties, asSGWTComponent, clearDynamicProperty, createJsObj, destroy, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getRef, getRuleScope, getScClassName, getTestInstance, hasAutoAssignedID, hasDynamicProperty, internalSetID, internalSetID, isConfigOnly, isFactoryCreated, onBind, registerID, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoID, setConfig, setConfigOnly, setFactoryCreated, setProperty, setProperty, setProperty, setProperty, setRuleScope, setScClassName`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GridEditRecordTask

          public GridEditRecordTask()

    - #### GridEditRecordTask

          public GridEditRecordTask(com.google.gwt.core.client.JavaScriptObject jsObj)

  - ### Method Detail

    - #### getOrCreateRef

          public static GridEditRecordTask getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### create

          public com.google.gwt.core.client.JavaScriptObject create()

      Overrides:
        `create` in class `ComponentTask`

    - #### setCriteria

          public GridEditRecordTask setCriteria(Criteria criteria)
                                         throws java.lang.IllegalStateException

      Criteria (including AdvancedCriteria) used to locate the record to be edited. If criteria matches more than one record, the first record is edited.

      Data values in this criteria prefixed with "$" will be treated as dynamic expressions which can access the inputs to this task as $input - see `TaskInputExpression`. Specifically, this means that for simple criteria, any property value that is a String and is prefixed with "$" will be assumed to be an expression, and for AdvancedCriteria, the same treatment will be applied to `Criterion.value`.

      This property supports `DynamicCriteria` - use `Criterion.valuePath` to refer to values in the `Process.ruleScope`.

      Parameters:
        `criteria` - New criteria value. Default value is null
      Returns:
        `GridEditRecordTask` instance, for chaining setter calls
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the underlying component has been created

    - #### getCriteria

          public Criteria getCriteria()

      Criteria (including AdvancedCriteria) used to locate the record to be edited. If criteria matches more than one record, the first record is edited.

      Data values in this criteria prefixed with "$" will be treated as dynamic expressions which can access the inputs to this task as $input - see `TaskInputExpression`. Specifically, this means that for simple criteria, any property value that is a String and is prefixed with "$" will be assumed to be an expression, and for AdvancedCriteria, the same treatment will be applied to `Criterion.value`.

      This property supports `DynamicCriteria` - use `Criterion.valuePath` to refer to values in the `Process.ruleScope`.

      Returns:
        Current criteria value. Default value is null

    - #### setEditFirstRecord

          public GridEditRecordTask setEditFirstRecord(java.lang.Boolean editFirstRecord)
                                                throws java.lang.IllegalStateException

      When neither `initialValues` nor `Criteria` are provided should the first record in the grid be edited? If not set, a new record is added.
      Parameters:
        `editFirstRecord` - New editFirstRecord value. Default value is null
      Returns:
        `GridEditRecordTask` instance, for chaining setter calls
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the underlying component has been created

    - #### getEditFirstRecord

          public java.lang.Boolean getEditFirstRecord()

      When neither `initialValues` nor `Criteria` are provided should the first record in the grid be edited? If not set, a new record is added.
      Returns:
        Current editFirstRecord value. Default value is null

    - #### setInitialValues

          public GridEditRecordTask setInitialValues(Record initialValues)
                                              throws java.lang.IllegalStateException

      Initial values for a new edit record.

      Data values prefixed with "$" will be treated as a `TaskInputExpression` excluding "$input" and "$inputRecord" references.

      Parameters:
        `initialValues` - New initialValues value. Default value is null
      Returns:
        `GridEditRecordTask` instance, for chaining setter calls
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the underlying component has been created

    - #### getInitialValues

          public Record getInitialValues()

      Initial values for a new edit record.

      Data values prefixed with "$" will be treated as a `TaskInputExpression` excluding "$input" and "$inputRecord" references.

      Returns:
        Current initialValues value. Default value is null