Vadim Gritsenko wrote:
Ok, here is simple one. Forms wizard for editing any XML/bean containing repeating information, with back/forward navigation, and navigation bar to jump to any previous page. For a concrete example of the usecase, let's look at editing family information, and information about each member. First page, "family", will have repeater which you can populate with names of family members. After filling out first page, let's go through each member and show "member" page. This can look like:
<snip/>
What I do in these cases (not for forms but for paged displays) is more or less like the following:
var page = 0; var numPages = ...; // Total number of pages while (true) { cocoon.sendPageAndWait("uri", { "bizData" : beans[page] }); page = newPage(page, numPages, cocoon.request.cmd); }
Well, you are using the same workaround which I used for saving "back" parameter - save variable value by placing it into function call parameters. It works, but it is a workaround, and when there is more than one variable to save (in your case it is just "page" variable), things are getting very messy.
Vadim
