[TYPO3-mvc] Fluid: form.select view helper and empty default item

my.maylz at web.de my.maylz at web.de
Tue Apr 20 09:16:12 CEST 2010


Hi,

i've had a similar Problem - when merging the resulting array of the the 
"findAll" in the repos with the empty option the resulting array was 
reindexed so that the category objects didn't have the right uids 
anymore...

i solved this by putting the empty option inside the repos function

greetINGs
David

Am 20.04.2010 08:49, schrieb Henrik Møller Rasmussen:
>>> You can try something like:
>>>
>>> $tempCategory = new Tx_MyExtname_Domain_Model_Category();
>>> $tempCategory->setCategorieName('---');
>>>
>> $this->view->assign('categories', array_merge(array(0 => 'All
>> Categories'), $this->categoryRepository->findAll()));
>>
>
>
> I tried this and has successfully rendered a --- option in the select
> field. But when I select the --- option, the setCategory() is never
> executed - tried a debug(); exit; within setCategory. I was expecting it
> to execute the method with a null object as argument.
>
> No errors is showed, it just doesn't change category on submit.
>
> Any hints?
>
> Thanks!!
>
> - Henrik
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>


More information about the TYPO3-project-typo3v4mvc mailing list