The problem was in my bean. To get the selected item, I had to implement a user interface implementation javax.faces.Converter. In my opinion, there is a lot of work for such a simple task (this converter must have access to a data source, etc.). So I did a little trick:
public class CategoryBean{
private list<Category> availableCategories;
private Category selectedCategory;
public Long getCSelectedCategory(){
}
public void setSelectedCategory(Long selectedCategory){
return selectedCategory.getId();
}
}
:
<p:column>
<p:selectOneMenu id="categorySelect" effect="drop"
value="#{categoryBean.selectedCategory}" >
<f:selectItems value="#{categoryBean.availableCategories}"
var="category" itemLabel="#{category.name}"
itemValue="#{category.id}" />
</p:selectOneMenu>
</p:column>
, itemValue , . , , Getter.
, Primefaces - . .
?