ayanbizz 0 Newbie Poster

I am using SPring mvc 3 with Thymeleaf.I have a list in my jsp page and each row in the bean is accompanied by a button.When I click on that button I want to get the index of that row.I am not able to do so.
I have the following list in my Jsp page

    <tr th:each="idBean : ${idBeanLst}" >
    <td th:text="${idBeanStat.count}" id="count"></td>
    <td th:text="${idBean.identifierId}" id="idenId"></td>
    <td th:text="${idBean.idNumber}" id="idNumber"></td>
    <td th:text="${idBean.issueLocation}" id="issueLocation"></td>
    <td th:text="${idBean.issueDate}" id="issueDate"></td>
    <td th:text="${idBean.expiryDate}" id="expDt"></td>
    <button type="button" name="identifierRow" id="identifierRow" th:value="${idBeanStat.index}" onclick="doAjaxCallRemoveIdentifier()">Remove</button>
    function doAjaxCallRemoveIdentifier() {
    alert('in here');
    var idNumber = $('#idNumber').val();
    var issueLocation = $('#issueLocation').val();
    var issueDate = $('#issueDate').val();
    var expiryDate = $('#expiryDate').val();
    var identifierRow = $('#identifierRow').va();
    var url = '/SpringUI/spring/removeIndentifier/';
    $("#content").load(url, {
    'identifierRow' : identifierRow
    }, function () {

How can I send the index number of this arraylist indside the function doAjaxCallRemoveIdentifier().How can I do that?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.