I have a editable datatable, containing column "Datatype". When editing this column, a selectOneMenu is used to select a value "String", "Number" or "Date". When I enter the edit mode, the "Datatype" column is set to "String" (the first item of data type list), but I would like it to be the current value of this column (like in Primefaces showcase: Click - for example if I click on a first row and third column of the second table, 'Fiat' should be selected and not the first item from selectOneMenu - 'BMW' -like in my case).
What could be the problem with my code?
xhtml:
<p:column headerText="Type" >
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{item.dataType.code}" />
</f:facet>
<f:facet name="input">
<p:selectOneMenu value="#{item.dataType}" converter="myConverter" >
<f:selectItems value="#{backingBean.dataTypeList}" var="dt" itemLabel="#{dt.code}" itemValue="#{dt}" />
</p:selectOneMenu>
</f:facet>
</p:cellEditor>
</p:column>
DataType class:
public class DataType implements Serializable {
private BigDecimal id;
private String code;
private String descr;
// Getters+Setters.
}
Using Primefaces 5.1.
I'm available for any additional information needed.