Skip to main content
These components are used in Caseflow templates to render and edit individual fields, relations, and documents.

EditableField

Edit a single attribute in the current object context with type-aware editing, validation, datasets, and change automation.

Key capabilities

  • Automatic type inference from metadata
  • Explicit type override
  • Static and dynamic datasets
  • Regex and named validator support
  • Required field enforcement
  • Change-triggered actions
  • Autofill script integration

Props

PropTypeRequiredDefaultNotes
attributeNamestringYesSingle-level field name. Prefix with _ for transient/UI-only fields.
labelstringNoField label text.
placeholderstringNocomponent defaultPlaceholder in empty state.
typetext | number | date | datetime | textarea | html | checkboxNoauto-detectedOverride metadata type inference.
multilinebooleanNofalseForces textarea for text-like fields.
isHtmlbooleanNofalseEnables HTML display/edit mode with sanitization.
datasetstring[]NoStatic combobox options.
datasetConfigDatasetConfig or JSON stringNoDynamic options sourced from object search.
datasetQueryKeystringNoauto-generatedUse with refreshDataset:<key> actions.
disabledbooleanNofalseRead-only input state.
regexValidationstringNoPattern validation.
validationMessagestringNogeneric messageError text for regex/validator failures.
validatorstringNoNamed validator. Built-in: mod11Check.
initialValuestringNoApplied once on mount when field is empty.
requiredbooleanNofalseBlocks save when empty.
onChangedstringNoSingle, pipe-delimited, or JSON-array action chain.
autofillScriptstringNoScript slug for autofill execution on change.
autofillTargetsstringNoComma-separated target attributes for autofill result mapping.

DatasetConfig shape

{
  "className": "Category",
  "valueAttribute": "Code",
  "labelAttribute": "Name",
  "constraints": [
    { "dottedName": "IsActive", "operator": "=", "value": "1" }
  ],
  "sorting": [
    { "dottedName": "Name", "direction": "asc" }
  ]
}

Examples

Dynamic dataset:
<EditableField
  attributeName="Category"
  label="Category"
  datasetConfig='{
    "className":"Category",
    "valueAttribute":"Code",
    "labelAttribute":"Name",
    "sorting":[{"dottedName":"Name","direction":"asc"}]
  }'
  datasetQueryKey="category-options"
/>
Validation with change action:
<EditableField
  attributeName="Phone"
  regexValidation="^[0-9\\s\\-\\+]{0,20}$"
  validationMessage="Invalid phone format"
  onChanged='refresh:contact-search when ${newValue} != ${previousValue}'
/>
Transient field as template selector:
<EditableField
  attributeName="_TemplateName"
  label="Template"
  dataset='["Summary", "Detailed", "Audit"]'
  initialValue="Summary"
/>
Change automation with guard condition:
<EditableField
  attributeName="Status"
  onChanged='setValue:{"attributeName":"StatusChangedAt","value":"${today}"} when ${newValue} != ${previousValue}'
/>
Dynamic dataset with refresh support:
<EditableField
  attributeName="Category"
  datasetQueryKey="category-dataset"
  datasetConfig='{
    "className":"Category",
    "valueAttribute":"Code",
    "labelAttribute":"Name",
    "sorting":[{"dottedName":"Name","direction":"asc"}]
  }'
/>
<ScriptButton script="sync-categories" onSuccess="refreshDataset:category-dataset" />

RelatedObject

Render or edit a related object through a relation attribute. You can use it to display related data via a template or inline with child components.

Key capabilities

  • View mode — renders the related object using a template
  • Inline mode — uses child components directly for editable nested layouts
  • Registers an alias for cross-template reference via {{alias.Field}}

Props

PropTypeRequiredDefaultNotes
relationAttrNamestringYesRelation attribute on the current object.
templateNamestringNoclass default Update templateUsed for view rendering.
modeview | inlineNoviewinline for editable nested layouts.
aliasstringNoRegisters related object scope for {{alias.Field}}.
classNamestringNoStyling hook.

Examples

Alias-based cross-reference:
<RelatedObject relationAttrName="TaskRelation" alias="task" />
<p>Task: {{task.Name}}</p>
<p>Created: {{task.stock.createddate}}</p>
Inline editing:
<RelatedObject relationAttrName="TaskRelation" mode="inline">
  <EditableField attributeName="Name" label="Task name" />
  <EditableField attributeName="DueDate" type="date" />
</RelatedObject>

RelatedDocument

Render a document-type attribute as a read-only linked or previewed document.

Props

PropTypeRequiredDefaultNotes
attributeNamestringYesAttribute holding the document ID.
labelstringNoField label.
placeholderstringNocomponent defaultEmpty-state text.
previewinline | modal | noneNononePreview mode.
previewHeightstringNo400pxApplies to inline mode.
defaultExpandedbooleanNofalseInline preview initial expansion.
classNamestringNoStyling hook.

Example

Inline preview:
<RelatedDocument
  attributeName="MainDocument"
  label="Main document"
  preview="inline"
  previewHeight="520px"
/>

RelationPicker

Select or create a related object for a relation attribute with a searchable dropdown.

Key capabilities

  • Searchable relation dropdown
  • Optional create modal (allowCreate)
  • Constraints and sorting for dropdown candidates
  • onChanged and onCreated actions
  • Full selected object context (${selectedObject}) for auto-population
  • Nested relation traversal in runtime expressions

Props

PropTypeRequiredDefaultNotes
relationAttrNamestringYesRelation attribute to set.
displayAttributeNamestringYesAttribute used for option labels.
allowCreatebooleanNofalseEnables create-from-picker flow.
createTemplateNamestringNoclass default Create templateCreation template override.
openCreatedObjectstring | booleanNofalseOpen newly created object in new tab.
onCreatedstringNoActions executed after create flow completes.
onChangedstringNoActions executed when selected relation changes.
constraintsSearchConstraint[] or JSON stringNoFilter dropdown candidates.
sortingSearchSortColumn[] or JSON stringNoOrder dropdown candidates.
labelstringNoField label.
placeholderstringNocomponent defaultEmpty-state text.
searchablebooleanNotrueDropdown search toggle.

Examples

Auto-populate from selected object:
<RelationPicker
  relationAttrName="TypeRelation"
  displayAttributeName="Name"
  onChanged='setValue:{"attributeName":"Priority","value":"${selectedObject.DefaultPriority ?? \"Normal\"}"}'
/>
Nested relation traversal:
<RelationPicker
  relationAttrName="TypeRelation"
  displayAttributeName="Name"
  onChanged='setValue:{"attributeName":"Step","value":"${selectedObject.StepConfigurationRelation.DefaultStep}"}'
/>
Constraints and sorting:
<RelationPicker
  relationAttrName="AssigneeRelation"
  displayAttributeName="DisplayName"
  constraints='[
    {"dottedName":"IsActive","operator":"=","value":"1"},
    {"dottedName":"Department","operator":"=","value":"{{Department}}"}
  ]'
  sorting='[{"dottedName":"DisplayName","direction":"asc"}]'
/>

Shared utility components

These components are also available in Caseflow templates:
ComponentMain propsTypical usage
DateDisplayvalue, includeTimePresent formatted date/time values.
MessageCardauthor, timestamp, content, isDraftRender communication or event cards.
CollapsibleSectiontitle, badge, defaultExpandedProgressive disclosure for large templates.
Tabs + TabdefaultValue on Tabs; value, label, badge on TabSegment complex forms or dashboards.

Example

<Tabs defaultValue="summary">
  <Tab value="summary" label="Summary">
    <EditableField attributeName="Title" />
  </Tab>
  <Tab value="documents" label="Documents" badge="{{DocumentCount}}">
    <DocumentSearch config='{"documentTypeIds":[116]}' />
  </Tab>
</Tabs>