cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <>
Subject RE: JX / Flowscipt variable not accessible in generated form?
Date Fri, 30 Jan 2009 06:56:37 GMT
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">

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" />


>>> On 2009/01/27 at 02:53, in message <7C655C04B6F59643A1EF66056C0E095E01EC01A6@eusex01.sweden.ecsoft>,
"Robby Pelssers" <> wrote:
Hi Derek,

How do you call your flowscript in the sitemap?

One way you could implement this:

  {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:match pattern="db/formtemplate/*">
  <map:generate src="forms/{1}_defn.xml" type="jx">


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");

Robby Pelssers

-----Original Message-----
From: Derek Hohls [] 
Sent: dinsdag 27 januari 2009 13:09
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",

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?


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

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:
For additional commands, e-mail:

View raw message