I have:
<ui:repeat id="projectsTable" var="project" value="#{projectsBacking.projectList}">
#{project.id}
<h:dataTable id="usersAssignedToProject#{project.id}" var="appUser" value="#{projectsBacking.getAllUsersAssignedToProject(project)}">
#{project.id}
<h:column>
<h:outputText value="#{appUser.getUsername()}"/>
</h:column>
</h:dataTable>
</ui:repeat>
Using <f:ajax> I can not render h:dataTable with given id, can someone explain me what is wrong in this code? When I checked by FireBug <table id="usersAssignedToProject">, but in client side #{project.id} was printed (before and inside datatable).
It is because of id of h:dataTable is resolved when components tree is being build, but var
projectis only available on render response.Try using
c:forEachin this case instead ofui:repeat.More information on this:
https://rogerkeays.com/jsf-c-foreach-vs-ui-repeat