diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyFormHelper.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyFormHelper.java index 6a3d5c72113e078576bf5b542f20f4727b470892..4518898885e026a7aa06d77569524a8e342dbe23 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyFormHelper.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyFormHelper.java @@ -41,14 +41,14 @@ public class ManagedPropertyFormHelper private final FormPanel formPanel; - private final Map<String, TextField<?>> inputFieldsByLabel; + private final Map<String, TextField<?>> inputFieldsByCode; public ManagedPropertyFormHelper(IViewContext<?> viewContext, FormPanel formPanel, - Map<String, TextField<?>> inputFieldsByLabel) + Map<String, TextField<?>> inputFieldsByCode) { this.viewContext = viewContext; this.formPanel = formPanel; - this.inputFieldsByLabel = inputFieldsByLabel; + this.inputFieldsByCode = inputFieldsByCode; } @@ -88,7 +88,7 @@ public class ManagedPropertyFormHelper } FieldUtil.setMandatoryFlag(field, inputDescription.isMandatory()); - inputFieldsByLabel.put(label, field); + inputFieldsByCode.put(inputDescription.getCode(), field); formPanel.add(field); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGridActionDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGridActionDialog.java index 76ab67e95fca9fc994f37a8ff0279e30c3f3685b..6c528a8197fe436d681aecf66a66d84c125cf5c5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGridActionDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGridActionDialog.java @@ -60,7 +60,7 @@ public final class ManagedPropertyGridActionDialog extends private final IManagedUiTableAction managedAction; - private final Map<String, TextField<?>> inputFieldsByLabel = + private final Map<String, TextField<?>> inputFieldsByCode = new LinkedHashMap<String, TextField<?>>(); private final ManagedPropertyFormHelper formHelper; @@ -77,7 +77,7 @@ public final class ManagedPropertyGridActionDialog extends this.callback = callback; this.managedAction = managedAction; setWidth(400); - formHelper = new ManagedPropertyFormHelper(viewContext, formPanel, inputFieldsByLabel) + formHelper = new ManagedPropertyFormHelper(viewContext, formPanel, inputFieldsByCode) { @Override protected void trySetBoundedValue(IManagedInputWidgetDescription inputDescription) @@ -112,7 +112,7 @@ public final class ManagedPropertyGridActionDialog extends for (IManagedInputWidgetDescription inputDescription : managedAction .getInputWidgetDescriptions()) { - TextField<?> field = inputFieldsByLabel.get(inputDescription.getLabel()); + TextField<?> field = inputFieldsByCode.get(inputDescription.getCode()); Object fieldValue = field.getValue(); String value = fieldValue == null ? null : field.getValue().toString().trim(); if (fieldValue instanceof SimpleComboValue) @@ -147,12 +147,12 @@ public final class ManagedPropertyGridActionDialog extends && data.size() == 1) { String boundedColumnTitleOrNull = - managedAction.getBindings().get(inputDescription.getLabel()); + managedAction.getBindings().get(inputDescription.getCode()); if (boundedColumnTitleOrNull != null) { if (viewContext.isLoggingEnabled()) { - GWTUtils.displayInfo("found binding", inputDescription.getLabel() + "->" + GWTUtils.displayInfo("found binding", inputDescription.getCode() + "->" + boundedColumnTitleOrNull); } TableModelRowWithObject<ReportRowModel> selectedRow = data.get(0); @@ -169,7 +169,7 @@ public final class ManagedPropertyGridActionDialog extends inputDescription.setValue(value.toString()); if (viewContext.isLoggingEnabled()) { - Info.display("bounded value", inputDescription.getLabel() + "=" + value); + Info.display("bounded value", inputDescription.getCode() + "=" + value); } break; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedInputWidgetDescription.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedInputWidgetDescription.java index c04d99dd1aafc4c6f9bac09285fee2b3751a2ace..9d0696a861feeac819b6740d93f7845ba57db657 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedInputWidgetDescription.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedInputWidgetDescription.java @@ -45,13 +45,14 @@ public abstract class ManagedInputWidgetDescription implements IManagedInputWidg return code; } - public void setCode(String code) + public IManagedInputWidgetDescription setCode(String code) { if (isBlank(code)) { throw new IllegalArgumentException("Code is null or a blank string."); } this.code = code.toUpperCase(); + return this; } @Override diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ManagedPropertyField.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ManagedPropertyField.java index 2e15b428598700eb131b3349ffd9327f8e8cc1d9..a80f86cb3e9deb20f3a39fb57c32408f2813c2e8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ManagedPropertyField.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ManagedPropertyField.java @@ -116,16 +116,16 @@ public class ManagedPropertyField extends Field<List<Map<String, String>>> formPanel.setLabelWidth(AbstractRegistrationForm.DEFAULT_LABEL_WIDTH - SPACING - 2); formPanel.setFieldWidth(AbstractRegistrationForm.DEFAULT_FIELD_WIDTH); formPanel.setHeaderVisible(false); - Map<String, TextField<?>> inputFieldsByLabel = new HashMap<String, TextField<?>>(); + Map<String, TextField<?>> inputFieldsByCode = new HashMap<String, TextField<?>>(); ManagedPropertyFormHelper formHelper = - new ManagedPropertyFormHelper(viewContext, formPanel, inputFieldsByLabel); + new ManagedPropertyFormHelper(viewContext, formPanel, inputFieldsByCode); formHelper.fillForm(widgetDescriptions); final HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setSpacing(SPACING); horizontalPanel.add(formPanel); Button removeButton = new Button("-"); removeButton.setToolTip("Delete this section."); - final Section section = new Section(inputFieldsByLabel); + final Section section = new Section(inputFieldsByCode); removeButton.addSelectionListener(new SelectionListener<ButtonEvent>() { @Override