diff --git a/src/main/java/org/gcube/portlets/user/reportgenerator/client/Headerbar.java b/src/main/java/org/gcube/portlets/user/reportgenerator/client/Headerbar.java index 934ff10..4ff1803 100644 --- a/src/main/java/org/gcube/portlets/user/reportgenerator/client/Headerbar.java +++ b/src/main/java/org/gcube/portlets/user/reportgenerator/client/Headerbar.java @@ -232,14 +232,23 @@ public class Headerbar extends Composite{ Command openNothing = new Command() { public void execute() { - - MessageBox.alert("Alert", - "Export is disabled for templates, please save this template as a Report and retry", null); } }; - return openNothing; } + + public Command getDisabledExportMenuItemCmd() { + + Command disabledExportMenuItemCmd = new Command() { + public void execute() { + + MessageBox.alert("Alert", + "Export is disabled for templates, please save this template as a Report and retry." + + " If you just saved this Template as a Report please save it and reopen the Report", null); + } + }; + return disabledExportMenuItemCmd; + } /** * temporary command * @return the command instance @@ -328,10 +337,10 @@ public class Headerbar extends Composite{ exportsMenu.setAnimationEnabled(true); MenuItem toReturn = new MenuItem("Export", exportsMenu); - optionDOCX = new MenuItem(""+ EXPORT_OPENXML +"", true, getNullCommand()); - optionPDF = new MenuItem("Export to PDF", true, getNullCommand()); - optionHTML = new MenuItem(""+ EXPORT_HTML +"", true, getNullCommand()); - optionFimes = new MenuItem(""+ EXPORT_FIMES +"", true, getNullCommand()); + optionDOCX = new MenuItem(""+ EXPORT_OPENXML +"", true, getDisabledExportMenuItemCmd()); + optionPDF = new MenuItem("Export to PDF", true, getDisabledExportMenuItemCmd()); + optionHTML = new MenuItem(""+ EXPORT_HTML +"", true, getDisabledExportMenuItemCmd()); + optionFimes = new MenuItem(""+ EXPORT_FIMES +"", true, getDisabledExportMenuItemCmd()); exportsMenu.addItem(optionDOCX); exportsMenu.addItem(optionHTML);