Hi,

I have this bit of flow script:

function myFunction() {
var form = new Form(formDef);
form.createBinding(formBind);
var success = false;
var errMsg = "";
var count = 0; // to prevent endless loops
while(!success && count < 10) {
   try {
      form.load(myForm);
        var viewData = { some: data, errMsg: errMsg };
        form.showForm(formDisplayPipeline, viewData);
        form.save(myForm);
      success = myHelper.storeNewForm(myForm);
   }
   catch(error) {
      errMsg = "other error: " + error;
        print(errMsg);
        success = false;
   }
   count++;
}
cocoon.sendPage("displayResult");
}

FormDisplayPipeline points to a pipeline:

<map:generate type="jx" src="myTemplate.jx"/>
<map:transform type="cinclude"/>
<map:transform type="forms"/>
<map:transform src="stylesheets/resources/forms-samples-styling.xsl">
   <map:parameter name="uri" value="stylesheets/resources"/>
</map:transform>
<map:call resource="html-layout"/>
<map:serialize type="html"/>

The above works ok. However, when something happens errMsg is set and the
loop starts from the top, but rather than redisplaying the form, I get an
error message stating 'Generator already set'. This repeats until count==10.

What should I do to redisplay the form properly with error message?

Thanks.

Bye,
Helma van der Linden

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

Reply via email to