mardi 28 avril 2015

Pass checkbox value to controller from gsp in grails

I've a checkbox in my Grails application:

<g:checkBox name="reservationAvailable" value="${cafeeInfo.isReservationAvailable}"/>

It must be uncheked if isReservationAvailable boolean-value is false and checked if it's true. When I click on unchecked checkbox, it become checked, then I send a form, but in logs of controller I get false checkbox value. When I update view page, checkbox become empty again. Using parsing such as:

oldCafeeInfo.isReservationAvailable = Boolean.parseBoolean(params['reservationAvailable'])

doesn't solve my issue. How to solve it?




Aucun commentaire:

Enregistrer un commentaire