In mobile, how can I validate the controls in a WizardItem before advancing?

In mobile, how can I validate the controls in a WizardItem before advancing?

  

In a mobile screen, I have a Form control that is broken up and presented to the user with a Navigation\Wizard control having a few steps.  The user progresses through the wizard and then clicks a save button at the end to save the item.  The Save button has the "Built-in Validations" set to true, and the validations trigger as expected at the end.  Unfortunately, the validation may be failing on any one of the tabs in the wizard.  I would rather validate within each wizard step so the user cannot leave the step without valid inputs, and also avoid having to hunt for invalid input control.

I only see the option for Built-in Validations when using a link control.  The WizardStep control has no such setting.  Can Built-in Validations be triggered?  Is there a Javascript solution?

Hello David,

The "standard" way to work with the wizzard seems to be a little bit different from what you seems to be doing, I think...

You can take a look at the example here: https://www.outsystems.com/forums/discussion/20275/wizard/
Aurélio has there a working example, that uses two buttons to navigate between the steps (as is usual).
Than you can execute validations and avoid moving to other step if there is anything wrong.

Hope this helps.

Cheers,
Eduardo Jauch

Solution

Thank you Eduardo.  It was a bit of work, but I managed to accomplish this with custom logic.  I created a FormValid boolean flag as a page local variable.

Upon saving, the following logic executes, which runs the ValidateForm action:

Upon clicking a wizard step, the following logic executes, which also runs the ValidateForm action:


The following is the ValidateForm action.  It checks all the wizard steps if the ValidateAllSteps is true, such as when coming from the Save action, and makes any step with an invalid input visible.  Otherwise it checks only the current step WizardStepSelected passed in the input variable.

Each wizard step validation checks the controls on that step.  This is one example.

Solution

THANK YOU SO MUCH