RequisitionListForm Container
Provides a form for creating or editing requisition list details including name and description.
Version: 1.0.0-beta4
Configuration
The RequisitionListForm container provides the following configuration options:
| Parameter | Type | Req? | Description |
|---|---|---|---|
mode | RequisitionListFormMode | Yes | Sets the form mode to determine whether to create a new requisition list or update an existing one. Use ‘create’ for new lists and ‘update’ when modifying existing lists. Controls form behavior and validation rules. |
requisitionListUid | string | No | Specifies the unique identifier for the requisition list being updated. Required when mode is ‘update’ to load and modify the existing list data from the backend. |
defaultValues | RequisitionListFormValues | No | Pre-populates form values for the requisition list. Use to prepopulate the form when creating from a template, duplicating an existing list, or restoring previously entered data. |
onSuccess | function | No | Callback function to handle successful form completion. Use to implement custom success handling, navigation, or notifications. |
onError | function | No | Callback function to handle errors when form submission fails. Use to implement custom error handling, logging, or user notifications. |
onCancel | function | Yes | Callback function to handle form cancellation when users cancel the form. Use to implement navigation back to the list view or close modal dialogs. |
Slots
This container does not expose any customizable slots.
Usage
The following example demonstrates how to use the RequisitionListForm container:
import { render as provider } from '@dropins/storefront-requisition-list/render.js';import { RequisitionListForm } from '@dropins/storefront-requisition-list/containers/RequisitionListForm.js';
await provider.render(RequisitionListForm, { mode: mode, onCancel: onCancel, requisitionListUid: "abc-123",})(block);