I am a newbie to JSF and have been trying the below,
I have 10 rows in a JSF page, and 10 rows are of the same tag type, say <tr:image>. I wanted to assign an Id to each image tag in a specified format say,
Firstly I do not know how many rows of <tr:image /> will be there...and I wanted to append image_1,_2,_3...._10....my question is how do I generate that increasing number in JSF, and assign that to 'id' attribute?
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
Oh, you have only one tr:image component inside some UIData component (a table or so)? Why did you mention that you have more tr:image components? Did you check the HTML output, do you see more <tr:image> elements? No, you just see more <img> elements.
No, that's not possible. Just assign it a fixed ID to it. JSF will prepend the row ID to it automatically.
Why this question? Are you just facing a problem for which you think that fixing the ID is the solution? In the future it will be more helpful if you just elaborate about the actual problem instead of asking how to achieve something of which you think that it is the right solution (which may not be a right solution at all, as you see now).