Solved

Save to Database before exitting the page

Posted on 2004-04-01
10
245 Views
Last Modified: 2010-04-07
Dear All,

I have this entry form that contains some links (static and dynamic), also some buttons that can take the user to other pages.

Now, I need to save the data, before exitting the page, no matter where the user is to go,

I though of resubmitting on the same page passing the NextUrl, and then after saving, to redirect to the new page.

But, this is to complex, since there are some links that does a lot before going to other pages.

so, I am thinking of a listener page, that i can submit to which will save all the data, and then the form will go to whereever it was going,

do you think that this is doable, and if you have any other suggestions, please let me know.


Thanks
0
Comment
Question by:Inteqam
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 35

Expert Comment

by:mrichmon
ID: 10733090
Well, first of all what language are you using?

Either one of your ideas will work.

In fact they are actually the same idea - it is just whether you use the same page as the "listener page" or a spearate page - and that is up to you.

The thing you would have to keep track of is the destination that the button/link/control/etc would be taking you to and the action that would be done in each case.


Then you can set up a switch/case statement - or even a series of if/elseif statements on the listener page.
0
 

Expert Comment

by:pborregg
ID: 10741899
Think of using Sybase Powerbuilder with EAServer, Power J or JBuilder.

Create NVOs (Non-visual objects) on Powerbuilder
Create Datawindow forms using Powerbuilder
Deploy them to EAServer
Create Stubs and Skeletons

Using PowerJ or JBuilder create JSP's Servlets and EJB's (if req'd)
Deploy to EAServer

Open in a thin client solution, Browser only, and POOF!!! The database can be anything, Oracle, MDB, ASE 12.5, INFORMIX, Etc....

I have a solution that my colleague and I developed.  We have 5 small base objects.

Its fairly complex but it works and has been developed for applications for the Department of Defense, The US Navy SPAWAR program and Texas Workforce Commission.

PB
0
 
LVL 7

Author Comment

by:Inteqam
ID: 10751318
ASP

and, sometimes, those button should do a submit to a new page, that is a form full o Hidden fields,
i can submit it to a lister page, refill all the hidden fields and resubmit to a new page,

is there a way to resubmit the request to another form?


0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 35

Expert Comment

by:mrichmon
ID: 10758015
Yes what you do is that you have to first write all of the fields that were submitted to the first page as hidden variables and then submit to the new page

Or you can save the values as session variables instead of writing to hidden fields.
0
 
LVL 7

Author Comment

by:Inteqam
ID: 10758690
well, writting all the fields again is my idea that i don't want to implement
and using session fields is not an option,

anyhow, i redesigned the bage, and restricted the save to only 3 links, other than that the form doesn't save.

sad to say so, but i was in a hurry.

thanks all.
0
 
LVL 4

Expert Comment

by:kssaran
ID: 10829564
If you are still looking for solution

There is a way to handle this using the body event called onbeforeunload(but strictly to IE users only).

In that event you can make a request to one ASP Page to insert the date with the help of XML DOM Object. You can pass the data as XML Node tree to one ASP Page and insert everything. After finishing that process you can return true or false according to the successful insert or update operation then allow the users to goto any other page or display the error message

Rgds
Sara
0
 

Expert Comment

by:nishit4all
ID: 10903136
if u are thinking for a listener page then u can just pass the values as aruguments and one more argment which contains the destination (that which link was clicked)

i am sorry coz i am giving a JSP eg
In jsp a page with arguments can be called like:
document.location=
page.jsp?name=abc&id=12&loc=rediff.com

in this way those args will be available on next page and there u can write the database code, after this desired page will be displayed.

Thanks
nishit
0
 
LVL 7

Author Comment

by:Inteqam
ID: 10911274
I solved this by useing a  middle page with no GUI, a page that saves then redirects, I did that for only some of the exits of the page, the client was satisfied, anyhow, i would like to know if there is a listener page, so that i can submit to the server without refreshing the page, just to do things on server.

is that doable?
0
 
LVL 4

Accepted Solution

by:
kssaran earned 125 total points
ID: 10914584
Hi Inteqam,

As I said the only to pass data to server without refreshing page is to use XML DOM. I am sure that u will get the solution required by you through this method. If you want any sample on this you can search thru google using keyword as XML DOM Object. You will get plenty of sample

Happy Coding

Rgds
Sara
0
 
LVL 7

Author Comment

by:Inteqam
ID: 10916047
Thanks Sara,

that helped
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question