Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Option Group in Form Issue solved

Aatif Hasan
1 decade ago Apr 11, 2012 7:21am
Aatif Hasan
1 decade ago Apr 11, 2012 7:29am
Aatif Hasan
1 decade ago Apr 12, 2012 10:09am


After banging my head with Form and OptionGroup, I got the solution.. :) There may be some better solution but the trick which worked for me is - adding custom fields into the Form. Avoid using setItemDataSource() and create your own fields with addField().
Here is the code -

itemCode.setValue(item.getItemProperty("itemCode").toString()); //Create text field.
itemQty.setValue(item.getItemProperty("itemQuantity").toString()); //Create text field.

String str = item.getItemProperty("visibilityStatus").toString();
if (str.equals("0"))

editorForm=new Form();
editorForm.addField("Item Code", itemCode);
editorForm.addField("Item Quantity", itemQty);
editorForm.addField("Visibility Status", group); //Create option group.

z sayari
1 decade ago Jul 03, 2012 5:39am

Thank you very much ,, it worked !!!!

Last updated on Jul, 3rd 2012