[Seaside] Fetching GET parameters from a Seaside component.

Sebastian Sastre sebastian at flowingconcept.com
Tue Oct 26 13:39:55 UTC 2010


I'd use a js function installed in the (wrapper div of the) element that corresponds to the component. And that function will make a request that can run a normal seaside callback.

I use prototype so a function to change the state of the component (i.e: closing it) it would look like:


AnOpennableClosable>>beClosedFunctionOn: html 
	^ JSFunction new
		add: (html prototype request
				callback: [self beClosed ];
				yourself);
		yourself

But you want a value so you can use the request's callback:value: like this:

AnOpennableClosable>>beClosedFunctionOn: html 
	^ JSFunction new
		add: (html prototype request
				callback: [:val| someState := val] value: 'navigate.to().whereverTheValue[is]' asJSObject;
				callback: [self beClosed ];
				yourself);
		yourself

BTW, observing some custom event and make it react with that, is something that usually rocks

have fun

sebastian





On Oct 25, 2010, at 6:14 PM, Thomas McCune wrote:

> I am calling a Seaside component from JavaScript with one parameter. Does
> anyone know how to fetch the parameters in a component? Based upon
> some documentation on the net I have tried the following without success:
>  
> time:=self session fieldsAt: #time.
>  
> Thanks.
> _______________________________________________
> 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/20101026/6759d65b/attachment.htm


More information about the seaside mailing list