Re: CForm field selection-list: "displayed" vs. "selected" values

2005-09-05 Thread Jose . Diaz . Seng

Jason, thank you very much for your
quick reply. It solved the problem. I will try out the other possibility
too (using the flow-attr: module).


I felt my first message was too long
and not to-the-point, so I sent another request. Your response to my first
thread arrived seconds after that.

Regards
José Diaz Seng

CForm field selection-list: "displayed" vs. "selected" values

2005-09-05 Thread Jose . Diaz . Seng

Hi,

what's the best way to map the values
selectable by a user in a selection-list to other values (e.g. in selection-list
we have "human-readable" values, we want to map them to "internal"
values)?

Thanks in advance.
Cheers

Re: CForms Selection-list: cannot replace user-selected item

2005-09-05 Thread Jose . Diaz . Seng

I don't know why Lotus Notes mixes up
my emails this way. So here's one more try:

Sitemap:



    
        XML_{request-param:account}_{request-param:reportDate}.xml"/>
    
    



Re: CForms Selection-list: cannot replace user-selected item

2005-09-05 Thread Jose . Diaz . Seng

sorry, my mail program chopped off part
of the sitemap definition. The relevant part should read as follows:


    
           
   XML_{request-param:account}_{request-param:reportDate}.xml"/>
    
    


CForms Selection-list: cannot replace user-selected item

2005-09-05 Thread Jose . Diaz . Seng

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

"chooseMessageType":
        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:


  
    
      Report
type:
      
      
        
        
...
      
    

---
Flow:

cocoon.load("resource://org/apache/cocoon/forms/flow/_javascript_/Form.js");

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

  }
  return ret;
}

function reportSelection() {
  var url = "">
  var form = new Form(url);
  form.showForm("reportSelection");
  var model = form.getModel();
  var mt = chooseMessageType(model.reportType);
  var bizdata = { "reportType"
: mt, "account" : model.account, "reportDate" : model.reportDate
}
  cocoon.sendPage("create",
bizdata);
}
---
Sitemap:

      
        
        
        
      


Kind Regards
José Diaz Seng