[Seaside] User input and component state update via GET
Lukas Renggli
renggli at gmail.com
Mon Jun 29 17:04:57 UTC 2009
> However, because I retain the _s and _k parameters, I can't use
> #initialRequest to parse the 'barcodeno' parameter from the GET
> request. This isn't quite the same as the problems that Ramon Leon
> addressed in his 'Clean URLs' and 'Stateless Sitemap' articles.
> Essentially, I need a regular session/continuation-based Seaside app,
> with a couple of components that capture input via GET, but which
> still allow a call/answer approach.
Have a look at the implementation of WATask>>updateRoot:. Instead of
doing a redirect you just create your meta-tag. And you replace the
callback block with the code that handles the request.
I would try something along the following lines:
updateRoot: aHtmlRoot
| callbacks url |
callbacks := WACallbackRegistry context: aHtmlRoot context owner: self.
url := aHtmlRoot context actionUrl withParameter: (callbacks
registerActionCallback: [ self metaHandler ]).
aHtmlRoot
responseHeaderName: 'scannernavigate';
content: url asString ,
'&barcodeno=%s&Source=%s&Type=%s&Time=%s&Length=%s'
metaHandler
| request id |
request := self session currentRequest.
id := request at: 'barcodeno' ifAbsent: [ ^ self inform: 'Error' ].
self call: (BCProductView on: id)
Does that help?
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch
More information about the seaside
mailing list