[Seaside] Read two values ( width @ height ) with only one declaration

dtrussardi at tiscali.it dtrussardi at tiscali.it
Sat Jan 4 17:06:46 UTC 2014


Thank Johan,


> You will need to construct a valid javascript expression in the argument passed after #value:.

	i do some attempts but i don't find the right solution.
	In my smalltalk image i don't find a valid example how i can concatenate two value with a separator.

	Any reference ?

> Alternatively, try using the #callback:json: method to transfer multiple values:
> 
> (html jQuery ajax
>  	callback: [ :dict | dict inspect ]
>   	json: (JSStream on: '{ "width": $(this).width, "height": $(this).height}')
> 

	I test this but the	 dict inspect   return an empty dictionary.

	I add the		 anHtmlRoot javascript 
						url: JSJsonDeploymentLibrary / #json2Js

	but with Safari  and Firefox don't work.

	Ciao,

		Dario
	
> Hope this helps
> Johan
> 
> On 04 Jan 2014, at 17:03, dtrussardi at tiscali.it wrote:
> 
>> Hi,
>> 
>> 	i need to read two parameters  ( width @ height )  relative to  a DIV element.
>> 
>> 	For now i use this declarations:
>> 	
>> 		
>> 		html div class: 'topSide';
>> 			" read width "	
>> 				onClick: (html jQuery ajax
>>  							   callback: [ :x | x inspect ]
>>   							   value:  (html jQuery this width)).
>> 	
>> 			"raed height "
>> 				onClick: (html jQuery ajax
>>  							   callback: [ :x | x inspect ]
>>   							   value:  (html jQuery this height)).
>> 
>> 
>> 	Now my question is:
>> 
>> 		i can read the two values with only one declaration?
>> 
>> 		How i can define the 		value: ( html jQuery this width................ '@' ............... html jQuery this height )
>> 
>> 
>> 			 for concatenated  the two values and return a string in form of string Point:	'200 at 400'
>> 
>> 	
>> 		I declared :   		value: ( html jQuery this width, '@' , html jQuery this height )
>> 
>> 			but it don't work.
>> 
>> 	Considerations?
>> 
>> 
>> 		Thanks,
>> 
>> 			Dario_______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list