diff --git a/src/main/java/org/traccar/web/client/controller/ReportsController.java b/src/main/java/org/traccar/web/client/controller/ReportsController.java index 309f63d3..a9117eae 100644 --- a/src/main/java/org/traccar/web/client/controller/ReportsController.java +++ b/src/main/java/org/traccar/web/client/controller/ReportsController.java @@ -21,6 +21,7 @@ import com.google.gwt.user.client.ui.FormPanel; import com.google.gwt.user.client.ui.Hidden; import com.google.gwt.user.client.ui.HorizontalPanel; +import com.google.gwt.user.client.ui.RootPanel; import com.sencha.gxt.data.shared.ListStore; import org.traccar.web.client.i18n.Messages; import org.traccar.web.client.model.BaseAsyncCallback; @@ -105,6 +106,7 @@ public void onGenerate(Report report) { private void generate(Report report) { FormPanel form = new FormPanel("_blank"); + form.setVisible(false); form.setAction("traccar/report"); form.setMethod(FormPanel.METHOD_POST); form.setEncoding(FormPanel.ENCODING_URLENCODED); @@ -112,6 +114,11 @@ private void generate(Report report) { container.add(new Hidden("report", reportMapper.write(report))); container.add(new Hidden("locale", LocaleInfo.getCurrentLocale().getLocaleName())); form.add(container); - form.submit(); + RootPanel.get().add(form); + try { + form.submit(); + } finally { + RootPanel.get().remove(form); + } } }