Search code examples
gwtcelltable

show the detail of a row in celltable


the requirement is easy, but I don't know how to do it. there is a celltable with a column of radio button (or check box but only allow select one row), after user select that row, there is a button and user can click that button to see the detail of that row.

How to do it?

I try to SingleSelectionModel, but I assume the user origin select row 3 radiobutton, then the row3 underlying field is set to true, then when user select the row 5 radiobutton, the row 5 corresponding field is set to true, but I have no method to set the previously row 3 selected field to false.


Solution

  • There is no method to do it automatically. you have to do it yourself by applying a loop. use field updater on that column and get the value on basis of that set the value of other check boxes or radiobuttons. you can get all other elements by this code:

    GridReportFields ldp=dataGrid.getVisibleItem(rowNo);

    here GridReportFields is my model class. now u have object of corresponding rowNo you can set value of any variable of that object. like:

    ldp.setCheckBoxValue(true);

    here setCheckBoxValue() is a setter method of model class.