【发布时间】:2019-12-10 23:53:35
【问题描述】:
我试图在 Datatable 中显示我的 mysql 数据库中的数据,并且一切正常,现在我试图包含一个过滤器和排序功能,但是当我测试它并按下排序箭头时,什么都没有发生,只有当我先过滤数据表,然后一切正常。
我尝试使用 primeface Attributes filterBy 和 sortBy,由于现有功能,我认为它与更新问题有关
<p:dataTable id="test3" scrollable="true" scrollHeight="150" var="Foo" value="#{Foo.bar}">
<p:column headerText="#{msg['default-description-key']}"
sortBy="#{Foo.keyString}"
filterBy="#{Foo.keyString}">
<p:outputLabel value="#{Foo.keyString}"
style="float:center"/>
</p:column>
<p:column headerText="#{msg['default-description-count']}"
sortBy="#{Foo.count}" filterBy="#{Foo.count}">
<p:outputLabel value="#{Foo.count}"
style="float:center"/>
</p:column>
<p:column headerText="#{msg['default-description-register.key']}">
<p:commandLink value="#{msg['default-description-
register.key.link']}" action="#{Foo.bar(Foo.keyString)}"/>
</p:column>
</p:dataTable>
我希望能够对数据表进行排序而无需之前对其进行过滤
【问题讨论】:
标签: jsf primefaces