问题
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