cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agssa.net>
Subject Re: Endless Looping in Flow
Date Wed, 03 Nov 2004 00:23:05 GMT
Hi Brent!

Another option is to not use a loop. See between lines:

Brent Johnson dijo:
> I've got a page where the user can modify something (the title of an
> XML document in this case).  Here's what I'm doing in the flowscript:
>
> function showLayoutListPage() {
>     var page = cocoon.parameters.page;
>
>     if (isLoggedIn()) {
>
         while (true) { // remove this line
>             cocoon.sendPageAndWait("content/" + page + ".html", {
> "page" : page, "user" : cocoon.session.getAttribute("user"), "layouts"
> : getLayoutList() });
>
>             var action = cocoon.request.get("doit");
>             var filename = cocoon.request.get("filename");
>
>             if (action == "setTitle") {
>                 // set the title for the layout
>                 var layout = getLayoutByFilename(filename);
>                 layout.setTitle(cocoon.request.get("title"));
>                 layout.save();
>             }
         }   // remove this line
          // Add a sendPage to the initial link
          cocoon.sendPage("my_initial_link");
>
>     } else {
>         cocoon.redirectTo("/public/index.html");
>     }
> }

That way you can avoid the loop. Also you can invalidate the continuation
once it is over.

Best Regards,

Antonio Gallardo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message