如何在数据表中将行更改为列 [英] How to change row to column in datatable

查看:67
本文介绍了如何在数据表中将行更改为列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

h:datatable这样创建的表

h:datatable created table like this

column 1 column 2
 item 1    item 1
 item 2    item 2
 item 3     ....

但是可以更改某些内容并创建它吗?

But it is possible to change something and created this?

column1 item 1 item 2 item 3
column2 item 1 item 2 item 3

推荐答案

以这种方式,您不能直接使用h:datatable访问从数据源检索的面向行的数据.

You can't use h:datatable directly to access row oriented data retrieved from a datasource, in this way.

您可以在支持bean中创建一个新集合,该集合以以下格式保存数据 您需要(列1项目1项目2项目3). 另请参见 is-it-possible-to-have-多行与jsf-hdatatable

You could create a new collection in your backing bean which holds the data in the format you need (column1 item 1 item 2 item 3 ). See also is-it-possible-to-have-multiple-rows-with-jsf-hdatatable

这篇关于如何在数据表中将行更改为列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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