Hi,

On Wed, May 15, 2013 at 6:32 AM, Bruno Moura <brunormo...@gmail.com> wrote:

> Hi
>
> For some weeks I'm trying to implement a simple combobox, DDC, and I'm
> struggling with this. I asked  for some help several times but
> unfortunately I didn't archive my goal because I'm failing sometimes to
> understand  scala with wicket, I have a little background with them at the
> moment.
>
> Anyway,  my code is showed bellow:
>
> *// ComboBox in a listView
> item.add(new DropDownChoice("customerSelection", new
> PropertyModel[Customer](customer, "name"), listCustomer, new
> ChoiceRenderer[Customer]("name"))*
>
>
DropDownChoice[Customer]


>
> If I create a variable, for example,* val custName*,  to receive the name
> of the selected customer which functions I need to implement on the
> creation of DDC object and how can I retrieve this value for the variable?
>

The way you already did it will set the selected value in customer's name.
Check PropertyModel's javadoc to understand how it works.

If you want to read/write the value in 'custName' then you have to use: new
PropertyModel[String](this, "custName")


> Thanks very much for help me.
>



-- 
Martin Grigorov
Wicket Training & Consulting
http://jWeekend.com <http://jweekend.com/>

Reply via email to