You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "pedro.zamor@katamail.com" <pe...@katamail.com> on 2004/02/23 17:34:08 UTC

user multiple click

I've a form with another table component in the same page. When users click twice (or more) on submit button I get the following error :

org.apache.tapestry.ApplicationRuntimeException 
Page recorder for page Home is locked after a commit(), but received a change to property sessionState of component Home/atable.tableView. 
 
The message tells that this happens because more than one request of changing properties values are received, due to multiple click.

Does someone know a way to fix this problem on the  server side? (I fixed on client side by js disabling submit button when first click happens but is not a robust solution)

Thanks

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


Re: user multiple click

Posted by Mindbridge <mi...@yahoo.com>.
You've struck a painful issue that does need to be resolved soon, I guess.

The best way to probably handle this on the server side _at the moment_ if
you cannot verify if the action has been performed is to put a "token" in
the form (in a Hidden field, perhaps). The token could be a string related
to the action, a totally random string, etc. Once you receive the button
click via your listener, check whether the token is present in your session.
If it is not, add it to the session and perform the action. If it is, then
the action has already been performed, so you can just ignore the click, do
not modify any properties, and just render the response. Use synchronize
where appropriate. This approach also resolves pressing F5 after submitting
the form, using the Back button, and the whole set of related issues. There
are slightly more complex ways to handle this that will not lead to the
session growing uncontrollably, but I suppose this is a bit out of the scope
of this message.

There is a rough proposal for dealing with similar situations automatically
in 3.1, hopefully it will go in. There is also a proposal for disabling the
restriction of modifying persistent properties during render that will
attack the problem from another angle. Howard is probably best versed in
those issues and the related problems, hopefully he will join the thread.

The client side method you are currently using is your best bet in the
meantime, I think -- your approach is likely the easiest.

----- Original Message ----- 
From: <pe...@katamail.com>
To: <ta...@jakarta.apache.org>
Sent: Monday, February 23, 2004 6:34 PM
Subject: user multiple click


> I've a form with another table component in the same page. When users
click twice (or more) on submit button I get the following error :
>
> org.apache.tapestry.ApplicationRuntimeException
> Page recorder for page Home is locked after a commit(), but received a
change to property sessionState of component Home/atable.tableView.
>
> The message tells that this happens because more than one request of
changing properties values are received, due to multiple click.
>
> Does someone know a way to fix this problem on the  server side? (I fixed
on client side by js disabling submit button when first click happens but is
not a robust solution)
>
> Thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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