SelectManyButton is used to choose multiple items from a list using buttons.
<div class="card">
<h:form>
<p:selectManyButton value="#{selectManyButtonView.selectedOptions}">
<f:selectItem itemLabel="Option 1" itemValue="Option 1"/>
<f:selectItem itemLabel="Option 2" itemValue="Option 2"/>
<f:selectItem itemLabel="Option 3" itemValue="Option 3"/>
</p:selectManyButton>
</h:form>
</div>
@Named
@RequestScoped
public class SelectManyButtonView {
private List<String> selectedOptions;
public List<String> getSelectedOptions() {
return selectedOptions;
}
public void setSelectedOptions(List<String> selectedOptions) {
this.selectedOptions = selectedOptions;
}
}