[Seaside] Ajax and error management

Boris Popov, DeepCove Labs boris at deepcovelabs.com
Mon May 16 21:29:03 UTC 2011


WARenderCanvas builder render: 
		[:html |
		(html anchor)
			onClick: (html javascript alert: 1);
			with: 'click me']

'<a onclick="alert(1)" href="javascript:void(0)">click me</a>'

WARenderCanvas builder render: 
		[:html |
		(html anchor)
			onClick: (html javascript alias: 'console';
call: 'log' withArguments: #(1 2 3));
			with: 'click me']

'<a onclick="console.log(1,2,3)" href="javascript:void(0)">click me</a>'

-Boris

-----Original Message-----
From: seaside-bounces at lists.squeakfoundation.org
[mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of Thierry
Thelliez
Sent: 16 May 2011 16:19
To: Seaside - general discussion
Subject: Re: [Seaside] Ajax and error management

ok thanks. Almost there...

Now I am trying to figure out how to pass arguments to a Javascript
function.

onError: is supposed to pass three parameters.  But the alert test below
generates double quotes around 'Arg1 =' + arg1. Is there a different way
to generate a JS function from Seaside?


html div
     id: (html nextId);
      script: (html jQuery new dialog
               onOpen:	(html jQuery ajax html: myComponent;
                                              onComplete:   ( JSFunction
new
		                                            arguments:
(Array with:
'arg1' with: arg2 with: 'arg3');
		                                           add:
(JSStream new
				                    nextPutAll: 'alert';
				                    argument: '''Arg1 =
'' + arg1';
				                   yourself);
		                                        yourself));




Thanks,
Thierry
_______________________________________________
seaside mailing list
seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


More information about the seaside mailing list