0
如何從ListView中獲取選定的項目形式DropDownChoice?Wicket - 使用Scala獲取DropDownChoice中的選定項目
我實現了矮胖代碼波紋管:
val listCustomer: java.util.List[Customer] = customerDAO.listCustomers
item.add(new DropDownChoice("customerSelection", listCustomer, new ChoiceRenderer[Customer]("name")))
在這種情況下,我想要得到的模型需求的顯示名稱屬性。
感謝
非常感謝@Alexey,我改變了代碼爲這個新DropDownChoice [客戶](( 「customerSelection」,新PropertyModel(客戶, 「名」) ...等等,我得到的錯誤java.lang.ClassCastException:java.lang.String不能轉換爲com.sys.entities.Customer你能告訴我我做錯了什麼? – Bera 2013-05-09 03:18:56