The checked values clear when the page is refreshed. in h:selectManyCheckbox

530 views Asked by At

I have a problem on using h:selectManyCheckbox. The checked values clear when the page is refreshed.
I have used JSF 1.2

<h:selectManyCheckbox value="${dmsParticipantsForm.filterCompany}" style="text-align: left" class="companySelector" layout="pageDirection" > <f:selectItems value="${dmsActionForm.companies}" /> </h:selectManyCheckbox>

1

There are 1 answers

0
zorg On

Do you store selected values somewhere (for example in session)? If so, you load selected values..

...

private List<Item> selectedItems = new ArrayList<>(); // getter-setter

@PostConstruct
public void prepare() {
    getSelectedItems().addAll(getSessionBeanOrOtherResource().getSelectedOrStoredValues());
}