[aida] action with argument

Janko Mivšek janko.mivsek at eranova.si
Tue Feb 17 11:04:45 CET 2009


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


More information about the Aida mailing list