javascript - how to create new scope for each record of list of records which are repeating through while in java/jsp -


i stuck problem, can let me out of it.

i getting data (mongodb) servlet jsp (mongodb). have list of (using dbcursor) documents have show them, providing edit , delete button that. when click on particular edit or delete, particular record modified.i using ajax post (edit/delete) data. provide individual scope each record. angular ng-repeat.

<% try {     while (cursor.hasnext()) {         dbobject tobj = cursor.next();         dbobj = tobj;         string id = (string) tobj.get("_id").tostring();         string firstname = (string) tobj.get("firstname");         string lastname = (string) tobj.get("lastname");         string emailid = (string) tobj.get("emailid"); %>  <tbody> <form name= "" action="" method="post"> <tr>     <td><% out.println(firstname);%> </td>     <td><% out.println(lastname);%> </td>     <td><% out.println(emailid);%> </td> <input type="hidden" name="id" value="<%= id%>"> <input type="hidden" name="firstname" value="<%= firstname%>"> <input type="hidden" name="lastname" value="<%= lastname%>"> <input type="hidden" name="emailid" value="<%= emailid%>">  <td>     <button type="submit" name="edit" value="edit" class="btn btn-info">         <i class="fa fa-pencil-square-o fa-fw"></i>         edit         <%  //out.print(dbobj);%>     </button> </td> <td>     <button type="submit" name="delete" value="delete" class="btn btn-danger">         <i class="fa fa-trash-o fa-fw"></i>         delete         <%  //out.print(dbobj);%>     </button> </td>   </tr> </form>   <%     }     // out.print(dbobj); } {     cursor.close(); } %> </tbody> 

i got answer long ago. have used "id" reference each element. i've added onclick-javascript method passing "id" argument. i've got solution.

sorry, late update.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -