CaseField (Deprecated)
CaseField (Deprecated)
|
|
Headless v1 has been deprecated. We recommend using the latest version of the Coveo Headless library. |
The CaseField controller is responsible for setting the value and retrieving suggestions for a field from the case creation form and optionally trigger Case Assist API requests.
Methods
update
Sets the value of the specified field.
Parameters
-
value:
stringThe field value to set.
-
updatesToFetch:
UpdateCaseFieldFetchOptionsA set of flags dictating whether to fetch case assist data after updating the field value.
-
autoSelection:
booleanA flag indicating whether the update was triggered by an automatic selection.
subscribe
Adds a callback that’s invoked on state change.
Parameters
-
listener:
() => voidA callback that’s invoked on state change.
Returns Unsubscribe: A function to remove the listener.
Attributes
state
A scoped and simplified part of the headless state that is relevant to the CaseField controller.
Properties
-
error:
CaseAssistAPIErrorStatusResponse | nullThe error that occurred while fetching suggestions, if any.
-
loading:
booleanWhether suggestions are being retrieved for the field.
-
suggestions:
CaseFieldSuggestion[]The field suggestions.
-
value:
stringThe current field value.
Initialize
buildCaseField
Creates a CaseField controller instance.
Parameters
-
engine:
CaseAssistEngineThe headless engine.
-
props:
CaseFieldPropsThe configurable
CaseFieldcontroller properties.
Returns CaseField
CaseFieldProps
The configurable CaseField controller properties.
Properties
-
options?:
CaseFieldOptions
CaseFieldOptions
Properties
-
field:
string
Related types
CaseFieldSuggestion
Properties
-
confidence:
numberThe confidence value of the suggestion in decimal.
-
id:
stringThe ID of the suggestion.
-
value:
stringThe suggested field value.
Unsubscribe
Call signatures
-
(): void
UpdateCaseFieldFetchOptions
Properties
-
caseClassifications?:
boolean -
documentSuggestions?:
boolean