timot
(timot )
November 12, 2008, 12:56pm
1
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?
Marc
(Marc Englund)
November 13, 2008, 6:54am
2
Hi,
Add the property to the Container (in this case to the OptionGroup itself), for instance:
paymentChoices.addContainerProperty("payment_type", String.class, null);
The set the item’s property, e.g:
paymentItem.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