[TYPO3-mvc] Select viewhelper value=0 / removing objects
Stefan Schwan
stefan.schwan at googlemail.com
Fri Aug 17 14:44:42 CEST 2012
Hi!
I want to use the Select viewhelper on TYPO3 4.7 to assign and remove
child objects to an domain object.
Attaching objects works fine, but i can not remove them.
In the parent controller new/edit action i do:
$children = $this->childRepository->findAll()->toArray();
$this->view->assign( 'selectableChildren', array_merge(array(0
=>"None"), $children) );
in the corresponding views i call the Select viewhelper:
<f:form.select options="{selectableChildren}" property="child"
optionLabelField="title" optionValueField="uid">
In the rendered form i can select the child object and the parent object
is saved succesfully. The problem occurs if i set the selectbox to
"None" if an object already has a value assigned. It is not updated to
0, but keeps the old value.
Can the Select viewhelper be used to remove an object?
Thanks,
Stefan
More information about the TYPO3-project-typo3v4mvc
mailing list