Basic Form Structure
Every UIMF form has three main components:- Request class - Defines input fields that users will fill out
- Response class - Defines output fields that display results
- Form handler - Processes the request and returns a response
Creating Your First Form
Define the Request class
Create a class to hold your form’s input fields:The
IRequest<TResponse> interface comes from MediatR and indicates this is a request that returns a response.Define the Response class
Create a class to hold your form’s output fields:The
FormResponse base class provides standard form response functionality.Add the FormAttribute
The Key properties:
[Form] attribute configures how the form behaves:Id- Unique identifier for the formLabel- Display name shown to usersPostOnLoad- Auto-submit when loaded (useful for reports)PostOnLoadValidation- Validate before auto-submittingCloseOnPostIfModal- Close modal after successful submission
Async Form Handlers
For operations that require async/await, useAsyncForm<TRequest, TResponse>:
Field Validation
Add validation to input fields using theRequired property:
Controlling Field Order
UseOrderIndex to control the order fields appear in the UI:
OrderIndex values appear first.
Hidden Fields
Hide fields from the UI while still using them in your form logic:Complete Example
Here’s a complete working example of a user registration form:Next Steps
Input Components
Learn about different input field types
Output Components
Display data with output components
Event Handlers
Add interactivity with event handlers
Custom Properties
Extend forms with custom metadata