This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
On clicking a button in the main JSP a new child window should open and in the child window there is a small form, on pressing the OK button on the form the child window should close and the data should persist in the bean. now on clicking the submit button main JSP the data of child window should be saved in the database.
How can I do this. ?
I have created separate action class and bean for child window, but the data does not persist in the bean after clicking the OK button.
1. When you click on the submit button of the child window, invoke a action class. In the action class create a method to map the values from the child windows form bean to parent windows form bean. Once the mapping is done, forward your request to the parent window which would have the values of your child window as well.
2. Have hidden fields in your parent window for all the fields that you might have in your child window. Use Java script to populate the values down to the parent window from the child window as soon as the onclick of the child windows submit button is triggered.
Joined: Apr 15, 2011
actually i have 14 jsps and one common child window, so i cannot have the chiild window attibute in all 14 jsp beans.
i have another question.
How can open a child window WITHOUT refeshing/reloading parent window ?
I want to open a child window by clicking a submit button and not a link.
am using window.open ut it refrshes my parent window.