Skip to main content

IListFormContext

@spartanfx/react v1.2.2


@spartanfx/react / spfx / IListFormContext

Interface: IListFormContext

Describes the complete context of a SharePoint list form within an SPFx web part.

This includes field metadata, form state, validation, attachments, and access to the underlying SPFx and PnPjs services.

Properties​

PropertyTypeDescription
attachmentsIFormAttachmentsAttachments manager
disabledbooleanIndicates if the form controls are disabled
fieldsIFieldInfo[]Metadata for fields available on the list
formStateIFormStateState manager for field values in the form
getField(fieldInternalName) => IFieldInfoRetrieves full field metadata for a given internal field name.
getFieldDefaultValue(fieldInternalname) => anyGets the default value for a specified field.
getListItemFromFormState<T>() => Promise<T>Converts the form state into a SharePoint-compatible list item object. Useful before saving to the list.
getText(text) => stringRetrieves a localized or resource string if available.
initializedbooleanIndicates if the form is fully initialized (fields loaded, etc.)
isNewFormbooleanTrue if the current form is for creating a new list item
itemIdnumberThe ID of the current list item
listIListInfoMetadata for the SharePoint list
listItemanyRaw SharePoint list item data
readonlybooleanIndicates if the form is in read-only mode
saveListItem(listItem, forceOverride?, folderPath?) => Promise<IListItem>Persists the list item to SharePoint.
spSPFIPnP.js SPFI instance scoped to the list/web
validationIFormValidationField-level validation state
webPartContextWebPartContextThe SPFx web part context, typically passed from the host component