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:[email protected]] 
Sent: dinsdag 27 januari 2009 13:09
To: [email protected]
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: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to