Changeset 2737 for branches/2.0.1/www


Ignore:
Timestamp:
Oct 17, 2006, 8:53:20 AM (16 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #396: Generic export function doesn't work when column names has a comma in them

Location:
branches/2.0.1/www
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0.1/www/common/export/submit_export.jsp

    r2304 r2737  
    113113final Item itemType = Item.valueOf(request.getParameter("item_type"));
    114114final String subContext = Values.getString(request.getParameter("subcontext"), "");
    115 final String[] properties = request.getParameter("properties").split(",");
    116 final String[] titles = request.getParameter("titles").split(",");
     115final String[] properties = request.getParameterValues("property");
     116final String[] titles = request.getParameterValues("title");
    117117final String which = request.getParameter("which");
    118118final boolean asXml = "xml".equals(request.getParameter("format"));
     
    175175    query.setFirstResult(0);
    176176    query.setMaxResults(0);
    177     Integer[] itemIds = Values.getInt(request.getParameter("items").split(","));
     177    Integer[] itemIds = Values.getInt(request.getParameterValues("item"));
    178178    query.restrict(
    179179      Restrictions.in(
  • branches/2.0.1/www/plugins/net/sf/basedb/clients/web/plugins/simple_export.jsp

    r2408 r2737  
    203203        return;
    204204      }
    205       frm.properties.value = exportedProperties.join(',');
    206       frm.titles.value = getExportedColumnTitles().join(',');
    207       frm.items.value = getSelectedItems().join(',');
     205      for (var i = 0; i < exportedProperties.length; i++)
     206      {
     207        Forms.createHidden(frm, 'property', exportedProperties[i]);
     208      }
     209      var exportedTitles = getExportedColumnTitles();
     210      for (var i = 0; i < exportedTitles.length; i++)
     211      {
     212        Forms.createHidden(frm, 'title', exportedTitles[i]);
     213      }
     214      if (Forms.getCheckedRadio(frm.which).value == 'selected')
     215      {
     216        var selectedItems = getSelectedItems();
     217        for (var i = 0; i < selectedItems.length; i++)
     218        {
     219          Forms.createHidden(frm, 'item', selectedItems[i]);
     220        }
     221      }
     222     
    208223      frm.action = getRoot()+'common/export/submit_export.jsp';
    209224      if (frm.path.value == '')
     
    230245    <input type="hidden" name="item_type" value="<%=itemType.name()%>">
    231246    <input type="hidden" name="subcontext" value="<%=subContext == null ? "" : subContext%>">
    232     <input type="hidden" name="properties" value="">
    233     <input type="hidden" name="titles" value="">
    234247    <input type="hidden" name="items" value="">
    235248   
Note: See TracChangeset for help on using the changeset viewer.