From ed1a9844377ef153cbe0703d9bf9a27b80816a29 Mon Sep 17 00:00:00 2001 From: OluwatobiAwe <114475132+OluwatobiAwe@users.noreply.github.com> Date: Wed, 30 Aug 2023 16:25:33 +0100 Subject: [PATCH 1/2] Update README.md TD-2410: Updated ReadMe description with generic form data handling snippets --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 325edbe..87c87a0 100644 --- a/README.md +++ b/README.md @@ -194,3 +194,29 @@ The POST method for the summary page, triggered by submitting, should: return RedirectToAction("Confirmation"); } ``` +### Use of personalized feature names +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. + +We can utilize 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. + +#### For example +``` + +//1. Invoke the multi-page form service, passing it the model for the data being captured: + multiPageFormService.SetMultiPageFormData( + new AddNewCentreCourseTempData(), + MultiPageFormDataFeature.AddCustomWebForm("NewCourseCWF"), + TempData + ); + + +//2. Use the multipage form service to retrieve transactional data: + var data = multiPageFormService.GetMultiPageFormData( + MultiPageFormDataFeature.AddCustomWebForm("NewCourseCWF"), + TempData + ); + +//3. Use the multipage form service to remove the transactional data: + multiPageFormService.ClearMultiPageFormData(MultiPageFormDataFeature.AddCustomWebForm("NewCourseCWF"), TempData); + +``` From bb73d00633ef167888427e4c2ecd4a2dad7288d0 Mon Sep 17 00:00:00 2001 From: kevwhitt-hee Date: Wed, 30 Aug 2023 16:51:18 +0100 Subject: [PATCH 2/2] Update README.md - tiny wording tweaks --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 87c87a0..292486e 100644 --- a/README.md +++ b/README.md @@ -194,10 +194,10 @@ The POST method for the summary page, triggered by submitting, should: return RedirectToAction("Confirmation"); } ``` -### Use of personalized feature names +### Use of generic feature names 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. -We can utilize 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. +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. #### For example ```