Search code examples
grailsgsp

GSP select from multiple lists


Given two similar domains Foo and Bar, is it possible to create a g:select tag that can choose from both of them? E.g.,

<g:select from="${[Foo.list(), Bar.list()]}"/>

That, unfortunately, does not work. It creates a single option that is the text of all items from both domains :|

So, does anybody know if this can be done?

Edit

Nope, it doesn't make any difference to pass this list in from the controller.


Solution

  • <g:select from="${Foo.list() + Bar.list()}"/>
    

    would also do just fine