Solved

Save to Database before exitting the page

Posted on 2004-04-01
10
242 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now