简体   繁体   English

数据表jsf中的一对多行?

[英]One to many row in datatable jsf?

How can I create datatable which displays record as the following: 如何创建datatable ,显示记录如下所示:

|      | SECOND |
| ONE  | THIRD  |
|      | FORTH  |
|      | FIFTH  |

eg one to many. 例如一对多。 Can you help me? 你能帮助我吗?

There's no way to achieve it with Primefaces, AFAIK. Primefaces,AFAIK无法实现这一目标。 You could use a subtable instead to do something like: 您可以改用子表来执行以下操作:

|               ONE                 | 
| SECOND | THIRD  || FORTH  || FIFTH  |

Or even use a rowExpansion utility, which I usually use for most of my one to many cases. 甚至使用rowExpansion实用程序,我通常在大多数情况下使用它。

If your requirement is to match exactly what you ask for, you could always go with a pure JSF implementation instead and try to style it using Primefaces CSS stylesheets. 如果您的要求是完全符合您的要求,则可以始终使用纯JSF实现,并尝试使用Primefaces CSS样式表对其进行样式设置。

Using subtable you can display 1 to N relation data like: 使用子表可以显示1到N个关系数据,例如:

| ONE | SECOND |
|     | THIRD  |
|     | FORTH  |
|     | FIFTH  |

For that you need repeat ONE in each line, but display (rendered) it for first line only. 为此,您需要在每行中重复一个,但仅在第一行中显示(显示)它。 See result using RichFaces 使用RichFaces查看结果

1对N

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM