Vaadin

Join Vaadin Log In
Combination View Flat View Tree View
Threads [ Previous | Next ]
How to use Radio Buttons in multilang environment?
toggle
I am trying to set some data property to radio button so that I can decide which button was selected according to data property.
But when I try this:

paymentChoices = new OptionGroup(paymentCaption);
String paymentCredit = Messages.getString("ChoosePaymentPane.payment_credit");
Item paymentItem = paymentChoices.addItem(paymentCredit);
paymentItem.addItemProperty("payment_type", new ObjectProperty("billing"));

I get exception from IndexedContainer$IndexedContainerItem.
What is correct way to do this?
Flag Flag
Re:How to use Radio Buttons in multilang environment?
11/13/08 5:54 AM as a reply to timot .
Hi,

Add the property to the Container (in this case to the OptionGroup itself), for instance:
1paymentChoices.addContainerProperty("payment_type", String.class, null);

The set the item's property, e.g:
1paymentItem.getItemProperty("payment_type").setValue("billing");


In this case the default Container for OptionGroup (IndexedContainer) creates the Items and adds Properties; this is usually the case because all Items in a Container must have the same Properties.

Hope this helps!

Best Regards,
Marc
Flag Flag
Re:How to use Radio Buttons in multilang environment?
11/13/08 10:41 AM as a reply to timot .
Thank you very much!

This solved my problem.

Timo
Flag Flag