0

How can I get the selected item form a DropDownChoice inside an ListView?

I implemented the chunky code bellow:

val listCustomer: java.util.List[Customer] = customerDAO.listCustomers

item.add(new DropDownChoice("customerSelection", listCustomer, new ChoiceRenderer[Customer]("name")))

In this case I want to get the name property displayed of the model Customer.

Thanks

4

1 回答 1

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)
  }
}
于 2013-05-06T06:16:41.773 回答