I'm having a datatable where I would like to set the id of each row to the id of the current item (object that has an id field) in the array that builds the table.
Example:
<h:dataTable
value="#{bean.list}"
var="item">
<h:column>
<h:outputText id="#{item.id}" .... />
</h:column>
</h:dataTable>
This doesn't work as I get: javax.servlet.ServletException: Empty id attribute is not allowed
.
Is it not possible to set the id this way due to how JSF builds its id's, or am I doing something wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…