[TYPO3-mvc] validation of dynamically added sub-objects
Joerg Schoppet
joerg at schoppet.de
Wed May 29 07:07:50 CEST 2013
Hi,
TYPO3 CMS 6.1
I have the following model-classes:
Order
- name (string)
- items (ObjectStorage of Item)
Item
- description (string)
- types (ObjectStorage of Type) [implemented with a multi-select field as they are fix]
In the newAction() of the Order I create a new $order-object if it is NULL and create the first item-subobject.
In the new.html view I then display this all and give with the user the possibility to add additional items with a little bit of javascript. Everything is working fine and with the help of the "PropertyManager" in the initializeCreateAction() the dynamic sub-objects are correctly transfered to the createAction() method.
BUT ...
Now I have created an OrderValidator() class to check if the order including the items is valid. In general it is working, I have access to all properties (including the items).
If the validation fails the new.html view is called again, but there the order-object hasn't the modified items-collection but again the new item as created in the newAction.
Where have I missed something?
Joerg
More information about the TYPO3-project-typo3v4mvc
mailing list