ZongoZongo wrote:
Hi

Inside the flow I get the formtemplate and the formdefinition from a
javamethod as an org.w3c.dom.Document stream. How can I use this streams to:
-  generate the form

I believe you can pass a DOM element to the Form flowscript constructor:

var form = new Form(myFormDocument.getDocumentElement());

-  call the formtemplate

What you need here is a way to use the DOM Document as input to the JX generator. The xmodule source allows you to stream a DOM from an input module, for instance using the flow-attribute module:

(flowscript:)
form.showForm("display-pipeline", {dom : myJXDocument});

(sitemap:)
<map:match pattern="display-pipeline">
  <map:generate type="jx" src="xmodule:flow-attr:dom" />
  ...


Now, you should be aware that while this sort of setup is certainly possible, there will be a performance penalty. First of all, using a DOM object to build the form definition prevents the caching of that definition that usually takes place. Similarly, the JX template cannot be precompiled and cached so it has to recompile the template each time. You'll have to determine if that performance penalty is worth it for your particular case.

Hope that helps
--Jason

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

Reply via email to