The Primefaces p:selectOneMenu
component does not seem to bring focus to a previously selected item. For example, if I have a menu of countries set up as follows
<p:selectOneMenu id="countryMenu" value="#{myBean.selectedCountry}">
<f:selectItem value="#{null}" itemLabel="Please select a Country..."/>
<f:selectItems value="#{myBean.countries}" var="country"
itemValue="#{country.code}"
itemLabel="#{country.name}"/>
<p:ajax update="anotherComponent"/>
</p:selectOneMenu>
and I select a country from the list, then click on the menu again it displays the list of countries from the beginning. It does retain the selected country - it just doesn't scroll down and focus on it.
The standard JSF h:selectOneMenu
displays the expected behaviour - it opens with the previously selected country visible.
Is there some trick to this or is this a bug?
It also has a number of other quirks with how it responds to keyboard input (pressing up/down when the menu has focus doesn't open the menu, for example), which is a little frustrating.
I'm using:
- Primefaces 3.1
- Glassfish 3.1.1
- NetBeans 7.1