I have a form where i have to preselect some checkboxes. How is that possible with jsf/seam? In plain html you would just add the “checked” (or checked=”checked”) as attribute to the checkboxes. But with f:selectItems I have no clue…also the Object “SelectItem” does not provide any setter for this…
Share
You need to preset them in the property behind the component’s
valueattribute as you usually do for everyUIInputcomponent. You can do that in the bean’s constructor or initialization block.Here’s a basic example:
Bean: