[英]Filtering issues (no change in contents) in datatable primefaces 3.5, sorting works
Primefaces 3.5似乎根本沒有從數據表中過濾數據,奇怪的是它在我鍵入時會以某種方式重新排序它們,因此,肯定有一些AJAX調用觸發,但顯然不是正確的。
<h:panelGroup id="table-wrapper-component">
<prime:dataTable
rendered="#{artifactSelectionBackingBean.visibleComps}"
value="#{artifactSelectionBackingBean.components}"
var="tagInfoObject" emptyMessage="No tags found with given criteria"
filteredValue="#{artifactSelectionBackingBean.filteredComponents}">
<prime:ajax event="filter" global="false" />
<prime:column sortBy="#{tagInfoObject.tagId}"
headerText="Identifier" filterMatchMode="contains" filterBy = "#{tagInfoObject.tagId}">
<h:outputText value="#{tagInfoObject.tagId}" />
</prime:column>
<prime:column sortBy="#{tagInfoObject.type.tagTypeId}"
headerText="Tag Identifier" filterMatchMode="contains" filterBy ="#{tagInfoObject.type.tagTypeId}">
<h:outputText value="#{tagInfoObject.type.tagTypeId}" />
</prime:column>
<prime:column sortBy="#{tagInfoObject.title}" headerText="Title" filterMatchMode="contains" filterBy="#{tagInfoObject.title}">
<h:outputText value="#{tagInfoObject.title}" />
</prime:column>
<prime:column filterBy="#{tagInfoObject.description}"
filterMatchMode="contains" sortBy="#{tagInfoObject.description}"
styleClass="wrap" headerText="Component Description">
<h:outputText value="#{tagInfoObject.description}" />
</prime:column>
</prime:dataTable>
</h:panelGroup>
任何幫助表示贊賞! 所有Bean和方法調用都存在並返回適當的數據,只是過濾似乎根本不起作用。
另外,請注意,排序功能僅對過濾功能有效!
問題在於,您始終需要使用h:form
標記將所有過濾/排序屬性包裝在數據表中。 在PrimeFaces文檔中沒有明確指定,但是在此處的展示櫃中。 我把整個東西包裝在表格標簽中。
因此,如果您想要質素提供的任何類型的交互,請不要忘記將數據表包裝成表格。
您的托管Bean代碼將非常有用。發布您的托管Bean代碼。
可能您尚未在托管bean中設置artifactSelectionBackingBean.filteredComponents的值
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.