Bug #31939

preselection with a multiple form.select with a M:N relation

Added by Matthias Habegger almost 10 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Must have
Assignee:
-
Category:
ViewHelpers
Target version:
-
Start date:
2011-11-19
Due date:
% Done:

100%

Estimated time:
Has patch:
No

Description

I have a M:N relation between my two model "book" and "category".

Now I try to create a multiple select with the SelectViewHelper like that:

<f:form.select property="categories" options="{categories}" optionLabelField="name" multiple="multiple" size="7" />

{categories} is a variable assigned in the controller.
that works fine, all, categories are shown in the select.

The problem is, that none of my preselected categories are selected.

The html output looks like that:

<input type="hidden" name="book[categories]" value="" />
<select id="categories" multiple="multiple" size="7" name="book[categories][]">
<option value="0bc305ec-8aff-4fa8-bdeb-476d7c21c841">Novels</option>
<option value="8c2221e3-a3fd-4ce2-8f7e-66aac9eed5f5">Second Category</option>
<option value="c1ca0c2d-08c4-4b22-b9c7-69bbd42de840">Third category</option>
</select>

I analized the problem and it seems, that the method "getSelectedValue" in the "SelectViewHelper" can't handle multiple preselects.

I think the problem is also in the blog-tutorial when you try to edit post which already has related posts, they are not selected.


Related issues

Is duplicate of TYPO3.Fluid - Bug #29395: SelectViewHelper with multiple=true cannot work with CollectionsResolved2011-08-31

Actions
#1

Updated by Matthias Habegger almost 10 years ago

  • % Done changed from 0 to 100

Problem solved with 1.0.1

#2

Updated by Johannes K over 9 years ago

Duplicate of #29395
Can anybody close this?

#3

Updated by Karsten Dambekalns over 8 years ago

  • Status changed from New to Resolved

Also available in: Atom PDF