Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.0-RC1
-
Fix Version/s: None
-
Component/s: TagLib, View technologies
-
Labels:
Description
Given a multi-select element like so:
<g:select name="someName" from="${some.list()}" value="${someOther.list()}" optionKey="id" multiple="true" />
If the user selects only one item from such a select-box, then params.someName holds a single value (let's say '12').
Now, if the user selects more than one item from that list, then params.someName holds a list of values (let's say '[12, 20, 45]' ).
This makes additional boilerplate code necessary in order to cope with both situations. Even if such code is in place, it's still error prone, as the contents of the params-Map are Strings which will cause something like the following to fail:
(params.someName instanceof List) ? params.someName : [ params.someName ]
A better solution would be to always pass a list, even if there was only one value in it. With the above example in mind, the content of params.someName would then be '[12]' in case only one item was selected.
Activity
Burt Beckwith
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Workflow | Grails2 [ 70563 ] | jira [ 71235 ] |
Burt Beckwith
made changes -
| Workflow | jira [ 71235 ] | Grails2 [ 79347 ] |
Peter Ledbrook
made changes -
| Last Reviewed | 01/Jan/10 |
Peter Ledbrook
made changes -
| Workflow | Grails2 [ 79347 ] | jira [ 88958 ] |
Peter Ledbrook
made changes -
| Workflow | jira [ 88958 ] | Grails2 [ 97227 ] |