Toggle menu

Wizard Buttons - Repeating Pages

The Wizard Buttons - Repeating Pages field provides a set of buttons for interacting with repeating pages. There's a full description of the default behaviour in the Repeating Pages - Controls and Navigation article.

The field is aware of the current state of the page it is placed on, and only displays the relevant buttons:

  • Add - Hidden when editing or removing an existing page instance, or when the maximum page instances has been reached. Pressing add creates a new instance and navigates to it
  • Remove - Only shown on page instances that have already been submitted, hidden when editing or confirming the removal of a page. Pressing remove takes you to the read-only remove mode which displays the confirm button
  • Cancel - Shown if the data in a new page instance hasn't yet been submitted and when editing or removing an existing page instance. Pressing it cancels the current action and returns the user to the previous page instance
  • Update - Shown when viewing a page instance that has already been submitted. Pressing it loads the instance data into the page fields to be edited
  • Confirm - Only shown when removing a page instance. Pressing it removes the instance and navigates back to the previous navigable page instance

Properties

LabelDescriptionType Name
Button TypeEither "Normal" or "Contrast". Selecting contrast adds the class "btn--contrast", which can then be targeted by the site's style sheetBUTTONTYPE
Is iCM Panel ButtonIf set to true and the form is being used via a Form App shortcut within iCM, the button will be rendered as an action within the Actions Panel. The button itself will be hidden on the form. This allows better integration into iCM when neededISICMPANELBUTTON
Add LabelThe label for the add instance buttonADDLABEL
Add FunctionAdds a new page instance and navigates to itADDFUNCTION
Update LabelThe label for the update buttonUPDATELABEL
Update FunctionSaves the updated page instance data and determines which page should be displayed next. By default, the previous page will be displayedUPDATEFUNCTION
Remove Confirmation LabelThe label for the button that takes you to the page in remove modeREMOVECONFIRMLABEL
Remove Confirmation FunctionDisplays the current page instance in remove modeREMOVECONFIRMFUNCTION
Remove LabelThe label for the remove buttonREMOVELABEL
Remove FunctionRemoves the data for the page instance and determines which page should be displayed nextREMOVEFUNCTION
Cancel LabelThe label for the cancel buttonCANCELLABEL
Cancel FunctionCancels the current action and determines which page should be displayed next. By default, the previous page will be displayedCANCELFUNCTION
Override FunctionThis optional function provides direct control over the buttons displayed by the wizard field type. The function is evaluated server-side when the form HTML is being built. The following actions are available:
  • "ADD"
  • "UPDATE"
  • "REMOVECONFIRM"
  • "REMOVE"
  • "CANCEL"
OVERRIDEFUNC
Additional Styling ModifierAn optional CSS modifier for the field. See Common Field Properties for an exampleADDITIONALSTYLINGMODIFIER
DocumentationAdd documentation to your field to help explain any complex functionality to future users. You might include information on what the field does and how it relates to other fields on the form. Notes added here are only ever visible in the Forms Designer, they can be searched for, viewed and downloaded from the action panel. See Common Field Properties for an exampleDOCUMENTATION

Button Functions

If you write your own button functions, you'll need to be familiar with the following. The Page Modes article has some examples.

Form functions:

Function signatures:

  • sessionData - The current session data
  • defaultPage - The page that would be navigated to if this function wasn't present. That is:
    • Add - The current page
    • Update - The page before this instance was loaded
    • Remove confirmation - The current page
    • Remove - The page before this instance was loaded
    • Cancel - The page before this instance was loaded
  • defaultPageInstance - The page instance that would be navigated to if this function wasn't present. That is:
    • Add - The new page instance
    • Update - The instance before this instance was loaded
    • Remove confirmation - The current instance in "remove" mode
    • Remove - The previous navigable instance. If the final saved instance is being removed, this will be instance 0
    • Cancel - The instance before this instance was loaded

Remove Function and Minimum Instances

The default behaviour when removing a page instance is to redirect you back to the page you came from once the instance has been deleted. This will often be the repeating page itself, but a user could navigate back to a repeating page to edit an instance from elsewhere on your form.

For example, if page 1 of your form repeats, and on page 4 of your form you display a "check your answers" summary page that lets a user go back and remove an instance of page 1, once the instance has been deleted, they'll be redirected back to the summary page.

However, if you are validating a minimum number of instances for a repeating page, and removing an instance drops the count of instances below that minimum, removing an instance will reload the repeating page again, until the minimum number of instances have been created.

Last modified on May 13, 2024

Share this page

Facebook icon Twitter icon email icon

Print

print icon