Class GridEditRecordTask

All Implemented Interfaces:
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:
  • Constructor Details

    • GridEditRecordTask

      public GridEditRecordTask()
    • GridEditRecordTask

      public GridEditRecordTask(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static GridEditRecordTask getOrCreateRef(JavaScriptObject jsObj)
    • create

      public JavaScriptObject create()
      Overrides:
      create in class ComponentTask
    • setCriteria

      public GridEditRecordTask setCriteria(Criteria criteria) throws 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:
      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(Boolean editFirstRecord) throws 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:
      IllegalStateException - this property cannot be changed after the underlying component has been created
    • getEditFirstRecord

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