Default selection for <f:selectItem> within <h:selectOneMenu>
<h:selectOneMenu id="items" value="#{bean.selectedItem}">
<f:selectItem itemLabel="10" itemValue="10"/>
<f:selectItem itemLabel="20" itemValue="20"/>
<f:selectItem itemLabel="30" itemValue="30"/>
</h:selectOneMenu>
The default selection would be the one which has value same as selectedItem
which you set in bean.
selectedItem = 20;
Initialize the recordsPerPage
in your backing bean.
From your source code I assume that you have a bean FileSearchCriteriaOut
and your recordsPerPage
is a String
, then you can do the following in the bean's constructor:
public FileSearchCriteriaOut() {
recordsPerPage = "20";
}
For the facelet refer to Jigar Joshi's answer.