我收到以下錯誤,當我把在selectOneMenu用於value="#{customer.customerType}"
屬性的值:如何嵌入輸入組件,如一個selectOneMenu到PickList中?
javax.el.PropertyNotFoundException:目標不可達,標識符「客戶」解析爲空
選擇列表:
<p:pickList id="customersPL" itemLabel="#{customer.id}"
itemValue="#{customer}" responsive="true"
value="#{bean.customersList}" var="customer">
<o:converter converterId="omnifaces.ListConverter"
list="#{bean.customersListSource}" />
<p:ajax event="transfer" listener="#{bean.onTransfer}" />
<p:column>
<h:outputText value="#{customer.name}" />
</p:column>
<p:column>
<p:selectOneMenu converter="omnifaces.SelectItemsConverter"
id="customerType" value="#{customer.customerType}">
<f:selectItems itemLabel="#{customerType.name}"
itemValue="#{customerType}"
value="#{bean.customerTypesList}"
var="customerType" />
</p:selectOneMenu>
</p:column>
</p:pickList>
豆:
private CustomerType[] customerTypesList = CustomerType.values();
CustomerType枚舉:
public static enum CustomerType {
WHOLESALE("W", "Wholesale"), RETAIL("R", "Retail");
private String id;
private String name;
TipoCliente(String id, String name) {
this.id = id;
this.name = name;
}
public String getId() {
return id;
}
public String getName() {
return name;
}
}
''[org.omnifaces.exceptionhandler.FullAjaxExceptionHandler]'看起來像OmniFaces,而不是PrimeFaces。 – Geinmachi
爲什麼使用OmniFaces的PrimeFaces和'converter'? – Geinmachi
我懷疑它是用這種方式。 – Kukeltje