Fixed blocking on error

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-extractcodelist-widget@119276 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-09-30 17:12:25 +00:00
parent f0721ded2c
commit 09aefb85b9
1 changed files with 10 additions and 1 deletions

View File

@ -48,6 +48,7 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
private HtmlLayoutContainer resultField; private HtmlLayoutContainer resultField;
private boolean automaticallyAttached; private boolean automaticallyAttached;
private TRId collateralTRId; private TRId collateralTRId;
private MonitorDialog monitorDialog;
public ExtractCodelistOperationInProgressCard( public ExtractCodelistOperationInProgressCard(
final ExtractCodelistSession extractCodelistSession) { final ExtractCodelistSession extractCodelistSession) {
@ -89,6 +90,7 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
showErrorAndHide("Error in extract codelist", showErrorAndHide("Error in extract codelist",
"An error occured in extract codelist.", "An error occured in extract codelist.",
caught.getLocalizedMessage(), caught); caught.getLocalizedMessage(), caught);
return;
} }
} }
}); });
@ -96,17 +98,24 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
public void setCollateralTRIdFinal(ArrayList<TRId> collateralIds) { public void setCollateralTRIdFinal(ArrayList<TRId> collateralIds) {
if (collateralIds == null || collateralIds.isEmpty()) { if (collateralIds == null || collateralIds.isEmpty()) {
monitorDialog.hide();
showErrorAndHide("Error in extract codelist", showErrorAndHide("Error in extract codelist",
"An error occured setting collateral table final.", "An error occured setting collateral table final.",
"No collateral id retrieved", new Throwable( "No collateral id retrieved", new Throwable(
"No collateral id retrieved")); "No collateral id retrieved"));
return;
} }
collateralTRId = collateralIds.get(0); collateralTRId = collateralIds.get(0);
if (collateralTRId == null) { if (collateralTRId == null) {
monitorDialog.hide();
showErrorAndHide("Error in extract codelist", showErrorAndHide("Error in extract codelist",
"An error occured setting collateral table final.", "An error occured setting collateral table final.",
"Collateral id is null", new Throwable( "Collateral id is null", new Throwable(
"Collateral id is null")); "Collateral id is null"));
return;
} }
TDGWTServiceAsync.INSTANCE.setTabResourceToFinal(collateralTRId, TDGWTServiceAsync.INSTANCE.setTabResourceToFinal(collateralTRId,
@ -268,7 +277,7 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
// //
protected void openMonitorDialog(String taskId) { protected void openMonitorDialog(String taskId) {
MonitorDialog monitorDialog = new MonitorDialog(taskId, getEventBus()); monitorDialog = new MonitorDialog(taskId, getEventBus());
monitorDialog.addProgressDialogListener(this); monitorDialog.addProgressDialogListener(this);
monitorDialog.setBackgroundBtnEnabled(false); monitorDialog.setBackgroundBtnEnabled(false);
monitorDialog.show(); monitorDialog.show();