简体   繁体   中英

using <g:select> grails

I am using a to display list of profilenames.

<g:select name="ProfileSelector" from='${ProfileList?.profileName}' id='ProfileSelect' noSelection="['null':' SELECT VT']" disabled="true" />

So profile list is type of profiles having profilename,profileid,profileDescription. On submit I was only able to access the profileName selected as param in the controller.Is there any way that I could pass the profileId of corresponding profileName as param.

Yes, by using the optionKey and optionValue parameters. Have a look at http://grails.org/doc/2.0.x/ref/Tags/select.html for more info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM