added setVisible to Export button

This commit is contained in:
Francesco Mangiacrapa 2024-05-03 11:41:34 +02:00
parent aa8a9c931f
commit 269592914f
2 changed files with 39 additions and 51 deletions

View File

@ -107,6 +107,8 @@
@ -237,6 +239,8 @@
@ -367,6 +371,8 @@
@ -497,6 +503,8 @@
@ -627,6 +635,8 @@
@ -664,10 +674,18 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="geoportal-data-mapper-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-mapper/geoportal-data-mapper">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="geoportal-data-common-2.4.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="geoportal-client-1.2.2-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-client/geoportal-client">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="uri-resolver-manager-1.8.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/uri-resolver-manager/uri-resolver-manager">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -779,6 +797,8 @@
@ -909,6 +929,8 @@
@ -1039,6 +1061,8 @@
@ -1169,6 +1193,8 @@

View File

@ -152,7 +152,7 @@ public class ProjectViewer extends Composite {
@Override
public void onSuccess(Boolean result) {
GWT.log("Export as PDF visible: " + result);
exportButton.setEnabled(result);
exportButton.setVisible(result);
}
});
@ -207,7 +207,7 @@ public class ProjectViewer extends Composite {
exportButton.setType(ButtonType.LINK);
exportButton.setIcon(IconType.FILE);
exportButton.setTitle("Export as PDF");
exportButton.setEnabled(false);
exportButton.setVisible(false);
exportButton.addClickHandler(new ClickHandler() {
@ -241,45 +241,7 @@ public class ProjectViewer extends Composite {
String geoportalExportActionServlet = builder.toString();
// Method httpMethod = RequestBuilder.GET;
// RequestBuilder requestBuilder = new RequestBuilder(httpMethod, geoportalExportActionServlet);
NewBrowserWindow.open(geoportalExportActionServlet, "_blank", "");
// try {
// requestBuilder.sendRequest("", new RequestCallback() {
//
// @Override
// public void onResponseReceived(Request request, Response response) {
// newBrowserWindow.setUrl(geoportalExportActionServlet);
//
// }
//
// @Override
// public void onError(Request request, Throwable exception) {
// newBrowserWindow.close();
// Modal errorModal = new Modal(true, true);
// errorModal.setCloseVisible(true);
// errorModal.setTitle("Oops...");
// Image geoportalError = new Image(GeoportalImages.ICONS.warningError());
// FlowPanel errorPanelMsg = new FlowPanel();
// errorPanelMsg.getElement().addClassName("general_warning");
// errorPanelMsg.add(geoportalError);
// errorPanelMsg.add(new HTML("D4S GeoPortal"));
// HTML erroMessage = new HTML(
// "Oops something went wrong, error occurred when exporting the project. Error is: "
// + exception.getMessage());
// errorPanelMsg.add(erroMessage);
// errorModal.add(errorPanelMsg);
// errorModal.show();
//
// }
//
// });
// } catch (RequestException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
});