diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/UpdateFileset.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/UpdateFileset.java index 30499c3..66de13c 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/UpdateFileset.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/UpdateFileset.java @@ -390,13 +390,6 @@ public class UpdateFileset extends Composite { List listWSC) { GWT.log("fillListBoxToBeReplaced called, posizIndex: "+posizIndex+", listWSC: "+listWSC); - if (listWSC == null || listWSC.isEmpty()) { - showMessage(section + " does not contain file!", LabelType.WARNING); - pathIndex = posizIndex; - showNewFileUpload(); - return; - } - if(mapWSContentListBox==null) { mapWSContentListBox = new HashMap>(); } @@ -411,7 +404,7 @@ public class UpdateFileset extends Composite { @Override public void onChange(ChangeEvent event) { - GWT.log("listBoxContentIndex changed, posizIndex: "+posizIndex); + GWT.log("listBoxContentIndex changed, value: "+listBoxContentIndex.getSelectedValue()); if (placeholderListBoxIndex) { listBoxContentIndex.removeItem(0); // this is the placeholder, removing it once @@ -419,6 +412,16 @@ public class UpdateFileset extends Composite { } int selectedIndex = listBoxContentIndex.getSelectedIndex(); GWT.log("selected index: "+selectedIndex); + List theListWC = mapWSContentListBox.get(selectedIndex); + + if (theListWC == null || theListWC.isEmpty()) { + uploadFileContainer.clear(); + showMessage(section + " does not contain file!", LabelType.WARNING); + pathIndex = posizIndex; + showNewFileUpload(); + return; + } + showFileBrowseInteraction(selectedIndex, mapWSContentListBox.get(selectedIndex)); } });