[jifty-devel] Continuations and Actions
Alex Vandiver
alexmv at bestpractical.com
Wed Mar 26 11:15:28 EDT 2008
On Wed, 2008-03-26 at 14:33 +0000, Mikko Lipasti wrote:
> Let 'search' be a page with a SearchThing action, a form for it and a
> section which prints out search results. Each search result has a
> tangent link to 'detail' page about that "thing". 'detail' page has a
> "return" link.
>
> When I click return, 'search' page is loaded but SearchAction has lost
> its args, which is kind of counter-intuitive, assuming I'm not
> completely in mistaken about the purpose of continuations.
You're not mistaken about the purpose, merely the implementation. Jifty
doesn't make continuations for every page, only when a user clicks on a
link. Here's what Jifty is doing right now:
1. 'search' page with results
2. -> click link
3. 'search' page is reloaded (probably without results)
4. -> continuation saved
5. -> redirected to 'detail' page
6. 'detail' page is shown
7. -> click link
8. -> continuation loaded
9. -> redirected to 'search' page (probably without results)
10. 'search' page without results
The difficulty is that you're expecting the steps to happen in the
order:
1. 'search' page with results
4. -> continuation saved
2. -> click link
5. -> redirected to 'detail' page
6. 'detail' page is shown
7. -> click link
8. -> continuation loaded
9. -> redirected to 'search' page
10. 'search' page
This is what, for example, Seaside would do. Jifty doesn't do this by
default because it would mean continuations would pile up, one for every
page. You *can* do this if you want, but the way we generally suggest
is rather:
1. 'search' page with results
2. -> click link
2.5. -> also submit the search action with the link
3. 'search' page is reloaded (with results of action)
4. -> continuation saved
5. -> redirected to 'detail' page
6. 'detail' page is shown
7. -> click link
8. -> continuation loaded
9. -> redirected to 'search' page (with results of action)
10. 'search' page
Does that make sense?
- Alex
More information about the jifty-devel
mailing list