简体   繁体   中英

Primefaces: selectionMode multiple/ set Value of Checkbox

I´ve implemented a datatable in JSF with a column with a attribute 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. What do i have to do to ?

You can manipulate the checkbox value through the value attribute like for any other component. See the DataTable demo with multiple selection:

DataTable - RadioCheckbox

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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