[英]Sort a Primefaces Table that is filled with data from a collection
I'm having trouble getting the sorting to work in my PrimeFaces data table.我无法在我的 PrimeFaces 数据表中进行排序。
This is my.xhtml file:这是我的.xhtml 文件:
<p:dataTable id="audiobooksTable" var="audiobook" value="#{audiobookListController.audiobooks}">
<f:facet name="header">
Audiobooks
</f:facet>
<p:column headerText="Audiobookname" sortBy="#{audiobook.title}" >
<h:outputText value="#{audiobook.title}" />
</p:column>
The arrows for sorting show up but clicking them has no effect.用于排序的箭头会显示,但单击它们没有效果。
audiobook.title
has the datatype String
. audiobook.title
的数据类型为String
。 There are also other columns that I want to sort by (with data types int
and double
) but those also don't work.我还想按其他列进行排序(数据类型为
int
和double
),但这些列也不起作用。
The AudiobookListController
returns Collection<AudioBook>
. AudiobookListController
返回Collection<AudioBook>
。
Any help would be greatly appreciated.任何帮助将不胜感激。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.