Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 88720 invoked from network); 26 Mar 2006 02:35:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Mar 2006 02:35:15 -0000 Received: (qmail 26325 invoked by uid 500); 26 Mar 2006 02:35:12 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 26286 invoked by uid 500); 26 Mar 2006 02:35:11 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 26275 invoked by uid 99); 26 Mar 2006 02:35:11 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Mar 2006 18:35:11 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [80.67.18.16] (HELO smtprelay04.ispgateway.de) (80.67.18.16) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Mar 2006 18:35:10 -0800 Received: (qmail 25837 invoked from network); 26 Mar 2006 02:34:47 -0000 Received: from unknown (HELO [192.168.1.11]) (026695@[84.63.128.202]) (envelope-sender ) by smtprelay04.ispgateway.de (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 26 Mar 2006 02:34:47 -0000 Message-ID: <4425FDD7.6090504@zit-systems.de> Date: Sun, 26 Mar 2006 04:35:03 +0200 From: Andreas Zeller - zit-systems Organization: zit-systems User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 To: MyFaces Discussion Subject: Re: how do I prevent nervous users starting actions more than once??? References: <43D65DBB.4050005@gmx.de> <1068298710.20060124225834@sub.uni-goettingen.de> <43D76EAC.5030701@gmx.de> In-Reply-To: X-Enigmail-Version: 0.92.1.0 Content-Type: multipart/alternative; boundary="------------090508000005000102020507" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. --------------090508000005000102020507 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Hey Emily, If your Button causes your application to fail in some way, you could catch that kind of bad user interaction by identifying the clicked button via the component id (which is unique for each component on your page). This is kind of a "dirty" solution, but if the application switches to a different state, the triggered action should be "locked", so it can't be accessed again, unless it won't cause any damage. You would do this by giving the commandButton an ID, setting an f:param inside the button and getting this parameter (if you have a dynamic model and need to know which button has been clicked) back in the application via an ActionEvent, which is a parameter for an actionListener method. I had to do this for a system that locks datasets and prevents other users from editing. A user should only be able to edit one record at a time. If the user acts quickly and clicks several buttons on the page, that would open many open records. So what I did, is catch the ID and the param, unlock the records he clicked before and open only the last one for editing. If your problem is similar in some way, this might be a solution. A dirty one, I admit, but it works. Andreas Emily Gu wrote: > Hi, > > Would you please let me know how do you know it is clicked the same > button so that you can provent the next click by doing this? > > Thanks, > Emily > > > On 1/25/06, *Hansj�rg Meuschel* > > wrote: > > Hi Steffen, > thanks for this great information, the filter works perfectly and > solved > one of my biggest problems with my application !!!!! > > Steffen Hankiewicz wrote: > > >Hi Hansj�rg, > > > > > > > >>how can I prevent impatient users of my webapp to perform > actions twice > >>by clicking serveral times on the commandbuttons ?? > >> > >> > > > >I am using a servlet filter which works great here. Maybe you > want to > >give it a try: > > > > > http://www.onjava.com/pub/a/onjava/2004/03/24/loadcontrol.html?page=1 > > > >HTH, > > > >Steffen Hankiewicz > > > > > > > > > > --------------090508000005000102020507 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hey Emily,

If your Button causes your application to fail in some way, you could catch that kind of bad user interaction by identifying the clicked button via the component id (which is unique for each component on your page).
This is kind of a "dirty" solution, but if the application switches to a different state, the triggered action should be "locked", so it can't be accessed again, unless it won't cause any damage.

You would do this by giving the commandButton an ID, setting an f:param inside the button and getting this parameter (if you have a dynamic model and need to know which button has been clicked) back in the application via an ActionEvent, which is a parameter for an actionListener method.

I had to do this for a system that locks datasets and prevents other users from editing. A user should only be able to edit one record at a time. If the user acts quickly and clicks several buttons on the page, that would open many open records. So what I did, is catch the ID and the param, unlock the records he clicked before and open only the last one for editing. If your problem is similar in some way, this might be a solution. A dirty one, I admit, but it works.

Andreas

Emily Gu wrote:
Hi,
 
 Would you please let me know how do you know it is clicked the same button so that you can provent the next click by doing this?
 
Thanks,
Emily

 
On 1/25/06, Hansjörg Meuschel <hjmeu@gmx.de> wrote:
Hi Steffen,
thanks for this great information, the filter works perfectly and solved
one of my biggest problems with my application !!!!!

Steffen Hankiewicz wrote:

>Hi Hansjörg,
>
>
>
>>how can I prevent impatient users of my webapp to perform actions twice
>>by clicking serveral times on the commandbuttons ??
>>
>>
>
>I  am using a servlet filter which works great here. Maybe you want to
>give it a try:
>
> http://www.onjava.com/pub/a/onjava/2004/03/24/loadcontrol.html?page=1
>
>HTH,
>
>Steffen Hankiewicz
>
>
>
>



--------------090508000005000102020507--