(it was in Sylvain's presentation at the last Cocoon Gettogether)
try the following: 1/ let the form submit to the same uri: <form action="" method="POST" />
2/ add the continuation-id as a <input type="hidden" name="continuation-id" value="9837491871342" />
depending on what you use for templating-formhandling you achieve this with one of
- cforms: <ft:continuation-id>
- xslt: parameter filled in by the FlowContinuationModule (scratchpad block)
- jx: #{$cocoon/continuation/id}
3/ adjust your sitemap to handle both start-function and continuations under the same URI by selecting on GET/POST
<map:match pattern="uri-pointing-to-functionX"> <map:select type="method"> <!-- GET : start the flow for this screen --> <map:when test="GET"> <map:call function="X"/> </map:when> <!-- POST (form submission) : continue the flow --> <map:when test="POST"> <map:call continuation="{request-param:continuation-id}"/> </map:when> </map:select> </map:match>
like this, the referer should keep on pointing to the same URL, which when applied in the GET form just starts the flowscript again
(well, I haven't tried above but I can't see a reason why it shouldn't just work)
oh, even before the ack that above is working or not:
this approach will REQUIRE that your script gets used in this setup, you should clearly indicate (comment) that the more common *.continue approach is not to be used
HTH, -marc=
leo leonid wrote:
Hi all,
For a dynamic Site with lots of customization I had the following in mind:
1. User must not be redirected when/after changing some settings 2. User may change settings anywhere and anytime he wants to. 2. Changes are applied immediately. (no confirm, or reload)
I reached all these objectives with the following lines of flowscript.
This makes the user transparently reentering his current page, but with the new settings already applied.
function setUserLanguage() { saveToCustomSettings(cocoon.request.get("language"); cocoon.redirectTo(cocoon.request.getHeader("referer")); }
Since I consequently use POST to pass my application data, this looks like a very simple solution, *but* only as long as you don't have to deal with continuations. At this continuations behave quite different. The one I obtain by referer is not the one I expected, and may cause data being resubmitted.
Im sure there must be a solution, probably you can handle this with continuations even more exactly, but I need some hints...
/leo
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Marc Portier http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center Read my weblog at http://blogs.cocoondev.org/mpo/ [EMAIL PROTECTED] [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]