[MGNLFORM-123] Selection Checkbox, select (single/multiple) and radio buttons don't allow multiple selection Created: 13/Mar/12 Updated: 09/Oct/12 Resolved: 24/Jul/12 |
|
| Status: | Closed |
| Project: | Magnolia Form Module |
| Component/s: | None |
| Affects Version/s: | 1.4.1 |
| Fix Version/s: | 1.4.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Eric Hechinger | Assignee: | Milan Divilek |
| Resolution: | Fixed | Votes: | 3 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
4.5.1 EE |
||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Template: |
|
||||||||||||||||
| Patch included: |
Yes
|
||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||||||||||
| Date of First Response: | |||||||||||||||||
| Description |
|
Not able to define multiple select with the recomended syntax: Just display the first entry. |
| Comments |
| Comment by Antti Hietala [ 20/Apr/12 ] |
|
The issue happens when the label-values pairs entered by the user are split into a list. The component script splits them at the line feed + carriage return (CR+LF, \r\n) character sequence: [#list content.labels?split("\r\n") as label]
This doesn't work. If you separate the label-value pairs with pretty much any other character (try "MOO") and split them at that char in the script, it works. |
| Comment by Marvin Kerkhoff [ 21/May/12 ] |
|
Why not use | instead of \r\n ? Please use another splitter as \r\n. |
| Comment by Christian Ringele [ 21/May/12 ] |
|
Even with no splitter it doesn't work. |
| Comment by Marvin Kerkhoff [ 22/May/12 ] |
|
Here is the right template for that (formSelection.ftl). I also add the possibility to add optgroups in a select element. Like in this Case: Main Countries {Schweiz:Schweiz|Deutschland:Deutschland|Österreich:Österreich}Other Countries {Afghanistan:Afghanistan|Ägypten:Ägypten|Albanien:Albanien|} |
| Comment by Samuel Schmitt [ 12/Jul/12 ] |
|
A better solution is to decode the content and keep the original script. Just do the list of the labels as following [#list cmsfn.decode(content).labels?split("\r\n") as label]
|
| Comment by Jan Haderka [ 19/Jul/12 ] |
|
Not convinced by the current fix.
so whatever solution we choose should be able to split by all of those terminators not just by one out of 6 possible. FM supports flags for split so you can use .split("regex", rm)
(r for regex and m for multiline matching) and construct regex that would match all of those separators. |