[TYPO3-mvc] How to use partial validation for a multi-step form

Tim Schoch | GSTALTIG tim.schoch at gstaltig.ch
Fri Nov 18 12:18:43 CET 2011


Hi André

I'm currently working on a configurator that spans several steps. I use a domain model to store the data and need to validate only a subset of properties each step. For this I use a mix between the tutorial you mentioned and an own Validator:

/**
 * displays the form
 * @param Tx_Ext_domain_Model_Configuration $configuration
 * @dontvalidate $configuration
 */
showStepFooAction ( Tx_Ext_domain_Model_Configuration $configuration ) {}

/**
 * validates the previous form inputs
 * @param Tx_Ext_domain_Model_Configuration $configuration
   * @dontvalidate $configuration
 * @validate $configuration Tx_Ext_Domain_Validation_ConfigurationValidator( step=foo )
 */
saveStepFooAction( Tx_Ext_domain_Model_Configuration $configuration ) {}

Inside the validator I have a method for each step and call it from within the isValid function.
Though my solution yet won't work fully the validation itself works fine. Atm I struggle with passing the
half filled domain object to the next step.

Tim


More information about the TYPO3-project-typo3v4mvc mailing list