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

Claus Due claus at wildside.dk
Thu Sep 6 15:36:54 CEST 2012


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

[1]  tttp://git.typo3.org/TYPO3v4/Extensions/fed.git?a=blob;f=Classes/ViewHelpers/Form/SelectViewHelper.php;h=84b75738d31475412c88b8dc1b981126814e2359;hb=HEAD

On Sep 6, 2012, at 3:22 PM, Stefano Cecere <scecere at krur.com> wrote:

> i'm dealing with this problem (TYPO3 4.7.4):
> 
> Fluid form, editing an object with mm relation:
> 
> <fed:form.select id="products" property="myproducts" multiple="true" options="{productslist}" />
> 
> the multiple select form gets rendered well (from the objects list {productslist} ), but it doesn pre select the actual values (they are in the property myproducts )
> 
> does anybody has a _working_ mm fluid form anywhere?
> i could't find one :(
> 
> thank you
> 
> stefano
> 
> 
> 
> 
> On 02/05/11 12:38, Armin Rüdiger Vieweg wrote:
>> Hi all,
>> 
>> I've got a question about the <f:form.select /> viewhelper:
>> How can I make multiple values selected?
>> 
>> I've got such a select box:
>> <f:form.select property="entries" multiple="1" options="{entrylist}"
>> optionLabelField="name" />
>> 
>> 'entrylist' is a variable, which I've assigned in the controller.
>> Now I want that some items of the 'entrylist' are selected. I've tried
>> to set a value like this:
>> value="{1,6}" (which means, that the options with the value 1 and 6
>> should be active)
>> but this has no effect (no errors, but no selected items too).
>> 
>> What am I doing wrong? Any ideas?
>> 
>> Thanks in advance!
>> 
>> Best regards
>> Armin
> 
> 
> -- 
> 
> -- --- ----- -------
> 
> Stefano Cecere
> KRUR studio - http://krur.com
> _______________________________________________
> 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