[Flow] How to build One-To-Many Forms
Axel Wüstemann
awu at qbus.de
Mon Nov 4 13:10:41 CET 2013
Am 03.11.2013 23:52, schrieb mario chiari:
>> In order to biuld the new form, in the constructor of the
>> >depositInspection I create an empty deposit and call five times
>> >$this->addDeposit($emptyDeposit);
> I do not think you need that.
This is for the initally empty deposits in the new form. There I need 5
empty rows for deposits. By an extra submit button I need to decrease or
increase the amount of rows.
> How do you defineyour createAction?
> For a form to create a inspection (father) and its five (or any N)
> deposits (sons), you may need to initialize the
> deposit_inspection/createAction by something like:
>
> public function initializeCreateAction()
> { $this->arguments['newInspection']->getPropertyMappingConfiguration()->forProperty('deposits.*')->allowAllProperties()->setTypeConverterOption(
> 'TYPO3\Flow\Property\TypeConverter\PersistentObjectConverter',
> \TYPO3\Flow\Property\TypeConverter
> \PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED,TRUE); }
>
> Then you should be able to create everything by just
> $this->inspectionRepository->add($inspection);
Thank you, I wil try it.
More information about the Flow
mailing list