On Tue, Aug 31, 2010 at 3:09 AM, Cédric Durmont <cdurm...@gmail.com> wrote:
> Don't try to catch a double-click event. Instead, try to : > - catch an onclick event > - use it to disable the link > - return true, so that this first click will actually do something. > The following clicks should not happen because you just > disabled/hidden the link > > Regards > Cedric > > 2010/8/31 yogeen honnavar <yog...@yahoo.com>: > > Scott, > > > > Yes am also trying javascript solution. but the problem is for > h:commandlink onclick event is generated by myfaces. and am not successful > at trying to catch double click event also since the form is being submitted > even though i catch double click event and say return. can u pls give some > code snippet to handle this using javascript. > > > > also i read about shale s:token and some other solutions being used to > solve this problem. any idea ? > > > > regards > > -yogeen > > > > --- On Mon, 30/8/10, Scott O'Bryan <darkar...@gmail.com> wrote: > > > >> From: Scott O'Bryan <darkar...@gmail.com> > >> Subject: Re: double click problem in JSF > >> To: "MyFaces Discussion" <users@myfaces.apache.org> > >> Date: Monday, 30 August, 2010, 6:22 PM > >> Yogeen, > >> > >> This is standard link behavior. Short of writing > >> JavaScript to > >> intercept the event and handle double click, here is not > >> much I think > >> you can do. > >> > >> Sent from my iPhone > >> > >> On Aug 29, 2010, at 9:45 PM, yogeen honnavar <yog...@yahoo.com> > >> wrote: > >> > >> > Dear users, > >> > > >> > We are using myfaces-1.1.5 with tomcat. We have a > >> problem, when a user double clicks on a h:commandlink 2 > >> submissions are sent to the server and hence the application > >> reports an error. Can anybody suggest a solution to the > >> double click problem. > >> > > >> > regards > >> > -yogeen > >> > > >> > > >> > > > > > > > Cedric's solution is a very good one. We use it quite a bit. For help with the syntax, you can use something like this... <h:commandButton value="My Button" onclick="this.disabled=true; return true;" action="..." /> Donn