[TYPO3-mvc] Select viewhelper value=0 / removing objects

Henjo Hoeksma me at henjohoeksma.nl
Tue Aug 21 01:38:39 CEST 2012


Hi Stefan,

as far as I know you need to add logic for that in your controller.

Kind regards,

Henjo

Problems are small because we learned how to deal with them.
Problems are big because we need to learn how to deal with them.


On Fri, Aug 17, 2012 at 2:44 PM, Stefan Schwan <stefan.schwan at googlemail.com
> wrote:

> 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
> ______________________________**_________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc@**lists.typo3.org<TYPO3-project-typo3v4mvc at lists.typo3.org>
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/typo3-**
> project-typo3v4mvc<http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc>
>


More information about the TYPO3-project-typo3v4mvc mailing list