简体   繁体   English

Primefaces:selectionMode多个/设置复选框的值

[英]Primefaces: selectionMode multiple/ set Value of Checkbox

I´ve implemented a datatable in JSF with a column with a attribute selectionMode="multiple". 我已经在JSF中实现了一个数据表,其中的列具有属性selectionMode =“ multiple”。 Everything is working so far. 到目前为止,一切正常。

Is there a way to manipulate the value of the checkbox? 有没有办法操纵复选框的值? I want to set the checkbox on the first load to checked or to unchecked, depending on a specific value. 我想将第一次加载时的复选框设置为选中或未选中,具体取决于特定值。 The function i have implemented (in java) returns already true or false, but i need to set the checkboxValue to that value. 我已经实现的功能(在Java中)已经返回true或false,但是我需要将checkboxValue设置为该值。 What do i have to do to ? 我该怎么办?

You can manipulate the checkbox value through the value attribute like for any other component. 您可以像其他任何组件一样,通过value属性来操纵复选框的值。 See the DataTable demo with multiple selection: 参见具有多个选择的DataTable演示:

DataTable - RadioCheckbox 数据表-RadioCheckbox

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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