这里是我的模型:如何在Primefaces数据表中表示嵌套数据?
User.java
public class User {
//...
public List<User> getFriends() {
// ...
}
}
我想建的用户朋友们的表是这样的:
users.jsf
+----------+------------+ | USER | FRIENDS | +----------+------------+ | | ALICE | | +------------+ | ADAM | BOB | | +------------+ | | PITT | +----------+------------+ | | | ....
由于有很多用户,这是不可能的转储ŧ他用户表一气呵成。
数据表部件是在这种情况下,理想的,因为它有内置的分页支持。 它也是理想的,因为它可以对列进行排序...
不幸的是,我无法通过Primefaces示例找到更改用户列中rowspan的方法。
我怎样才能建立这个数据表?
有这种类似的问题,其他一些OP:
- Primefaces/JSF Nested Data Table
- How to do a dataTable containing a subtable with Primefaces in the same row? What's doing with mine?
- Primefaces dataTable with rowspan
- ...添加你的吗?
编辑
这里是the final solution I came up。
你能举例说明你的答案吗? – Stephan