I would try to change your code as follows:

new DropDownChoice*[Customer]*("customerSelection", new
PropertyModel[Customer](customer, "name"), listCustomer, new
ChoiceRenderer[Customer]("name", *"id"*))

your code seems to not in JAVA



On Fri, May 10, 2013 at 9:13 AM, Bruno Moura <brunormo...@gmail.com> wrote:

> Errata:
>
> the original message and code is:
>
> WicketMessage: Method onSelectionChanged of interface
> org.apache.wicket.markup.html.form.IOnChangeListener targeted at component
> [MarkupContainer [Component id = customerSelection]] threw an exception
>
> Root cause:
>
> java.lang.ClassCastException: java.lang.String cannot be cast to
> com.prog.entities.Customer
>
> The code that I have implemented is showed bellow
>
> item.add(new DropDownChoice("customerSelection", new
> PropertyModel[Customer](customer, "name"), listCustomer, new
> ChoiceRenderer[Customer]("name")) {
>         protected override def wantOnSelectionChangedNotifications: Boolean
> = true
>
>         protected override def onSelectionChanged(newSelection: Customer) {
>           super.onSelectionChanged(newSelection)
>   }
> })
>
> Thanks
>
> Bruno Moura
>
>
> 2013/5/9 Bruno Moura <brunormo...@gmail.com>
>
> >
> > I implemented a dropbox in a ListView, now when I choose a value the erro
> > bellow always happen:
> >
> > WicketMessage: Method onSelectionChanged of interface
> > org.apache.wicket.markup.html.form.IOnChangeListener targeted at
> component
> > [MarkupContainer [Component id = customerSelection]] threw an exception
> >
> > Root cause:
> >
> > java.lang.ClassCastException: java.lang.String cannot be cast to
> > com.prog.entities.Cliente
> > The code that I have implemented is showed bellow:
> >
> > item.add(new DropDownChoice("clienteSelection", new
> > PropertyModel[Customer](customer, "name"), listCustomer, new
> > ChoiceRenderer[Customer]("name")) {
> >         protected override def wantOnSelectionChangedNotifications:
> > Boolean = true
> >
> >         protected override def onSelectionChanged(newSelection:
> Customer) {
> >           super.onSelectionChanged(newSelection)
> >   }
> > })
> >
> > I'll appreciate your help.
> >
> > Bera
> >
>



-- 
WBR
Maxim aka solomax

Reply via email to