h:dataTable header facet does not display value from row

有些话、适合烂在心里 提交于 2020-02-07 05:22:25

问题


I'm trying to understand why the second column facet, with #{entry.value} doesn't display anything, just an empty header?

<h:dataTable value="#{bean.entries}" var="entry">
<h:column>
    <f:facet name="header">
        <h:outputText value="UserId" />
    </f:facet>
    <h:outputText value="#{entry.key}" />
</h:column>
<h:column>
    <f:facet name="header">
        <h:outputText value="#{entry.value}" />
    </f:facet>
    <h:outputText value="#{entry.value}" />
</h:column>

I've understand that maybe I'm doing it wrong, because myfaces cannot know from which row it should take the value #{entry.value} to put in the header column.

In my case each row have the same value of #{entry.value} so any rows could be ok.

So how can I have a dataTable that retrieve a list of objects (the corresponding rows) and a single value to put in a header object? (or a list of values to put in all the columns of the header) ?

Any ideas?

Thanks!

来源:https://stackoverflow.com/questions/32253730/hdatatable-header-facet-does-not-display-value-from-row

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!