Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

no RadioButtonCell in GWT 2.4 Cell?

 
peter tong
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can write your custom RadioCell by extending CheckboxCell class and override render() method.
 
peter tong
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
peter tong
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic