cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cocoon.er...@besonet.ch
Subject How to set filename of csv file
Date Wed, 01 Apr 2009 06:45:42 GMT
  BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px;
}Hello, 
 in my application if a page, where a search can be performed and the
result is shown on the same page in form of a list.
 On the page, the user has a button (action widget) that returns him
the search result as a csv file. That's not a problem, this works. The
problem I have is the filename. The file is named as the current page
is. Somesing crypted with continuation id and .continue at die end.
Can I set the name of the file, the csv is serialized to the user?
 Here my current code:
 flowscript:
 list() {
       //some code 
       var form = new Form("pages/form/list_model.xml");
       form.createBinding("pages/form/list_binding.xml");
       while(true) {
             form.load(to);
             form.showForm("list.form", {
                   itemList:itemList
             });
             form.save(to);
             var action = form.submitId;
             if ("search".equals(action)) {
                   itemList =
BridgeFactory.getInstance().getDummyBridge().search(context, to);
             } else if ("resetButton".equals(action)) {
                   to = new SearchTO();
                   itemList = null;
             } else if ("csv".equals(action)) {
                   cocoon.sendPage("list.csv", {itemList:itemList});
                   break;
             }
       }
 }
 sitemap:
     ISO-8859-1
     yes
 Thanks, 
 Mike
  
Mime
View raw message