I's possible to use a RadioButtonGroup cellrenderer???

I's possible to use a RadioButtonGroup cellrenderer???

Post by cesarrodri » Fri, 13 May 2005 01:43:55



Hello, i'm trying to use a radiobutton in a datagrid and i don't know if this is possible by using a cellrenderer, if someone can help me i'll appreciate it, thanks.

C?sar R.
 
 
 

I's possible to use a RadioButtonGroup cellrenderer???

Post by ntsii » Sat, 14 May 2005 01:09:39

C?sar,
I don't see any reason why not. I have done very little with custom cell renderers so I can't be any direct help.

Tracy

 
 
 

I's possible to use a RadioButtonGroup cellrenderer???

Post by peteren » Wed, 18 May 2005 02:12:28

I have examples of cell renderers on my blog: http://www.yqcomputer.com/
for the entry labeled "Cell Renderers" and under that there is a CheckBox
renderer. You should be able to substitute your RadioButton.

If you are planning to have each row of the grid have a radio button and that
checking one of these unchecks the rest in the grid, you may run into a
problem. The cell renderers are re-used as the user scrolls through the grid.
For example, if you select the second row of the grid, then everything else
must become unchecked. When the user scrolls the grid, he should not see the
second row still selected since it represents a different data value. You will
need to make sure the setValue method of the cell renderer knows whether or not
the radio button should be set or not.
 
 
 

I's possible to use a RadioButtonGroup cellrenderer???

Post by spatz0 » Sat, 17 Sep 2005 21:55:13

Theres a good example of this here...
http://www.yqcomputer.com/
under the 'Custom Cellrenderer' paragraph.
I think its in German, but you can download the code in a zip file...