I have searched on the internet, and found this Xpages get index of repeat in CSJS but...it didn't work for me
here is my code(part of)
<xp:repeat id="repeat1" rows="30" var="currentDetail" indexVar="detailIndex" value="#{LeaveBean.details}">
<xp:inputText id="leavefrom" value="#{currentDetail.subfromtime}">
<xp:eventHandler event="onblur" submit="false" refreshMode="partial" refreshId="repeat1">
<xp:this.script><![CDATA[........]]></xp:this.script>
</xp:eventHandler>
</xp:inputText></xp:repeat>
what I want to do is once user click the input field, then I can get which line he edit, I used the ssjs just like LeaveBean.dosomething(detailIndex) well, but how to get the index of in csjs?
Marky Roden( amazing man to me XD) suggest to use the attr to get it...but...I'm completely new guy to xpages, so have no idea how to add it in my own code, I mean, I tried to add such as
<xp:this.attrs>
<xp:attr name="seanIndex"
value="???">
</xp:attr>
</xp:this.attrs>
but the value can't be like #{detailIndex}, otherwise, the page will crash out...so what can I do now...
Add a hidden text field into your repeat control with the index as value
Then you can get the index on client side with
Update
A shorter version without the need of a hidden field is just: