cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject CForms Selection-list: cannot replace user-selected item
Date Mon, 05 Sep 2005 11:55:07 GMT
Hi there,

I have a problem with CForms selection lists. What I am trying to do is 
the following:

The user selects a report name in a selection-list where the names are 
shown in human-readable form (e.g. "Money Statement"). I want to trigger a 
pdf processing pipeline, but my stylesheets have short names, e.g. the one 
for "Money Statement" is called "MT950MS.xsl". So this is what I want to 
include in my call to sendPage.

The problem is: This translation doesn't work, what is passed back by 
sendPage is always the string the user selected. In my flow script (see 
below) I translate the long name using a function 
        var mt = chooseMessageType(model.reportType);
Then I define the hash used in my call to sendPage:
        var bizdata = { "reportType" : mt, "account" : model.account, 
"reportDate" : model.reportDate }
Finally, the call to sendPage:
          cocoon.sendPage("create", bizdata);

What have I done wrong?

I am using Cocoon-2.1.7 with Jetty on Windows 2000.

The relevant portions of my Cocoon application are as follows:

Form Definition:

    <fd:field id="reportType" required="true">
      <fd:label>Report type:</fd:label>
      <fd:datatype base="string"/>
      <fd:selection-list id="reportType" required="true">
        <fd:item value="Monthly Interest Scales"/>
        <fd:item value="Money Statement"/>


function chooseMessageType (longName) {
  var ret="";
  switch (longName) {
    case "Monthly Interest Scales":
    case "Money Statement":
  return ret;

function reportSelection() {
  var url = "forms/selectReport.xml";
  var form = new Form(url);
  var model = form.getModel();
  var mt = chooseMessageType(model.reportType);
  var bizdata = { "reportType" : mt, "account" : model.account, 
"reportDate" : model.reportDate }
  cocoon.sendPage("create", bizdata);

      <map:match pattern="create">
        <map:serialize type="fo2pdf"/>

Kind Regards
José Diaz Seng
View raw message