I am using JSF 2.0. When I am trying to use a variable in the ‘id’ attribute of the h:dataTable its not taking that variable value.
I have h:dataTable inside ui:repeat with id values as index of ui:repeat as mentioned below.
<ui:repeat var="planMap" value="#{planAccountMap.entrySet().toArray()}" varStatus="planMapStatus">
<h:dataTable id="planTable#{planMapStatus.index}" value="#{planMap.value}" var="accountList">
Does any one know whether we can have dynamic id generated for h:dataTable in loop?
I have a Java script which is making use of table id, but as I am not able to have the unique id for each table in the loop, its breaking.
This problem can be solve by using datatable inside datatable. Second datatable is kept inside the column of the first datatable as below.
By this you would get unique id as
outerTable:0:planTable,outerTable:1:planTable.This even extend the unique id to each element in datatable asouterTable:1:planTable:1:columnid,outerTable:0:planTable:0:columnid