I have a form bean EmployeeFormBean which contains the information for a particular employee .
In my JSP there is a table with variable no of rows each row representing one employee details
Using an "Add Row " button users can add a new row in the table and fill in the details of the employee.
After entring data for n no of employees in the table the form is submitted
My question , how do i transfer this information of a collection of employee form beans.
I cant use nested beans since the no of rows in the table can be known only at run time and I need to create a new row each time the user presses "Add Row"
Currently I have only figured out how to dynamically create the table (using regular html elements not struts elements using functions like document.createElement ). But even then how do i transfer this info to action class
Will be really grateful for any sort of hints/tips/solutions
I used an IFRAME, when someone changed something I would change the src of the IFRAME to point to a new page, the same page actually, just with a query string appended with all the input variables. The browser will not refresh or jump to the top of the page. All the user will see is the load animation (which will not last long since the requested page will contain nothing)
If I weren't going to use the IFRAME solution I would probably figure out a way to encrypt the data in a single field. As I think the hidden fields would probably be a lot messier.
I do not doubt that it is possible to accomplish this on the server side, what I am wondering is how it will work in the browser and be presented to the user. IMO, that is the most difficult part of the problem.
No it will not be on the server side . It will be on the client side itself
There will be a button on the page something like "Add Row" which the user can press to add another row of details .
Only thing i have to make sure is that the new text boxes created have the correct name corresponding to the indexed property of the java bean so that the data can be transferred once the submit button is pressed
Hey , and good news . Its working I need some time to consolidate the complete code I will then post it .
Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help:
Free, earth friendly heat - from the CodeRanch trailboss