private String exportCsv() {
    AcPageSession ps = getPageSession();
    Integer sourceId = ps.getInternationalRequestedRouteSourceId();
    JwDate startUtcDt = ps.getInternationalRouteBlockStartUtcDt();
    JwDate endUtcDt = ps.getInternationalRouteBlockEndUtcDt();
    String originAirport = ps.getInternationalRequestedRouteDetailsOriginAirportCode();
    String destinationAirport = ps.getInternationalRequestedRouteDetailsDestinationAirportCode();
    JwTime departureLocalTm = ps.getInternationalRequestedRouteDetailsDepartureLocalTm();
    JwTime arrivalLocalTm = ps.getInternationalRequestedRouteDetailsArrivalLocalTm();
    JwList<AcUspsInternationalRequestedRoute> v =
        getInternationalRequestedRoutes(
            sourceId,
            startUtcDt,
            endUtcDt,
            originAirport,
            destinationAirport,
            departureLocalTm,
            arrivalLocalTm);

    _grid.setList(v);
    _grid.clearExportCriteria();
    _grid.addExportCriteria("Block Start", formatDt(startUtcDt));
    _grid.addExportCriteria("Block End", formatDt(endUtcDt));
    _grid.addExportCriteria("Origin", originAirport);
    _grid.addExportCriteria("Departure", formatTm(departureLocalTm));
    _grid.addExportCriteria("Destination", destinationAirport);
    _grid.addExportCriteria("Arrival", formatTm(arrivalLocalTm));
    return _grid.exportCsv();
  }
  public void preRender() {
    AcPageSession ps = getPageSession();
    JwDate startUtcDt = ps.getInternationalRouteBlockStartUtcDt();
    JwDate endUtcDt = ps.getInternationalRouteBlockEndUtcDt();
    AcGlobalUspsInternationalSubmissionBlock block = getBlock(startUtcDt, endUtcDt);

    Integer sourceId = ps.getInternationalRequestedRouteSourceId();
    String originAirport = ps.getInternationalRequestedRouteDetailsOriginAirportCode();
    String destinationAirport = ps.getInternationalRequestedRouteDetailsDestinationAirportCode();
    JwTime departureLocalTm = ps.getInternationalRequestedRouteDetailsDepartureLocalTm();
    JwTimestamp departureLocalTs = new JwTimestamp();
    departureLocalTs.setTime(departureLocalTm);
    JwTime arrivalLocalTm = ps.getInternationalRequestedRouteDetailsArrivalLocalTm();
    JwTimestamp arrivalLocalTs = new JwTimestamp();
    arrivalLocalTs.setTime(arrivalLocalTm);
    JwList<AcUspsInternationalRequestedRoute> v =
        getInternationalRequestedRoutes(
            sourceId,
            startUtcDt,
            endUtcDt,
            originAirport,
            destinationAirport,
            departureLocalTm,
            arrivalLocalTm);

    boolean hasBlock = block != null;
    _blockTitle.setVisible(hasBlock);
    _blockTitle.applyModel(block);
    _dateTitle.setVisible(!hasBlock);
    _dateStart.setValue(startUtcDt);
    _dateEnd.setValue(endUtcDt);

    _originAirport.setValue(originAirport);
    _destinationAirport.setValue(destinationAirport);
    _departureLocalTm.setValue(departureLocalTs);
    _arrivalLocalTm.setValue(arrivalLocalTs);

    _grid.setList(v);
  }
 @SuppressWarnings("unchecked")
 protected JwList<Integer> getSelectedRouteIds() {
   JwList<String> webKeys = (JwList<String>) _grid.getSelectedValues();
   JwList<Integer> routeIds = AcUspsInternationalRequestedRouteTools.getIdsFromWebKeys(webKeys);
   return routeIds;
 }
  private ScControl createGrid() {
    AcUspsInternationalRequestedRouteTools x = AcUspsInternationalRequestedRouteTools.instance;

    _grid = new ScCheckboxGrid<AcUspsInternationalRequestedRoute>();
    _grid.setCheckboxValueAdaptor(x.getWebKeyAdaptor());
    _grid.setExportCommand(newExportCommand());
    _grid.addColumn(x.newRouteBeginUtcDtColumn("Start"));
    _grid.addColumn(x.newRouteEndUtcDtColumn("End"));
    _grid.addColumn(x.newInitialFrequencyColumn("Proposed Frequency"));
    _grid.addColumn(
        x.newInitialMinimumCapacityColumn(
            x.newInternationalWeightTitleAdaptor("Desired Minimum Capacity")));
    _grid.addColumn(
        x.newInitialMaximumCapacityColumn(
            x.newInternationalWeightTitleAdaptor("Desired Maximum Capacity")));
    _grid.addColumn(x.newProductTypeColumn("Product Type"));
    _grid.addColumn(x.newDemandCategoryColumn("Demand Category"));
    _grid.addColumn(x.newStatusDisplayLabelColumn("Status"));
    _grid.addColumn(
        x.newColumnLink()
            .appendWebKeyLink("Add to Candidate Routes", newAddCommand(), null, false));
    return _grid;
  }