This is more of a design issue, but I personally hate it (and find it
dangerous in some cases) when anything is "automatically" saved for the
user without their knowledge.  What if I don't want my work on page A to
be saved and really just want to go to page B?

In situations like this, I prefer to prompt the user with a message like
"Any unsaved changes on this page will be lost.  Do you want to
continue?"  If they click ok, send them to page B.  If they click
cancel, nothing happens and they are then able to manually save Page A's
data before moving on to Page B.  

You can even be intelligent about when to display this message with some
javascript that inspects the form contents (and/or listens to onblur
events) and only prompts the user if the form data has actually changed.


- Scott

-----Original Message-----
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 4:25 PM
To: Struts Users Mailing List
Subject: Re: Double submit and Implied Save

From: "Nancy Lin" <[EMAIL PROTECTED]>
> 1.  Here's our application requirement:
>       when user modifies a page, say A and clicks on any other menu 
> item or link, say B without clicking any button on the modified page 
> A, page A needs to be automatically saved. If there is nothing wrong 
> during save, end user should be redirected to page B, otherwise page A

> should stay with error messages.

I do this by having 'onClick()' on the links submit the current form.
Before the form submit, the javascript sets the value of a hidden form
element that will tell me where they were trying to go.

If there's an error, then the user is returned to the page with error
messages.  If not, the Action does whatever it needs to do, then decides
where to forward/redirect based on that hidden field.

--
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to