...

View Full Version : How to process multiple selects from a search result to update the backend db?



sonika
08-09-2004, 05:05 PM
I am trying to modify a web page. Currently, a user can search and the results are displayed with 3 columns and multiple rows.

Ex: Search Results:
Column1(Name) -- Column2(Age) -- Column3(SchoolName)

Lara Smith -- 25 -- Stanford
Joe Smith -- 24 -- Clemson
Brian Smith -- 30 -- MIT
Monika Smith -- 19 -- Clemson

I need to modify this to provide a functionality that helps an admin to select multiple search results and click on a button to set some status in the backend database for the selected items. We are using HTML/JavaScript/Velocity/Java (Struts)/EJB...

Any guidance in how to implement this functionality is appreciated.

Thanks.
Sonika

sad69
08-09-2004, 06:25 PM
I would suspect that a row ID exists of some sort to uniquely identify a record in the database. I wonder if you can setup a checkbox on each row, and those rows which are checked can be processed however you want.

Keep in mind that you do have to be careful with checkboxes as only the ones that are checked get submitted..

Sadiq.

sonika
08-09-2004, 08:11 PM
Search results are obtained from different objects. For ex, Name and Age are from a Student object and SchoolName is from School object. So, you want me to create a temporary object that holds the row values with a key and use that key along with the check box?

Thanks.

sad69
08-09-2004, 08:24 PM
I guess so.. I just noticed you are using Velocity, so you're using Java for the server-side. I'm not really sure how that works, and I've never played with it, so I can't give you much advice from a developer's perspective.

But regardless, that sounds about right. Whatever information you need to carry-out your updates needs to be associated with the checkbox for that row. Then when the form is submitted, you can perform whatever is necessary on the checked rows.

Sadiq.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum