Thanks Robby Exactly what I needed - the only part that was different for me was here:
<map:match pattern="db/formtemplate/*"> <map:generate src="forms/{1}_defn.xml" type="jx"> </map:match> as I already I had a match for generating the form (the above fragment is any case incomplete); i.e. <map:match pattern="db/forms/*"> <map:generate src="tables/{1}_defn.xml" type="jx"> <map:transform src="stylesheets/forms/reformat.xsl"> <map:serialize type="xml" /> </map:match> Derek >>> On 2009/01/27 at 02:53, in message >>> <7c655c04b6f59643a1ef66056c0e095e01ec0...@eusex01.sweden.ecsoft>, "Robby >>> Pelssers" <robby.pelss...@ciber.nl> wrote: Hi Derek, How do you call your flowscript in the sitemap? One way you could implement this: SITEMAP --------------- <!-- {1} formname {2} state --> <map:match pattern="db/forms/*/*"> <map:call function="createform"> <map:parameter name="formname" value="{1}"/> <map:parameter name="state" value="{2}"/> </map:call> </map:match> <map:match pattern="db/formtemplate/*"> <map:generate src="forms/{1}_defn.xml" type="jx"> </map:match> Formutil.js --------------- function createform() { var formname = cocoon.parameters.formname; var state = cocoon.parameters.state; cocoon.sendPage("db/formtemplate/" + formname, { "state" : state } ); } From your flowscript you create the form: var editCountryDataForm = new Form("cocoon:/db/forms/country/output"); Cheers, Robby Pelssers -----Original Message----- From: Derek Hohls [mailto:dho...@csir.co.za] Sent: dinsdag 27 januari 2009 13:09 To: users@cocoon.apache.org Subject: JX / Flowscipt variable not accessible in generated form? Using Cocoon 2.1.8 I am generating a form definition from flowscript: var editCountryDataForm = new Form("cocoon:/db/forms/country", {"state":"output"});//dynamic And generating it thus via the pipeline: <map:match pattern="db/forms/*"> <map:generate src="forms/{1}_defn.xml" type="jx"> And in the country_defn.xml (form) file I have: <fd:field id="Code" required="true" state="${state}"> <fd:label>Country Code *${state}*</fd:label> But the "state" value never shows up at all in the resulting form, even when using different values in the flowscript, and the state of the field shows up as a "normal" form element. I'm sure I am missing something simple... but what? Thanks Derek -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org