You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nancy Lin <co...@yahoo.com> on 2005/04/27 20:14:01 UTC

Double submit and Implied Save

Our application required that if user enter some data and click on
other menu link or tab without clicking the submit button, the page
will automatically be save.  The problem is it is causing double
submit, first the save submit action will be called and then the menu
link action that user want to go to.  But since xml configuration
tells where to go when the save submit action is sucessful, the
second action never gets called.

Anyone have similar application that required this implied save? Any
solution or suggestion are welcome.

Thanks.
Cometcosmo


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Double submit and Implied Save

Posted by Erik Weber <er...@mindspring.com>.
Nancy, could you try to be a little more specific and clearer in your 
explanations?

Nancy Lin wrote:

>Our application required that if user enter some data and click on
>other menu link or tab without clicking the submit button, the page
>will automatically be save.
>
Do you mean that you are submitting the form anyway, using JavaScript, 
just with a different action mapping?

>The problem is it is causing double
>submit, first the save submit action will be called and then the menu
>link action that user want to go to.
>
So I take it the first submit happens when the user clicks a link 
(instead of the submit button), and JavaScript is submitting the form 
(for a save action and not a normal submit action). Correct? So how/when 
does the second submit come into play? Doesn't your action process the 
first submit and then forward to the page the user wanted? Or are you 
using a redirect? Even so, a redirect would only be a GET request, so I 
don't understand the double submit.

>  But since xml configuration
>tells where to go when the save submit action is sucessful, the
>second action never gets called.
>  
>
Hmm, this seems to contradict what you just said. I don't understand.

Erik


>Anyone have similar application that required this implied save? Any
>solution or suggestion are welcome.
>
>Thanks.
>Cometcosmo
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Double submit and Implied Save

Posted by Michael Jouravlev <jm...@gmail.com>.
On 4/27/05, Nancy Lin <co...@yahoo.com> wrote:
> Our application required that if user enter some data and click on
> other menu link or tab without clicking the submit button, the page
> will automatically be save.

What is the point in submit button then? Maybe you would rather show a
dialog "Do you want to save the changes?" then allow user to save, and
then he would click the menuitem.

> The problem is it is causing double
> submit, first the save submit action will be called and then the menu
> link action that user want to go to.  But since xml configuration
> tells where to go when the save submit action is sucessful, the
> second action never gets called.
> 
> Anyone have similar application that required this implied save? Any
> solution or suggestion are welcome.

I would say that problem that you have is not what usually is called
"double submit". Right off the bat I can think of the following
choices (unless you want to show dialog window and to do save in two
separate steps).

* When menuitem is clicked, append a parameter to submit action URL,
which would define where to go next on success, and submit the form to
save action. Just a small javascript.

* Submit form to the target menuaction and save data from there. In
this case you would have to process request manually (maybe use
LazyAction from 1.2.6? Not sure, not used it).

Michael.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org