Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //radio.gsp
- <g:radio name="myRadio" value="1" checked="${myModel.checked}" />
- //action radio
- def radio(){
- //[myModel: [checked: params.check]] //approach 1 (wrong way)
- [myModel: [checked: params.check?.toBoolean()]] //approach 2 (correct way)
- }
- //url
- http://localhost:8080/MyApp/my/radio?check=true --> approach 1: radio checked -- approach 2: radio checked
- http://localhost:8080/MyApp/my/radio?check=false --> approach 1: radio checked -- approach 2: radio unchecked
- http://localhost:8080/MyApp/my/radio --> approach 1: radio unchecked -- approach 2: radio unchecked
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement