I have two Columns in a CellTable
:
Column A contains a custom RadioButtonGroupCell
, which extends AbstractInputCell
. The group contains three radio buttons.
Column B contains a ButtonCell
, and a click on the button is supposed to clear the selection made by the user in Column A.
My problem is I don't know how to retrieve a Cell in Column A from Column B. If I can retrieve the relevant Cell from Column A, I can work it out from there. Do the columns share a parent Element
I can work with? I don't know the 'best practice' to follow and would be grateful for any tips.
Fixed as follows:
Element element = (Element) cellTable.getRowElement(rowIndex);
InputElement 开发者_JAVA技巧inputElement = (InputElement) element;
inputElement.setChecked(false);
cellTable.redraw();
Hmm, cellTable.redraw() deselects all radio buttons in all rows. Needs more work .....
You can get the current selected row (object by using following line)
cellTable.getDisplayedItems().get(index)
Once you get the object, set its value cellTable.getDisplayedItems().get(index).SET...
Once value is Set , redraw the table
cellTable.redraw();
Hope this helps....
精彩评论