Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

updating check box with HQL in Struts 1.3

 
srikanth sridhar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using Struts 1.3 with hibernate in my project. I have check boxes for employee names which are dynamically generated.
After I check a particular employee name, with change in the reference number, that particular employee name should be inserted as a new record with changes and the other employee names should be updated with the same previous reference number.

How to do it..? can any one please suggest me ideas or with the code snippets if some one has. It will be a great help..
 
Sanjeev Kumar Ramineni
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srikanth,

Can you elaborate your requirement a bit more and paste the JSP code being used to display the page..?

Regards,
Sanjeev.
 
srikanth sridhar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi sanjeev...

I am getting employee names dynamically from the database and using using iteration i am creating check boxes using html multibox.

<html:iteration id="record" name="form" property="list" />
<html:multibox name="form" property="anotherlist" value="<%=record.getEmployeeName()%>"/>
bean write name="record" property"employeeName"

Now my requirement is, consider we have 4 employees with same reference number.. in due course of time the reference number of two employees should be updated. So i check the check box against the employee name among one of the 4 employees and change the reference number of that employee.
Now I need to insert new reference no to the changed employee name and the other 3 employee names should be updated with the old reference number..

i am doing in my method something like this..

get the list of employees from the database for that session. check them with the employee names of the checked list. If they are same then check whether any check box is checked and also the value of reference no is changed. If so i am updating.

The problem here is its getting updated for all the employees, which should not be the case..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic