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>
package org.primefaces.showcase.view.input;
import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Named;
import java.util.List;
import io.quarkus.runtime.annotations.RegisterForReflection;
@Named
@RequestScoped
@RegisterForReflection(serialization = true)
public class SelectManyButtonView {
private List<String> selectedOptions;
public List<String> getSelectedOptions() {
return selectedOptions;
}
public void setSelectedOptions(List<String> selectedOptions) {
this.selectedOptions = selectedOptions;
}
}