File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes updating check box with HQL in Struts 1.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "updating check box with HQL in Struts 1.3" Watch "updating check box with HQL in Struts 1.3" New topic
Author

updating check box with HQL in Struts 1.3

srikanth sridhar
Greenhorn

Joined: Dec 17, 2011
Posts: 15
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

Joined: Jul 14, 2010
Posts: 12
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

Joined: Dec 17, 2011
Posts: 15
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..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: updating check box with HQL in Struts 1.3