将不胜感激任何想法。
要求
(A) 包含的表格
A.1 text columns
A.2 one column for HTML content
A.3 one column to house a radio button group
(B) 翻阅记录的能力,例如通过使用 SimplePager。
迄今为止考虑的替代方案
- FlexTable - 可以提供所有 (A) 但不能提供 (B)
- CellTable - 可以提供 A.1 和 (B),但不能提供 A.2 和 A.3
谁能建议提供所有 A 和 B 的替代方案?我也看过 Smart GWT,但没有看到任何我可以使用的东西。但我在 GWT 或 Smart GWT 方面都不是很有经验。
谢谢你。
[编辑 1] 带有三个按钮的单选按钮组现在创建如下(“InterimReport”是我的数据类型):
Column<InterimReport, SafeHtml> radioButtonColumn = new Column<InterimReport, SafeHtml>(new SafeHtmlCell()) {
@Override
public SafeHtml getValue(InterimReport object) {
String s = "<input type=\"radio\" name=\"selection\"" + object.get("dbIndex") + " value=\"match\" /> match<br />"+ "<input type=\"radio\" name=\"selection\"" + object.get("dbIndex")+ " value=\"nomatch\" /> no match<br />" + "<input type=\"radio\" name=\"selection\""+ object.get("dbIndex") + " value=\"urlnotfound\" /> URL not found</>";
return SafeHtmlUtils.fromTrustedString(s);
}
};
[编辑 2] 但是如何捕获用户对单选按钮的选择?此代码片段似乎没有做任何事情:
radioButtonColumn.setFieldUpdater(new FieldUpdater<InterimReport, SafeHtml>() {
public void update(int index, InterimReport object, SafeHtml value) {
System.out.println("Reached here");
if (value.equals("match")) {
setMatch(object.get("dbIndex"), index);
} else if (value.equals("nomatch")) {
setNoMatch(object.get("dbIndex"), index);
} else if (value.equals("urlnotfound")) {
setUrlNotFound(object.get("dbIndex"), index);
}
}
});