Can we add radio button to a cell in each row of a table( all rows in last column for example)… All the radio buttons should be under one option group. So only one row’s radio button can be selected. I have tried creating option group, but all the radio buttons in the option group stick together. I could not distribute each radio button to each row…
If the option group doesn’t work, i try to use a “non-best” method. Put the radio buttons separetly (not in option group), only one radio would be selected, the others don’t, every each radio button would has a valueChangeListener and when one’s selected, then i go through the radios (previously i would stored them in a list or in an array or in something) and change them values properly (cause only one can selected).
By the way how do you adding the items into the table? Do u have a container or using addItem() method? How many items/rows do you have in the table? If you’re dealing with many items, my advise is not good (and it’s kind of a “patchwork” anyway). Sorry, but i have never used option group…
The
FlexibleOptionGroup add-on is what you need. It’s an OptionGroup that allows to position radion buttons freely. From the
source codes of a demo application you can find an example how to use it with Table.
I have tried implementing the FOG in table cells… i see this error…
Widgetset does not contain implementation for org.vaadin.hene.flexibleoptiongroup.FlexibleOptionGroupItemComponent. Check its @ClientWidget mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions. Unrendered UIDL:
You have to recompile your widgetset. You can do that with Vaadin Eclipse plugin, Maven or with an Ant script. For more information, search from the forums or take a look at
here .
I am using Flexible Option Group where I am able to add the radio buttons to all the rows of one column of a table. But I have a requirement where I need to add the radio buttons to some of the columns of a row. I am not able to figure out how it is done and whether it is possible using FOG. Attaching the screen shot. As per my requirement, from the screen shot, the radio buttons in C2,C3 and C4 of R1 should be in the same FOG. Similarly, for R2 and R3. Please suggest.