Divide a big form into sections presented one step at a time with validation. SAIL Wizards should be used to break up a large form into smaller steps rather than activity-chaining. Users can step back and forth within a SAIL wizard without losing data in between steps.
All the fields must be valid before the user is allowed to move to the next steps. However, the user is allowed to move to a previous step even if the fields in the current step aren't valid. The last step in the wizard is a confirmation screen.
This design pattern is not recommended for offline interfaces because reflecting immediate changes in an interface based on user interaction requires a connection to the server.
This scenario demonstrates:
How to create a wizard using the showWhen parameter of a SAIL component
How to conditionally set readOnly and required on a SAIL component
How to show and change the style of buttons
Test it out
Click Next without entering a value in any of the fields. The user will stay on step 1 until all fields are entered.
Enter values for all the field. Click Next. Notice part two of the form will appear.
Click Go Back. Notice that you can go back to part 1.
Enter values for all required fields in step 2. Click Go to Review. Notice that all values entered will appear as a set of read only data.
Notable implementation details
The showWhen parameter is used extensively to conditionally show particular fields as well as set requiredness & read only setting.
Each "Next" button is configured to increment local!currentStep. Validate is set to true, which ensures all fields are required before continuing on to the next step.
Each "Go Back" button is not configured to enforce validation. This allows the user to go to a previous step even if the current step has null required fields and other invalid fields. This button also decrements local!currentStep by one.