我是vaadin的新手,我想将数据库中的vaadin表列作为超链接。我试着用这段代码。在这里,我在代码中使用PagedTable而不是普通的vaadin表。我尝试了所有可能的方式,但我没有得到结果。做出超链接后,如果用户单击该链接,我需要显示POPUP窗口。从数据库中创建表列作为vaadin中的超链接
if (rs.next()) {
Object dashboardDataRowId = _reportTable.addItem();
Link l = new Link("rs.getInt(1)", new ExternalResource(
"#"));
_reportTable.getItem(dashboardDataRowId)
.getItemProperty("todo").setValue(l);
_reportTable.getItem(dashboardDataRowId)
.getItemProperty("watchlist")
.setValue(rs.getInt(2));
_reportTable.getItem(dashboardDataRowId)
.getItemProperty("terminated")
.setValue(rs.getInt(3));
_reportTable.getItem(dashboardDataRowId)
.getItemProperty("processed")
.setValue(rs.getInt(4));
_reportTable.getItem(dashboardDataRowId)
.getItemProperty("total")
.setValue(rs.getInt(5));
}
} catch (Exception e) {
logger.error(
"Error loading dashboard report. Exception: {}",
e.getMessage());
logger.debug("Error loading dashboard report.", e);
showWarningNotification(
"Error loading dashboard report. Please contact admin",
"Error message is " + e.getMessage());
} finally {
rs.close();
stmt.close();
}
}
});
}
private void populateReportTableColumns(final PagedTable reportTable) {
reportTable.addContainerProperty("todo", Link.class, "-", "To Do",
null, null);
// reportTable.addContainerProperty("watchlist", Link.class, new
// Link("Watch List", new ExternalResource("#")), "Watch List", null,
// null);
reportTable.addContainerProperty("watchlist", Button.class, "-",
"Watch List", null, null);
reportTable.addContainerProperty("terminated", Button.class, "-",
"Terminated", null, null);
reportTable.addContainerProperty("processed", Button.class, "-",
"Processed and Closed", null, null);
reportTable.addContainerProperty("total", Button.class, "-", "Total",
null, null);
}
谢谢。但是当用户点击链接时,我需要显示弹出窗口。 – mchinta 2015-03-14 06:31:12
如何在用户点击vaadin中的链接时启用弹出窗口。 – mchinta 2015-03-14 06:34:09