Hi all, The following is the scenario in which i need help in maintaining the session. 1. My webpage contains lot of form elements like text boxes, check boxes, text areas etc. The user enters data into it and uses these elements accordingly. 2. Now if the user uses ctrl+N to open a new browser window, the same webpage appears but without the data that is entered in the form elements. 3. The session is maintained internally but i need a way to get the data from the form elements and put it into the new window being opened. I'm using Websphere Studio Site Developer as my IDE. Is there any option available with it to handle this situation? Or is there a way to block generating a new window?
This is tested and prooved code.
Just like you, struggeling to get the right solutions!<br /> <br />Sun Certified Java Programmer 1.5<br /> <br />Target - SCWCD
Joined: Jan 05, 2005
Instead of blocking the ctrl+N option, is there a way to handle this situation? Will server side cookies help in this scenario? Since this project deals with the medical informations, handling the new browser window is highly recommendable. Please help me on this..
1. User loads one ofyour pages (ex., abc.jsp) 2. User type some data into the forms of abc.jsp 3. User presses Ctrl+N to open a new browser window.
Now in the new window, the user entered data is not visible.
If I have understood the steps clearly, it is very evident that, data will not be displayed. Because in step 3, when users press Ctrl+N, browser will request the server again for abc.jsp. At this time, server will not know the data entered by user in step 2, as this data has not been sent to the server.
The best way to handle, if you can, is train the users and inform the implications of doing these steps.
If they still insist on achieving this, you can do one thing though. Try to capture the Ctrl+N and submit the form. So that when users open the new browser, when browser requests again for abc.jsp file, you can paint the data back.
PS: This isjust my idea, and I have not implemented anything like this before. In personal opinion, doing these "by hook or crook" things, you will have some or the other problems or issues, which you will not have control about. So suggested you convience your users to enter data only after opening the new window or saving the page, before pressing Ctrl+N.
Hi, you can try checking out AJAX. One good site is AJAX in Action. With AJAX, what you might be able to do is for every onblur of a FORM, have AJAX send it to the backend to save into the session. So when the user calls a new window with Ctrl+N, it should have values in the session already.