如何从ListView中的DropDownChoice中获取所选项?
我实现了下面的粗略代码:
val listCustomer: java.util.List[Customer] = customerDAO.listCustomers
item.add(new DropDownChoice("customerSelection", listCustomer, new ChoiceRenderer[Customer]("name")))
在这种情况下,我想获取模型Customer的名称属性。
由于
答案 0 :(得分:1)
试试这个:
new DropDownChoice[Customer](("customerSelection", new Model[Customer], listCustomer, new ChoiceRenderer[Customer]("name"))) {
protected override def wantOnSelectionChangedNotifications: Boolean = true
protected override def onSelectionChanged(newSelection: Customer) {
super.onSelectionChanged(newSelection)
}
}