2015-09-09 25 views
1

我收到以下錯誤,當我把在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; 
    } 
} 
+0

''[org.omnifaces.exceptionhandler.FullAjaxExceptionHandler]'看起來像OmniFaces,而不是PrimeFaces。 – Geinmachi

+0

爲什麼使用OmniFaces的PrimeFaces和'converter'? – Geinmachi

+0

我懷疑它是用這種方式。 – Kukeltje

回答

2

領料一般不旨在包含輸入 '控制'。所以p:pickList從來沒有被設計成包含輸入如h\p:selectonemenu甚至純h\p:inputTexts。所以它不會像你期望的那樣工作,那只是不幸的。重新設計你的用戶界面是唯一要做的事情。

+0

我已經改變了pickList dataTable –

+1

'接受'答案'有效'是向其他人發出信號的方式,即(最接近的)正確答案,即使這不是您希望的解決方案 – Kukeltje

相關問題