[Seaside] Anchor double click problematic

Joachim Tuchel jtuchel at objektfabrik.de
Tue Mar 13 19:31:38 UTC 2018


Try 

JQEvent new preventDefault 

In your onclick callback. It will cancel all subsequent event handling.

Joachim

> Am 13.03.2018 um 19:22 schrieb "dtrussardi at tiscali.it" <dtrussardi at tiscali.it>:
> 
> 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' ]
> 	
> 
> 	All works fine when the user click on the anchor.
> 
> 	If the method 	 doSomethingWithJQDialogError    found a error display a relative dialog 
> 	
> 	using the code:
> 
> 		 masterView jqDialog:(( WADTRGenericErrorManagement openOnException: ex onModel: aModel ) alert:true )
> 
> 		where jqDialog is:
> 
> 		jqDialog: aComponent 
> 			 ^ self wait: [ :cc | self show: aComponent
> 							onAnswer: cc
> 							delegation: (JQDialogDecorator new
> 										 delegate: aComponent;
> 										 yourself).
> 							 WARenderNotification signal ]
> 	
> 	
> 	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.
> 
> 	How i can disabled the callback entry after the first ?
> 
> 	I do some test with:	
> 
> 	firstCycle:= true
> 
> 	html anchor 
> 			callback:[  firstCycle ifTrue:[  firstCycle := false. delta := self doSomethingWithJQDialogError  ];
> 							
> 			with: [html image
> 					url:  DTRFileLibrary / #greenupGif ;
> 					altText: 'Incrementa';
> 					title:'Incrementa' ]
> 	
> 	
> 	But the "asynchronous callbacks" create the problematic like above.
> 
> 
> 	I do some test with the onClick
> 
> 	html anchor 	
> 		onClick: ( html jQuery ajax callback:[  delta:= self doSomething  ]);
> 		
> ????     delta > 0 ifFalse:[  at this point i need to display a dialog for report some exception ]  ????
> 
> 		with: [html image
> 					url:  DTRFileLibrary / #greenupGif ;
> 					altText: 'Incrementa';
> 					title:'Incrementa' ]
> 
> 	This intercept the single click,  	but how i can display the dialog after the callback if it return a wrong value?
> 
> 
> 	Thanks for considerations,
> 
> 		Dario
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20180313/1c91d315/attachment.html>


More information about the seaside mailing list