Hello,
I'm trying to build table with number of columns which is unknown at runtime (value of dataTable is binded to ResultSet which can have variable number of columns during program execution).
This is why I put
<h:column> tag nested inside JSTL
<c:forEach> tag, like in following code (not actual code, since this is not working, this is just how I immagined it should look):
<h:dataTable value="#{DatabaseBean.data}" var="dbTable">
<c:forEach var="column" begin="0" end="${DatabaseBean.noOfCols - 1}" varStatus="status">
<h:column id="???">
.......................
</h:column>
</c:forEach>
</h:dataTable>
Unfortunately, due to some constraints (JSF specification 1.0, section 9.2.8.) I must add unique
id attribute to every
<h:column> tag. So, to enforce this rule, I added
id="${column.status.index}", but I find out that using expressions in
id attribute is forbidden.
Right now I don't have further idea how to do this, maybe someone can help me ?
I know I am not first with this problem, but I am interested, has anyone find solution or workaround for this, or maybe someone can suggest me some another solution for my problem ?
Thanks, Nedim