I am using ui:repeat tag and I have set varstatus=”current”.I try to display the row index using the below command, but nothing is getting displayed.
<h:outputText value="#{current.index}"/>
I would like to display the row index.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It was introduced in Facelets 2.x. Given the fact that it doesn’t work, you’re using Facelets 1.x.
Facelets 2.x is not standalone available. It is embedded in JSF 2.x. If you can, upgrade to JSF 2.x. If you can’t, then you’ve either to wrap the model in a custom model which holds the index as well, or to grab
<c:forEach>instead if your view markup allows it (it’s a view build time tag, not a view render time tag), or to grab Tomahawk’s<t:dataList>instead which has arowIndexVarattribute for this purpose.Update as per the comments, you turn out to be using RichFaces. In that case, you can also use the
<rich:dataList>or<a4j:repeat>which offers both arowKeyVarattribute: