在CellTable的另一列中检索单元格 [英] Retrieve Cell in another Column in a CellTable

查看:108
本文介绍了在CellTable的另一列中检索单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 CellTable中有两个列



列A包含一个自定义的 RadioButtonGroupCell ,它扩展了 AbstractInputCell 。该组包含三个单选按钮。

列B包含一个 ButtonCell ,并且点击按钮应该是清除用户在列A中所做的选择。



我的问题是我不知道如何从列B检索A列中的单元格。如果我可以检索来自A列的相关单元,我可以从那里解决。这些列是否共享父母元素我可以使用?我不知道要遵循的最佳做法,并会很感激任何提示。




修正如下:

 元素元素=(元素)cellTable.getRowElement(rowIndex); 
InputElement inputElement =(InputElement)元素;
inputElement.setChecked(false);
cellTable.redraw();






嗯,cellTable.redraw()取消选择所有收音机所有行中的按钮。需要更多的工作.....

解决方案

您可以获取当前选定的行(通过使用以下行来获取对象)



cellTable.getDisplayedItems()。get(index)



获取对象后,将其值设置为
cellTable.getDisplayedItems()。get(index).SET ...

一旦设置了值,重绘表格



cellTable.redraw();



希望这有助于......


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 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....

这篇关于在CellTable的另一列中检索单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆