[TYPO3-mvc] f:form.select, multiple and selected values

Stefano Cecere scecere at krur.com
Thu Sep 6 16:10:50 CEST 2012


thank you Claus.. i came to the same conclusion (adding optionValueField :)

but your analysis is very helpful!

i've been digging also inside your fed:form.select (comparing its code 
to fluid's )

now i'm facing the problem that if i deselect all the items, extbase 
sees it like a "do nothing" and it doesn't clean all options... :)

hasta pronto!

s


On 06/09/12 15:36, Claus Due wrote:
> Hi Stefano,
>
> Have you tried setting the "value" argument? The type is "mixed" and you may use an array as the value to define the currently selected items if there are more than one selected. If you wish to "cheat" a little you can do this:
>
> value="{fed:data.func(func: 'toArray', instance: fluidObjectVariable.property)}"
>
> Which will transmogrify your ObjectStorage property into an array before passing it along to fed:form.select.
>
> Unfortunately the value argument must (at this time) be an array and not an ObjectStorage/QueryResult or Lazy variants. This can be changed of course, as if would be fairly easy to change the "isSelected($value)" method (located near the bottom of [1]).
>
> Hope this helps!
>
> Cheers,
> Claus

-- 

-- --- ----- -------

Stefano Cecere
KRUR studio - http://krur.com


More information about the TYPO3-project-typo3v4mvc mailing list