-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Updating multiple records in jsp that are only checked inJSP
PostPosted: Sun Dec 17, 2006 4:01 pm 
Regular
Regular

Joined: Fri Nov 03, 2006 4:57 pm
Posts: 60
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>
<%}%>


_________________________________________________________________


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.