I have list of items in my jsp pages and that are being generated by the following code
and I want to be able to update multiple records that have a checkbox checked:
I have a method to update the status and employee name that uses hibernate that takes the taskID
as a paratmeter to update associated status and comments, but my issue is how to do it with multiple records:
____________________________________________________________________________________________-
private void updateTaskList(Long taskId, String status, String comments) {
TaskList taskList = (TaskList) HibernateUtil.getSessionFactory()
.getCurrentSession().load(TaskList.class, personId);
taskList.setStatus(status);
taskList.setComment(comments);
HibernateUtil.getSessionFactory().getCurrentSession().update(taskList);
HibernateUtil.getSessionFactory().getCurrentSession().save(taskList);
}
______________________________________________
_______________________________________________
<table border="0" cellpadding="2" cellspacing="2" width="98%" class="border">
<tr align="left">
<th></th>
<th>Employee Name</th>
<th>Status</th>
<th>Comment</th>
</tr>
<%
List result = (List) request.getAttribute("result");
%>
<%
for (Iterator itr=searchresult.iterator(); itr.hasNext(); )
{
com.dao.hibernate.TaskList taskList = (com.dao.hibernate.TaskList)itr.next();
%>
<tr>
<td> <input type="checkbox" name="taskID" value=""> </td>
<td>
<%=taskList.empName()%> </td>
<td>
<select value="Status">
<option value="<%=taskList.getStatus()%>"><%=taskList.getStatus()%></option>
<option value="New">New</option>
<option value="Fixed">Fixed</option>
<option value="Closed">Closed</option>
</select>
</td>
<td>
<input type="text" name="Comments" MAXLENGTH="20" size="20"
value="<%=taskList.getComments()%>"></td>
</tr>
<%}%>
_________________________________________________________________
|