在我的gsp页面上,我有下拉列表。以下代码:
<g:select name="tablePlacesAvailable" from="${tableInfo}"
optionValue="${{it.placesInTableAmount}}"
optionKey="placesInTableAmount" value=""/>
它显示非独特的结果。如何解决?
答案 0 :(得分:1)
您可以按照以下方式修改代码。
<g:select name="tablePlacesAvailable" from="${tableInfo.unique()}" optionValue="${{it.placesInTableAmount}}" optionKey="placesInTableAmount" value=""/>