[Seaside] Anchor double click problematic

dtrussardi at tiscali.it dtrussardi at tiscali.it
Mon Mar 26 16:15:45 UTC 2018


Ciao,

	in the seaside 3.1 application i have a classic anchor declaration:


		html anchor 	
			callback:[  delta :=  self doSomethingWithJQDialogError  ];
							
			with: [html image
					url:  DTRFileLibrary / #greenupGif ;
					altText: 'Incrementa';
					title:'Incrementa' ]

	But if the user doubleClick on the anchor i have some problematic and the dialog is not right display.

	The double click and the relative double callback generated some problematic.

	

> Double click isn't a problem you handle at the server, it's something you handle at the client. Toss a touch of JavaScript on the onClick of the anchor and your problem is solved. One click and the anchor is disabled from future clicks while it's submitting.
> 
> html anchor 	
>  callback:[  delta :=  self doSomethingWithJQDialogError  ];
>  onClick: 'this.onclick = function(){ return false; }';
>  with: [html image url:  DTRFileLibrary / #greenupGif ;
> 	altText: 'Incrementa';
> 	title:'Incrementa' ]
> 
> --
> Ramon Leon

	Now as Leon suggested ( thanks ) i add the : 	 onClick: 'this.onclick = function(){ return false; }';

		and all work right with callback re-rendering.


	But with the ajax callback as :

	html anchor
     		 id: idAjaxAnchor;
		onClick: 'this.onclick = function(){ return false; }'; 
		
	       onClick:( html jQuery ajax callback: [ flagDialog := false.
										 [self setupVoceAttiva: each] on: DTRDataBaseLockError do: [:ex | flagDialog := true] ] ];
               onSuccess:
                   ( html jQuery ajax
                       script: [ :s | flagDialog ifTrue:[  s << (s  jQuery: #'dialogId') dialog open ]);

	with: [ self render6Item: each on: html ].
	
	the anchor is not rendering after the first click and the click is disabled for always.

	I can disabled the click only for some time ( one second )?

	Any trick to solve the problem?

	Thanks, 

		Dario
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20180326/eea04a49/attachment.html>


More information about the seaside mailing list