1
我有數據表是這樣的:primefaces的DataTable小頭
<p:dataTable value="#{noteMB.noteList}" var="noteItem" id="noteListTable"
rowKey="#{noteItem.hashCode()}" selectionMode="single" selection="#noteMB.selectedNote}" paginator="true" rows="10" paginatorPosition="top"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,15">
<p:column width="300">
<f:facet name="header">
<h:outputText value="#{noteItem.name == 'blabla' ? 'true' : 'false' }" />
</f:facet>
<h:outputText value="#{noteItem.code}" />
</p:column>
</p:dataTable>
我的問題:爲什麼noteItem是小名= 「標頭」 區域空? 當我運行這個代碼頭(noteItem.name)是假的和列值(noteItem.code)有一個值。
實際上noteItem爲空 – KEYSAN
清楚,很可能導致正在生成表本身之前,它正在處理中,其頭部數據,所以你不能指望它能夠訪問列表元素.... – Daniel