I am developing a web based solution for a client that prefers to enter records into the system like it is done in Excel so that in a single click of Submit, several rows in the database can be updated at once. Now i want to build a multi dimensional array of Textfields that maps to multiple rows in a database. I built this once in Servlet and JSP where a loop wipes accross the
request.getParameterMap() and updates each corresponding row/column in the database.
Now looking at Wicket, what will be the neatest way to get this done. I could create so many textfields like
//Column 1
TextField A1 = new TextField("A1");
TextField A2 = new TextField("A2");
...
TextField An = new TextField("An");
//Column 2
TextField B1 = new TextField("B1");
TextField B2 = new TextField("B2");
...
TextField Bn = new TextField("Bn");
Now my Bean Model will have to contain a field each for all these textfields. is it?
Except its not neccesary, but for these kind of problem, is it possible to have a feature like this: ,
maybe,
TextField[][] fields = FormComponentUtilities.createGrid(row,column,fieldsModel); //model must be 2D array
form.add(fields);
then in my model object, I have,
private String[][] fieldsModel;
When I submit the grid, i cant simply work the 2D array to update the backend.
If this feature will not be neccessary, what better way can i go about it?
thanks
