开发者

Grails g:select list with "Yes" value

开发者 https://www.devze.com 2023-03-18 03:39 出处:网络
I have something like this is my view: <g:select name="book" from="${[\'Yes\', \'No\']}"开发者_运维知识库/>

I have something like this is my view:

<g:select name="book" from="${['Yes', 'No']}"开发者_运维知识库/>

How can I do this in the controller:

if(params.book== "Yes"){
            doSomething()
        }

Because that if is always false, and I'm sure its because params.book== "Yes" is a wrong way to do it, thats why it always tells me it's false.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号