action with argument

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

action with argument

Hilaire Fernandes-2
is it possible to have action method with argument (object)?
If no,  how do you usualy handle the situation when you need to pass
argument ?

I saw #text:linkTo:parameter:value: but not canonical examples
--
CDDP des Landes
Ingénierie éducative
BP401 - 614, rue du ruisseau
40012 Mont de Marsan cedex
T 05 58 75 50 10
F 05 58 06 29 18
http://crdp.ac-bordeaux.fr/cddp40

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: action with argument

Janko Mivšek
Hi Hilaire,

Hilaire Fernandes pravi:

> is it possible to have action method with argument (object)?
> If no,  how do you usualy handle the situation when you need to pass
> argument ?
>
> I saw #text:linkTo:parameter:value: but not canonical examples

Yes, you pass additional parameters in URLs in such case. For instance,
if you like to add some unique identifier (uuid) to the link:

e addLinkTo: self observee view: #byUuid
        parameter: 'uuid' value: someObject uuid

Then in #viewByUuid read this value from request:

MyApp>>viewByUuid
        ...
        uuid := self session lastRequest queryAt: 'uuid'
        object := self observee objectWithUuid: uuid.
        ...

You can read such values from request in action methods or elsewhere too.

Best regards
Janko


--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida