my dog learned polymorphism*
The moose likes GWT and the fly likes no RadioButtonCell in GWT 2.4 Cell? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "no RadioButtonCell in GWT 2.4 Cell?" Watch "no RadioButtonCell in GWT 2.4 Cell?" New topic
Author

no RadioButtonCell in GWT 2.4 Cell?

peter tong
Ranch Hand

Joined: Mar 15, 2008
Posts: 240
I check the GWT 2.4 API
Cell
and found there is no RadioButtonCell, so if I need a column with radio button on each row, how to do it using GWT 2.4?
Harendra Kumar
Greenhorn

Joined: Jun 28, 2009
Posts: 2
You can write your custom RadioCell by extending CheckboxCell class and override render() method.
peter tong
Ranch Hand

Joined: Mar 15, 2008
Posts: 240
Harendra Kumar wrote:You can write your custom RadioCell by extending CheckboxCell class and override render() method.


override this method
public void render(Cell.Context context,
java.lang.Boolean value,
SafeHtmlBuilder sb)
?

how to start?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10175
    
    8

Recommended reading http://code.google.com/webtoolkit/doc/latest/DevGuideUiCellWidgets.html

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
peter tong
Ranch Hand

Joined: Mar 15, 2008
Posts: 240
I extends the CheckboxCell.class as follow:


everything seems ok, but now I want to add a button, and when press that button, it will give me the selected record information, I try to use singleselectionmodel as follow:


but now a very strange thing occur, when I select a radiobutton in a row of the table, the radio button will not selected, I need press the radio button once more to get it selected, before adding the singleselectionmodel,
no this problem occur!!
peter tong
Ranch Hand

Joined: Mar 15, 2008
Posts: 240


is there a way to locate the previous selected object so I can set its value to false?
I found that although I set the selected object to true, but the previous selected object is also true, and seems there is no method in onSelectionChange event to get the previous selected object, any method?
peter tong
Ranch Hand

Joined: Mar 15, 2008
Posts: 240
really need help, maybe I simplify what I want to do.
there is a celltable with a column of radio button for each row, user can select a row using that radio button, and click a button outside the celltable to open the detail page for that row.
the requirement is easy, but I really do not know how to do it.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: no RadioButtonCell in GWT 2.4 Cell?
 
Similar Threads
GWT forum
Trying to use non-GWT jar in GWT project
how to enable the last button of simplepager?
Does GWT-EXT have a Hyperlink Class? Where is they HyperLink class?
Third party tools