I am using ui:repeat tag which render images. I have five images i want that on each iteration my image get ids like image1, image2, image3.... imagen. I tried this but it i
But you can use variable in Javascript, for example:
You can also use Variables with event handlers (since JSF 2.0):
But your loop with c:forEach
can cause problems. Be aware that the JSTL tags (everything that begins with c:
) are not fully compatible to JSF. If you have luck, then they work as expected. But anyways the slow down the rendering engine, since the page gets processed multiple times by the JSF and JSP rendering engine.
Better use ui:repeat
.