Hi everyone,

I'm still having problems implementing a cforms-based coplet in flowscript, and I think maybe in previous messages to this list I've not been very clear as to what my problem is, so I'm going to try again. :-)

Lets say I have a form that lets the user update their details. Pseudo-flow-code would be:

function show(form) {
  populate(form);
  form.showForm("display-pipeline");
  saveToDB(form);

  cocoon.sendPage("success-pipeline");
}

So the coplet starts off by displaying an "update your details" form, then when you click submit it says "updates saved" or something.

In order for it to work properly with the portal engine, it is a CachingURICoplet. This means that if you switch away to a different tab in the site, then back again, the coplet will load from the cache. This is normally what you want, except after you've displayed the final page ("Your updates have been saved to the database") you actually want it to reset itself, so that the next time the portal needs to render the coplet it regenerates itself from scratch. Otherwise you update your details once, and after that you always get the "success" page.

I can fudge it by changing the flowscript to a while(true){} loop, and rendering the success page with sendPageAndWait, and putting a "Make another change" button on the success page. But that user interface needs taking out and shooting. :-) What I want to be able to do is:

function show(form) {
  populate(form);
  form.showForm("display-pipeline");
  saveToDB(form);

  cocoon.sendPage("success-pipeline");
  reset();
}

function reset() {
  // this is pseudo code remember!
  thisCoplet.reset();
  thisCoplet.clearCache();
  // Now the next time this coplet is displayed,
  // it will be generated from scratch as if it
  // had never been displayed before
}


Also, I'm still looking for a code snippet that would let me do this from my flowscript:


var myValue = thisCoplet.get("attributes/myValue");
// where myValue is defined in my copletdata/portal.xml file

Thanks,

Jon


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to