Skip to main content
These components handle data display, search results, object creation, saving, and script execution in Caseflow templates.

ObjectSearch

Query and render objects in table, cards, or list format with row actions, editing, and create support.

Key capabilities

  • Declarative query config with class, display columns, constraints, and sorting
  • Row context menu — edit, delete, documents, history
  • Editable mode with modal editing
  • Create mode with defaults
  • Optional per-row document lookup via documentSearchConfig
  • queryKey for targeted refresh
  • itemTemplateName for card/list rendering

Props

PropTypeRequiredDefaultNotes
configObjectSearchConfig or JSON stringYesMust include class and display columns.
displaytable | cards | listNotablecards/list can use itemTemplateName.
itemTemplateNamestringNoPer-row template for cards/list rendering.
editablebooleanNofalseEnables edit action and edit modal flow.
editTemplateNamestringNoclass default Update templateEdit modal template override.
allowCreatebooleanNofalseEnables add/create action.
createTemplateNamestringNoclass default Create templateCreate modal template override.
createDefaultsRecord<string,string> or JSON stringNoApplied to new object before first render.
allowDeletebooleanNofalseEnables delete action with privilege checks.
documentSearchConfigDocumentSearchDto or JSON stringNoEnables per-row documents modal action.
queryKeystringNoobject-search-<className>Stable key for targeted refresh actions.
openCreatedObjectstring | booleanNofalseOpen newly created object in new tab.

ObjectSearchConfig shape

{
  "className": "Task",
  "displayColumns": [
    { "dottedName": "Name" },
    { "dottedName": "Status", "label": "Current status" }
  ],
  "constraints": [
    { "dottedName": "CaseRelation", "operator": "=", "value": "{{stock.objectid}}" }
  ],
  "sorting": [
    { "dottedName": "Name", "direction": "asc" }
  ]
}

Examples

Editable list with create and targeted refresh:
<ObjectSearch
  queryKey="case-tasks"
  config='{
    "className":"Task",
    "displayColumns":[{"dottedName":"Name"},{"dottedName":"Status"}],
    "constraints":[{"dottedName":"CaseRelation","operator":"=","value":"{{stock.objectid}}"}]
  }'
  editable="true"
  allowCreate="true"
  allowDelete="true"
  createDefaults='{"CaseRelation":"{{stock.objectid}}"}'
/>
Row-specific document lookup using ${row.*} variables:
<ObjectSearch
  queryKey="objects-with-docs"
  config='{
    "className":"Task",
    "displayColumns":[{"dottedName":"Name"}]
  }'
  documentSearchConfig='{
    "documentTypeIds":[116],
    "filters":[
      {"keywordTypeId":115,"operator":"Equal","value":"${row.stock.objectid}"}
    ],
    "maxResults":50
  }'
/>

DocumentSearch

Query and render documents from a document search configuration with optional upload support.

Props

PropTypeRequiredDefaultNotes
configDocumentSearchDto or JSON stringYesMain query contract for documents.
displaytable | cards | listNotableRendering style.
viewablebooleanNotrueEnables open/view behavior.
queryKeystringNoauto-generatedUse stable key for refreshDocuments:<key>.
showHeaderbooleanNotrueResult count and refresh controls.
titlestringNocomponent defaultHeader title.
allowUploadbooleanNofalseEnables upload entry point.
createDefaultsDocumentUploadDefaults or JSON stringNoPrefills upload type and keywords.
classNamestringNoStyling hook.

Common enum values for configs

EnumValues
FilterOperatorEqual, NotEqual, LessThan, LessThanEqual, GreaterThan, GreaterThanEqual, Contains, StartsWith, EndsWith, IsNull, IsNotNull
SortDirectionAscending, Descending
StandardColumnDocumentId, DocumentName, DocumentTypeId, DocumentTypeName, DocumentTypeGroupId, DocumentTypeGroupName, DocumentDate, StoredDate, CreatedByUserId, CreatedByUsername, FileExtension, FileTypeName, MimeType, CurrentRevisionNumber
DateFilterPresetToday, Yesterday, ThisWeek, LastWeek, CurrentMonth, LastMonth, ThisYear, LastYear

Examples

Baseline document search:
<DocumentSearch
  queryKey="case-documents"
  config='{
    "documentTypeIds":[116],
    "filters":[
      {"keywordTypeId":115,"operator":"Equal","value":"{{stock.objectid}}"}
    ],
    "maxResults":50
  }'
/>
Upload flow with defaults:
<DocumentSearch
  queryKey="case-documents"
  config='{
    "documentTypeIds":[116],
    "filters":[
      {"keywordTypeId":115,"operator":"Equal","value":"{{stock.objectid}}"}
    ]
  }'
  allowUpload="true"
  createDefaults='{
    "documentTypeId":"116",
    "keywords":[
      {"keywordTypeId":"115","value":"{{stock.objectid}}"},
      {"keywordTypeId":"320","value":"{{CaseNumber}}"}
    ]
  }'
/>

CreateObjectButton

Open a create modal for a class and optionally run post-create actions.

Props

PropTypeRequiredDefaultNotes
classNamestringYesClass to create.
templateNamestringNoclass default Create templateCreate template override.
defaultsRecord<string,string> or JSON stringNoInitial create values.
labelstringNocomponent defaultButton text.
variantprimary | secondary | outline | ghostNoprimaryButton styling.
onCreatedstringNoAction chain after successful create.
openCreatedObjectstring | booleanNofalseOpen created object in new tab.
buttonClassNamestringNoStyling hook.

Example

Create with refresh and local update:
<CreateObjectButton
  className="Task"
  defaults='{"CaseRelation":"{{stock.objectid}}","Status":"Open"}'
  onCreated='refresh:case-tasks | setValue:{"attributeName":"HasTasks","value":"true"}'
  label="Add task"
/>

SaveButton

Save dirty objects within a controlled scope with before/after hooks for validation and automation.

Props

PropTypeRequiredDefaultNotes
scopeprimary | allNoprimarySave scope when objectKey is not supplied.
objectKeystringNoTarget a specific object in store.
labelstringNocomponent defaultButton text.
variantprimary | secondary | outline | ghostNoprimaryButton styling.
requireDirtybooleanNotrueSet false to allow hook-only save triggers.
onBeforeSavestringNoExecutes before save API call.
onAfterSavestringNoExecutes after successful save API call.
classNamestringNoStyling hook.

Save hook runtime variables

  • ${changedFields} — array with utilities like .includes("Field"), .length, .join(", ")
  • ${oldValues.AttributeName}
  • ${newValues.AttributeName}

Examples

Save-time validation gate:
<SaveButton
  scope="primary"
  onBeforeSave='throwError:{"message":"Notes are required when closing"} when ${newValues.Status} == "Closed" and ${newValues.Notes} == ""'
/>
Normalize values before save and refresh after save:
<SaveButton
  scope="primary"
  onBeforeSave='setValue:{"attributeName":"SubmittedBy","value":"{{user.username}}"}'
  onAfterSave='refresh:case-tasks | refreshDocuments:case-documents'
  label="Save changes"
/>

ScriptButton

Run a script directly from the UI with input mapping and result-driven follow-up actions.

Props

PropTypeRequiredDefaultNotes
scriptstringYesScript slug.
inputsobject or JSON stringNo{}Supports {{...}} and ${...} variable forms.
labelstringNocomponent defaultButton text.
variantprimary | secondary | outline | ghostNoprimaryButton styling.
onSuccessstringNoAction chain with ${scriptResult...} support.
onErrorstringNoAction chain with ${scriptError} support.
disabledbooleanNofalseDisable button execution.
classNamestringNoStyling hook.

Example

Script output projected to field:
<ScriptButton
  script="generate-document"
  inputs='{"object_id":"{{stock.objectid}}","template":"${_TemplateName}"}'
  onSuccess='setValue:{"attributeName":"GeneratedDocumentId","value":"${scriptResult.data.document_id}"} | refreshDocuments:case-documents'
  onError='throwError:{"message":"Document generation failed"}'
  label="Generate document"
/>

Internal support components

These components are used internally by the Caseflow runtime. They are not available as template tags but are important for understanding the system.
Modal shell for template-driven create/edit operations. Used by ObjectSearch and CreateObjectButton.
  • Create mode initializes a new in-memory object state and can apply defaults
  • Edit mode binds to an existing object key
  • Resolves and renders the chosen template (Create or Update)
  • Handles save mutation and callback orchestration (onCreated, onSaved)
  • Can open created object in a new tab
  • Invalidates related query keys after save so dependent UI refreshes
  • If closed before first save, unsaved temporary state is cleaned up
  • If no template exists, a clear fallback message is shown
Modal wrapper around DocumentSearch with resolved config. Used by ObjectSearch row actions for “view related documents”.
  • Receives already-resolved configuration from parent (including row-variable substitutions)
  • Shows loading state while configuration is being prepared
  • Renders DocumentSearch in table mode with header enabled
File preview renderer with revision/rendition selection and live refresh. Used by RelatedDocument preview modes.
  • Fetches revisions and renditions for a document
  • Picks latest revision and default rendition for preview
  • Subscribes to document revision events and refreshes automatically
  • Returns structured loading, empty, and error states
Renders one search result item using a named Caseflow template for cards/list displays. Used by ObjectSearch when display="cards" or display="list".
  • Creates an isolated object provider per item (no row-to-row state bleed)
  • Fetches the named template for the row’s class in update context
  • Builds item scope with regular attributes, stock attributes, user context, and alias scopes
Shows object audit details in a dialog with two data views. Used by ObjectSearch row action “View history”.
  • Attribute Changes tab — flattened transaction/attribute change rows
  • Event Log tab — event timeline with translated event types
  • Loads history only when dialog is open
  • Formats UTC timestamps for readable presentation

Complete component inventory

ComponentTemplate tagPrimary purpose
EditableFieldYesEdit one attribute with type-aware editor
RelatedObjectYesResolve and render a related object
RelatedDocumentYesRender document attribute with preview
RelationPickerYesSelect or create relation targets
ObjectSearchYesExecute object searches with row actions
DocumentSearchYesExecute document searches with optional upload
CreateObjectButtonYesLaunch create-object modal
SaveButtonYesSave current or all objects
ScriptButtonYesRun a script on-demand
ObjectModalNoModal shell for create/edit operations
DocumentsModalNoModal wrapper for document search
DocumentPreviewNoFile preview with revision support
ItemTemplateRendererNoRender one search result via template
ObjectHistoryDialogNoObject audit and history dialog