How to correctly use tag select
in gsp while passing to it ArrayList<String>
? I know how to use it this my own composed objects, for example:
<g:select name="tablePlacesAvailable" from="${tableInfo}" optionValue="${{it.placesInTableAmount}}" optionKey="placesInTableAmount" value=""/>
But how to use it with built in
objects, like String
?
If you want to use a g:select
with a list of String
<g:select name="selection" from="${values}" />
Where values
is a collection of Strings. My controller code is
class DemoController {
def index() {
[values: ["This", "is", "a", "test"]]
}
}