2015-09-04 51 views
0

我正在一個項目上,有一些我沒有開發的部分。現在我必須在桌子上設置過濾器,因爲我們使用豐富的面孔,我想使用過濾器,如exadel中的示例。不能使過濾器上豐富:datatable

但它不起作用,我知道這可能是由於filterValue屬性,因爲我不確定是否指向適當的bean。一切看起來不錯,但過濾器不在那裏。

有什麼建議嗎?我怎樣才能知道什麼是合適的bean? 這隻包含我想要過濾的列。

<rich:dataTable var="_project" 
    value="#{projectController.showDeactivateEmployees? projects : projectController.getViewableProjects(projects)}" 
    rendered="#{not empty projectController.getViewableProjects(projects)}" 
    styleClass="simpletablestyle" sortMode="single"> 
    <rich:column filterBy="#{_project.name}" filterValue="#{project.name}"> 
      <f:facet name="header">#{msg.common_Name}</f:facet> 
      <h:outputText value="#{_project.name}" 
       style="color:#{_project.usedHours * 100/_project.maxHours &gt;= 75 and _project.maxHours!=0? '#d20f19' : '#000000'};"> 
      </h:outputText> 
    </rich:column> 
<rich:datatable/> 

回答

0

屬性名稱只是「filterValue」。

什麼是合適的豆取決於您,filterValue只需指向您想要存儲值的某個屬性。

+0

感謝您的意見,但這只是錯過拼在這篇文章上,我的代碼是正確的... – Carloshf

+0

我想知道這是怎麼回事。我已經更新了答案,你在保存價值的bean的範圍是什麼? – Makhiel