<h:dataTable value="#{SearchingBeans.list}" var="entry">
<h:column>
<f:facet name="header">
<h:outputLabel>Photo</h:outputLabel>
</f:facet>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel>Pseudo</h:outputLabel>
</f:facet>
<h:outputLabel value="#{entry.pseudo}"></h:outputLabel>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel>Description</h:outputLabel>
</f:facet>
<h:outputLabel value="#{entry.description}"></h:outputLabel>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel>Photo</h:outputLabel>
</f:facet>
<h:outputLabel value="#{entry.photo[0].path}"></h:outputLabel> <-- this a List
</h:column>
</h:dataTable>
我有一個實體的成員對自己的財產之一是列表的照片具有get/set 該屬性是填充 我不知道如何獲取在JSF該值我只需要每個成員的第一張照片,因爲他們有2-3張照片。它有可能?任何其他解決方案將不勝感激。迭代裏面^ h嵌套列表屬性:數據表
如果您有'List'類型的'entry.list',可以使用EL'empty'檢查其內容,然後使用'[0]'訪問其第一個元素,如果我有你的想法正常。 – skuntsel