Fetching GET parameters from a Seaside component.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Fetching GET parameters from a Seaside component.

Thomas McCune
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
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Fetching GET parameters from a Seaside component.

Johan Brichau-2
The GET params are in the request. Try this:

self requestContext request at: #time

On 25 Oct 2010, at 22:14, 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
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Fetching GET parameters from a Seaside component.

Ramon Leon-5
On 10/25/2010 1:39 PM, Johan Brichau wrote:
> The GET params are in the request. Try this:
>
> self requestContext request at: #time

You should use strings rather than symbols for accessing those.

self requestContext request at: 'time'

They're actually keyed by strings in the request.  Strings and sybmols
are not equivalent on all platforms, particularly Gemstone.  Access by
string will be portable.  That's not a bug you want to be bitten by
because it's not at all obvious.

--
Ramon Leon
http://onsmalltalk.com
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Fetching GET parameters from a Seaside component.

EstebanLM
In reply to this post by Thomas McCune
As an alternative, you may want to override #initialRequest: in your component.

cheers,
Esteban

On 2010-10-25 17:14:37 -0300, "Thomas McCune" <[hidden email]> said:

>
>
>
>
> 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:=3Dself session fieldsAt: #time.
>
> Thanks.
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META content=3D"text/html; charset=3Diso-8859-1" =
> http-equiv=3DContent-Type>
> <META name=3DGENERATOR content=3D"MSHTML 8.00.6001.18975">
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=3D#ffffff>
> <DIV><FONT size=3D2 face=3DArial>I am calling a Seaside component from =
> JavaScript=20
> with one parameter. Does</FONT></DIV>
> <DIV><FONT size=3D2 face=3DArial>anyone know how to fetch the parameters =
> in a=20
> component? Based upon</FONT></DIV>
> <DIV><FONT size=3D2 face=3DArial>some documentation on the net I have =
> tried the=20
> following without success:</FONT></DIV>
> <DIV><FONT size=3D2 face=3DArial></FONT>&nbsp;</DIV>
> <DIV><FONT size=3D2 face=3DArial>time:=3Dself session fieldsAt: =
> #time.</FONT></DIV>
> <DIV><FONT size=3D2 face=3DArial></FONT>&nbsp;</DIV>
> <DIV><FONT size=3D2 face=3DArial>Thanks.</FONT></DIV></BODY></HTML>
>
>
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Fetching GET parameters from a Seaside component.

sebastianconcept@gmail.co
In reply to this post by Thomas McCune
<base href="x-msg://89/">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






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
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside