Ejemplo n.º 1
0
 @UiHandler("importButton")
 public void onImportClicked(SelectionEvent<Item> event) {
   if (deviceCombo.getValue() == null) {
     new AlertMessageBox(i18n.error(), i18n.errFillFields()).show();
   } else {
     new ImportDialog(deviceCombo.getValue()).show();
   }
 }
Ejemplo n.º 2
0
  @UiHandler("gpxButton")
  public void onGPXClicked(SelectionEvent<Item> event) {
    if (deviceCombo.getValue() == null) {
      new AlertMessageBox(i18n.error(), i18n.errFillFields()).show();
    } else {
      DateTimeFormat jsonTimeFormat =
          ApplicationContext.getInstance().getFormatterUtil().getRequestTimeFormat();

      Window.open(
          "/traccar/export/gpx"
              + "?deviceId="
              + (deviceCombo.getValue() == null ? null : deviceCombo.getValue().getId())
              + "&from="
              + jsonTimeFormat.format(getCombineDate(fromDate, fromTime)).replaceFirst("\\+", "%2B")
              + "&to="
              + jsonTimeFormat.format(getCombineDate(toDate, toTime)).replaceFirst("\\+", "%2B")
              + "&filter="
              + !disableFilter.getValue()
              + "&snapToRoads="
              + snapToRoads.getValue(),
          "_blank",
          null);
    }
  }