cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephan Niedermeier" <mailling-li...@logabit.com>
Subject JXForms+JXTemplates: Passing values
Date Sat, 06 Sep 2003 14:51:47 GMT
Hello,

I want to use JXForms for data binding and JXTemplate for displaying "non-form-datas". Is
there a way to pass other values to the template over my Flow Script using the function form.sendView("target")?
Now it seems to me, that only the form model can be passed to the template.

My Sitemap has the following lines:

...
<map:match pattern="">
      <map:call function="jxform">
        <map:parameter name="function" value="main"/>
        <map:parameter name="id" value="myForm"/>
     </map:call>
...
<map:match pattern="*.jxt">
      <map:generate type="jxt" src="documents/templates/{1}.jxt"/>
      <map:transform type="jxf" />
      <map:transform type="xalan" src="stylesheets/jxforms2html.xsl" />
      <map:serialize type="xhtml"/>
    </map:match>

My Flow Script:

cocoon.load("resource://org/apache/cocoon/components/jxforms/flow/javascript/JXForm.js");

function main(form) {

  // Model for the form
  var model = {"name" : "foo", "password" : "bar"};
  form.setModel(model);

  // How to pass this var into the template without using the setModel()???
  var someVar = "Hello Word!";
    
  form.sendView("listUsers.jxt");
}

Thank you!

Best regards
Stephan Niedermeier

Mime
View raw message