Sending parameters to a component through url parameters

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

Sending parameters to a component through url parameters

om-5
Hi,

1) Is it possible to send parameters to a component by adding parameters to it's
entry point url?

For exemple : http://localhost:8008/seaside/go/myApp?year=2001
which would pass a 'year' parameter to myApp.


2) Can my component know by which entry point url he has been launched? (In the
case I created multiple entry points for the same component).

Thanx for your help ;)

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

RE: Sending parameters to a component through url parameters

Bany, Michel
Hi om,


> 1) Is it possible to send parameters to a component by adding
> parameters to it's entry point url?
>
> For exemple : http://localhost:8008/seaside/go/myApp?year=2001
> which would pass a 'year' parameter to myApp.


You will need to implement #initialRequest: in your component.


> 2) Can my component know by which entry point url he has been
> launched? (In the case I created multiple entry points for
> the same component).

You may want to play with
        self session application basePath.
or
        self session currentRequest url.

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

Re: Sending parameters to a component through url parameters

Damien Cassou-3
Bany, Michel a écrit :

> Hi om,
>
>
>> 1) Is it possible to send parameters to a component by adding
>> parameters to it's entry point url?
>>
>> For exemple : http://localhost:8008/seaside/go/myApp?year=2001
>> which would pass a 'year' parameter to myApp.
>
>
> You will need to implement #initialRequest: in your component.
>
>
>> 2) Can my component know by which entry point url he has been
>> launched? (In the case I created multiple entry points for
>> the same component).
>
> You may want to play with
> self session application basePath.
> or
> self session currentRequest url.

In your component, you can use #fieldsAt: to get a value.

If you component has been rendered with :
http://localhost:8008/seaside/go/myApp?year=2001

in your component, you can:

MyAppComponent>>renderContentOn: html
...
html paragraph: 'in the year', (self fieldsAt: 'year')
...


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