From 7d698819915cf7c870db46d255fecc2db9fec5ae Mon Sep 17 00:00:00 2001 From: buczekp <buczekp> Date: Tue, 22 Mar 2011 13:57:41 +0000 Subject: [PATCH] [LMS-2145] trim whitespace in UI instead of in the script (fixed NPEs) SVN: 20452 --- .../ManagedPropertyGridActionDialog.java | 2 +- .../resource/jython-scripts/MP-plasmid_parents.py | 12 ++++++------ plasmid/resource/jython-scripts/MP-yeast_parents.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) 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 00a7b78e476..52e008e0fc9 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 @@ -113,7 +113,7 @@ public final class ManagedPropertyGridActionDialog extends { TextField<?> field = inputFieldsByLabel.get(inputDescription.getLabel()); Object fieldValue = field.getValue(); - String value = fieldValue == null ? null : field.getValue().toString(); + String value = fieldValue == null ? null : field.getValue().toString().trim(); if (fieldValue instanceof SimpleComboValue) { value = ((SimpleComboValue<?>) fieldValue).getValue().toString(); diff --git a/plasmid/resource/jython-scripts/MP-plasmid_parents.py b/plasmid/resource/jython-scripts/MP-plasmid_parents.py index 360bfe81d89..366a910d477 100644 --- a/plasmid/resource/jython-scripts/MP-plasmid_parents.py +++ b/plasmid/resource/jython-scripts/MP-plasmid_parents.py @@ -288,10 +288,10 @@ def updateFromUI(action): For 'add' action create new plasmid relationship element with values from input fields and add it to existing elements. """ - code = action.getInputValue(CODE_LABEL).strip() - relationshipLabel = action.getInputValue(RELATIONSHIP_LABEL).strip() + code = action.getInputValue(CODE_LABEL) + relationshipLabel = action.getInputValue(RELATIONSHIP_LABEL) relationship = _translateFromLabel(relationshipLabel) - annotation = action.getInputValue(ANNOTATION_LABEL).strip() + annotation = action.getInputValue(ANNOTATION_LABEL) sampleLink = _createSampleLink(code, relationship, annotation) elements.append(sampleLink) @@ -300,10 +300,10 @@ def updateFromUI(action): For 'edit' action find the plasmid relationship element corresponding to selected row and replace it with an element with values from input fields. """ - code = action.getInputValue(CODE_LABEL).strip() - relationshipLabel = action.getInputValue(RELATIONSHIP_LABEL).strip() + code = action.getInputValue(CODE_LABEL) + relationshipLabel = action.getInputValue(RELATIONSHIP_LABEL) relationship = _translateFromLabel(relationshipLabel) - annotation = action.getInputValue(ANNOTATION_LABEL).strip() + annotation = action.getInputValue(ANNOTATION_LABEL) sampleLink = _createSampleLink(code, relationship, annotation) selectedRowId = action.getSelectedRows()[0] diff --git a/plasmid/resource/jython-scripts/MP-yeast_parents.py b/plasmid/resource/jython-scripts/MP-yeast_parents.py index 0df7003d913..2b7038bcd94 100644 --- a/plasmid/resource/jython-scripts/MP-yeast_parents.py +++ b/plasmid/resource/jython-scripts/MP-yeast_parents.py @@ -128,7 +128,7 @@ def updateFromUI(action): For 'add' action create new yeast parent element with values from input fields and add it to existing elements. """ - code = action.getInputValue(CODE_LABEL).strip() + code = action.getInputValue(CODE_LABEL) sampleLink = _createSampleLink(code) elements.append(sampleLink) @@ -137,7 +137,7 @@ def updateFromUI(action): For 'edit' action find the yeast parent element corresponding to selected row and replace it with an element with values from input fields. """ - code = action.getInputValue(CODE_LABEL).strip() + code = action.getInputValue(CODE_LABEL) sampleLink = _createSampleLink(code) selectedRowId = action.getSelectedRows()[0] -- GitLab