如何对dataTable中的列进行排序。 JSF 2.0 [英] How to sort a Column in a dataTable. JSF 2.0

查看:138
本文介绍了如何对dataTable中的列进行排序。 JSF 2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在jsf 2.0中构建一个WebApp,它是关于存储信息并将其显示在屏幕上的。所以我把一些http://java.sun.com/jsf/html数据表放在一些列表中。我的Java代码返回一个列表,然后在屏幕上显示它们。但现在我必须按字母顺序排列列。我相信没有内在的方式做这个,所以我要去别的地方看看这个任务。



我遇到了这个dataTables示例,它非常棒,但我想我无法给它一个列表并显示列表。



我也发现了 BalusC将DataTalk进行排序的方法,这是很好的,我正在寻找这个,但也许与jQuery IU。



是否有这样的一个可以满足我需求的API?你能指向正确的方向,还是建议一个?我真的想要一个我只是在Java中移交列表,但如果我必须,我可以修改数据以符合JSON格式或其他一些...

解决方案

在jsf-2.0之上有几个组件库。



原文例如具有非常强大的 datatable组件排序 / 过滤选项。原型很容易融入您的项目,并附带了大量主题(或者您可以创建你自己的主题)。



只需看看 showcase 文档



其他受欢迎的组件库是 Richfaces (根据不支持的评论数据排序排序)和Icefaces。


I'm building a WebApp in jsf 2.0 and it's about storing information and displaying it on the screen. so I've put in some "http://java.sun.com/jsf/html" dataTables to disply some lists. My Java code returns a List and then displays them on screen. but now I have to Sort the columns alphabetically. I believe there's no built in way of doing this, so i'm goign to have to look elsewhere for the task.

I came across This dataTables example, it's pretty awesome but I think I can't give it a List and display the list.

I also came across BalusC's way of incorporating the sorting intot he DataTbal, which is nice, I'm looking for this, but maybe with a jQuery IU.

Is there such an API that can meet my needs? can you point me in the right direction, or do you suggest one? I'd really want one that I just hand over the list in Java, but If I must, I can modify the data to comply with JSON format or some other...

解决方案

There are several component librarys on top of jsf-2.0.

Primefaces for instance has a very powerful datatable component with sorting / filtering options. Primefaces is very easy to integrate into your project and comes with a lot of themes (or you can create your own theme).

Just have a look at the showcase and the documentation.

Other popular component libraries are Richfaces (as per comment datatable sorting not supported) and Icefaces.

这篇关于如何对dataTable中的列进行排序。 JSF 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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