How do I bind a checkbox to a boolean in Play! framework

前端 未结 3 1523
轮回少年
轮回少年 2021-02-19 19:34

An app I\'m working on using the Play! Framework has an object called gift with a boolean property, called Taken. How do I show the state of this value as a checkbox on my view

3条回答
  •  南旧
    南旧 (楼主)
    2021-02-19 20:14

    You just need to set the checked value against the checkbox, if the value is true.

    for example (assuming the object sent in from the view is called gift, and the boolean value is called Taken.

    
    

提交回复
热议问题