I have two domain models:
class Resource{
String name
static mapping = {
sort name:"asc"
}
}
class ResourceGroup{
String groupName
static hasMany = [resources: Resource]
}
controller:
def resGroups = ResourceGroup.findAll()
render (
view: "index",
model: [resourcegroups: resGroups]
)
so and now in my gsp:
<g:each in="${resourcegroups}" var="item" status="i">
...
<g:each in="${item.resources}" var="res" status="y">
<!-- THESE ITEM.RESOURCES ARE UNSORTED! -->
</g:each>
...
</g:each>
my Question is how can I sort this "item.resources"? this is a persistent set of hibernate! I thought this could be handled with the mapping sort name: 'asc', but it doesn't work :-(