Reference
import { buildProperty } from "./builders";
const productsReferenceProperty = buildProperty({ name: "Product", dataType: "reference", path: "products", previewProperties: ["name", "main_image"]});Absolute collection path of the collection this reference points to. The schema of the entity is inferred based on the root navigation, so the filters and search delegate existing there are applied to this view as well.
previewProperties
Section titled “previewProperties”List of properties rendered as this reference preview. Defaults to first 3.
forceFilter
Section titled “forceFilter”Force a filter in the reference selection. If applied, the rest of the filters
will be disabled. Filters applied with this prop cannot be changed.
e.g. forceFilter: { age: [">=", 18] }
validation
Section titled “validation”requiredShould this field be compulsory.requiredMessageMessage to be displayed as a validation error.
defaultValue
Section titled “defaultValue”Default value for this property. You can set the default value by defining an EntityReference:
import { buildProperty } from "./builders";
const productsReferenceProperty = buildProperty({ name: "Product", dataType: "reference", path: "products", defaultValue: new EntityReference("B000P0MDMS", "products")});The widget that gets created is
ReferenceFieldBindingField that opens a reference selection dialog
Links: