diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 7cce3aa..eb3641a 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,6 @@ - + + @@ -76,7 +77,8 @@ - + + @@ -153,7 +155,8 @@ - + + @@ -230,7 +233,8 @@ - + + @@ -307,7 +311,8 @@ - + + @@ -336,10 +341,8 @@ - - uses - - + + @@ -416,7 +419,8 @@ - + + @@ -493,7 +497,8 @@ - + + @@ -570,7 +575,8 @@ - + + diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/UpdateRecord.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/UpdateRecord.java index b28c7e2..85ae64f 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/UpdateRecord.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/UpdateRecord.java @@ -37,10 +37,10 @@ public class UpdateRecord extends Composite { ListBox listBoxSections; @UiField - HTMLPanel htmlSectionContent; - + ScrollPanel scrollSectionContent; + @UiField - ScrollPanel scrollPanelContainer; + HTMLPanel htmlPanelContainer; @UiField HTMLPanel alertHTMLPanel; @@ -48,21 +48,25 @@ public class UpdateRecord extends Composite { @UiField ControlGroup controlsControlGroup; + public static final String PLACEHOLDER_LIST_BOX = "Select section..."; + private LoaderIcon loaderProjectSections = new LoaderIcon("Loading Project sections..., please wait"); public UpdateRecord(HandlerManager editorManagerBus, String profileID, String projectID) { initWidget(uiBinder.createAndBindUi(this)); - scrollPanelContainer.setVisible(false); + htmlPanelContainer.setVisible(false); alertHTMLPanel.add(loaderProjectSections); - + + scrollSectionContent.getElement().getStyle().setProperty("maxHeight", "500px"); + GeoportalDataEntryServiceAsync.Util.getInstance().getProjectEdit(profileID, projectID, new AsyncCallback() { @Override public void onSuccess(ProjectEdit result) { - scrollPanelContainer.setVisible(true); + htmlPanelContainer.setVisible(true); try { alertHTMLPanel.remove(loaderProjectSections); @@ -70,8 +74,8 @@ public class UpdateRecord extends Composite { } - listBoxSections.addItem("Select section...", "Select section..."); - + listBoxSections.addItem(PLACEHOLDER_LIST_BOX, PLACEHOLDER_LIST_BOX); + for (final MetaDataProfileBeanExt profileBean : result.getTheProfileBeans()) { listBoxSections.addItem(profileBean.getType(), profileBean.getType()); } @@ -81,16 +85,19 @@ public class UpdateRecord extends Composite { @Override public void onChange(ChangeEvent event) { MetaDataProfileBeanExt selectedBean = result.getTheProfileBeans() - .get(listBoxSections.getSelectedIndex()); + .get(listBoxSections.getSelectedIndex() - 1); // -1 because the first element is + // the PLACEHOLDER "Select + // section..." GWT.log("Change handler fired " + selectedBean); controlsControlGroup.setVisible(true); - htmlSectionContent.clear(); - + scrollSectionContent.clear(); + GcubeProfileDV gcubeProfile = selectedBean.getGcubeProfileDV(); - - GeoNaFormCardModel formcard = GeoPortalDataEntryApp.buildNewFormCardModelFromProfile(gcubeProfile, 1, selectedBean, OPERATION.UPDATE, editorManagerBus); - htmlSectionContent.add(formcard.getMetadataForm()); - + + GeoNaFormCardModel formcard = GeoPortalDataEntryApp.buildNewFormCardModelFromProfile( + gcubeProfile, 1, selectedBean, OPERATION.UPDATE, editorManagerBus); + scrollSectionContent.add(formcard.getMetadataForm()); + } }); @@ -98,7 +105,7 @@ public class UpdateRecord extends Composite { @Override public void onFailure(Throwable caught) { - scrollPanelContainer.setVisible(true); + htmlPanelContainer.setVisible(true); alertHTMLPanel.remove(loaderProjectSections); String errorMsg = caught.getMessage(); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/UpdateRecord.ui.xml b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/UpdateRecord.ui.xml index 1511b3d..91eda14 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/UpdateRecord.ui.xml +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/UpdateRecord.ui.xml @@ -14,24 +14,30 @@ .max-height-500 { max-height: 450px; } + + .margin-top-10 { + margin-top: 10px; + } - + - Select the section of the document you want to update... + Select the section of the document you want + to update... - + Manage the content of - + @@ -42,7 +48,7 @@ - + UPDATE