Skip to content

Commit a799a18

Browse files
authored
Merge pull request #11 from TechnologyEnhancedLearning/Develop/Fixes/TD-2410
TD-2410 Update documentation for the GDS multipage-form service package
2 parents 48161eb + bb73d00 commit a799a18

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,29 @@ The POST method for the summary page, triggered by submitting, should:
194194
return RedirectToAction("Confirmation");
195195
}
196196
```
197+
### Use of generic feature names
198+
The preceding code samples all rely on predefined names like MultiPageFormDataFeature.AddNewCourse and MultiPageFormDataFeature.AddRegistrationPrompt. In scenarios demanding the use of names not available within the MultiPageFormDataFeature class, we have the option to employ a function instead of the pre-existing names.
199+
200+
We can utilise MultiPageFormDataFeature.AddCustomWebForm("NewCourseCWF") in place of MultiPageFormDataFeature.AddNewCourse. However, It's important to note that any custom feature name must end with `CWF`; failure to do so will result in an exception being thrown.
201+
202+
#### For example
203+
```
204+
205+
//1. Invoke the multi-page form service, passing it the model for the data being captured:
206+
multiPageFormService.SetMultiPageFormData(
207+
new AddNewCentreCourseTempData(),
208+
MultiPageFormDataFeature.AddCustomWebForm("NewCourseCWF"),
209+
TempData
210+
);
211+
212+
213+
//2. Use the multipage form service to retrieve transactional data:
214+
var data = multiPageFormService.GetMultiPageFormData<AddNewCentreCourseTempData>(
215+
MultiPageFormDataFeature.AddCustomWebForm("NewCourseCWF"),
216+
TempData
217+
);
218+
219+
//3. Use the multipage form service to remove the transactional data:
220+
multiPageFormService.ClearMultiPageFormData(MultiPageFormDataFeature.AddCustomWebForm("NewCourseCWF"), TempData);
221+
222+
```

0 commit comments

Comments
 (0)