Link to home
Start Free TrialLog in
Avatar of petergmk
petergmk

asked on

Multiple records manipulation

I need to insert, delete or update multiple records (rows by rows like a matrix) on a single jsp page which allows users to type in the necessary data in text fields (four of them), however, i have no idea of this, anybody can help? Thank you in advance. I am using Struts and EJB.
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Are you using entity beans?

Your SQL should be in your EJB layer, so this should just be a case of writing an ActionForm, then writing a corresponding Action, then depending on the properties of the form, call the relevant method in your EJB layer...

It may help things to write a wrapper for each "row" in your Matrix:

public class RowWrapper implements Serializable
{
    String value1, value2, value3, value4 ;
    boolean delete ;

    // then write setters/getters for each attribute
}

Then you can have a getList() method in your action form, and iterate over this list in the JSP (using logic:iterate), adding text input boxes for each string, and a boolean for the deleted property...

Tim
ASKER CERTIFIED SOLUTION
Avatar of Jim Cakalic
Jim Cakalic
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial