When no profile is available the listbox is hide

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@130571 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-07-19 19:24:42 +00:00
parent 624199e9aa
commit 71407b502f
2 changed files with 35 additions and 29 deletions

View File

@ -157,6 +157,7 @@ public class CreateDatasetForm extends Composite{
@UiField Icon infoIconResources;
@UiField FocusPanel focusPanelResources;
@UiField Popover popoverResources;
@UiField ControlGroup metadataProfilesControlGroup;
protected static final String ERROR_PRODUCT_CREATION = "There was an error while trying to publish your product, sorry.. Retry later";
@ -469,6 +470,7 @@ public class CreateDatasetForm extends Composite{
List<MetaDataProfileBean> beans = receivedBean.getMetadataList();
if(beans != null && !beans.isEmpty()){
for(MetaDataProfileBean metadataBean: beans){
metadataProfilesFormatListbox.addItem(metadataBean.getType().getName());
@ -493,6 +495,10 @@ public class CreateDatasetForm extends Composite{
}
});
}
}else{
// just hide this listbox
metadataProfilesControlGroup.setVisible(true);
}
}
protected void addFields(String selectedItem) {

View File

@ -251,7 +251,7 @@
</b:Controls>
</b:ControlGroup>
<b:ControlGroup>
<b:ControlGroup ui:field="metadataProfilesControlGroup">
<b:ControlLabel for="metadataProfilesFormat" title="Product profile formats">Product
Profile:</b:ControlLabel>
<b:Controls>