Skip to content

Commit d616ecf

Browse files
author
Open Lowcode SAS
committed
Close #291
1 parent e9c696e commit d616ecf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/org/openlowcode/client/graphic/widget/CMultiFieldConstraint.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,14 @@ public CMultiFieldConstraint(MessageReader reader, ArrayList<CBusinessField<?>>
110110
while (reader.structureArrayHasNextElement("VAL")) {
111111
ArrayList<String> combination = new ArrayList<String>();
112112
reader.startStructureArray("VALELT");
113+
113114
while (reader.structureArrayHasNextElement("VALELT")) {
114115
int index = combination.size();
115116
String value = reader.returnNextStringField("ELT");
116117
if (index >= constrainedfields.size())
117118
throw new RuntimeException("value element is index " + index + " but there are only "
118119
+ constrainedfields.size() + " constrained values.");
119-
if (!constrainedfields.get(index).isRestrictionValid(value))
120+
if (value.length()>0) if (!constrainedfields.get(index).isRestrictionValid(value))
120121
throw new RuntimeException("restriction is not valid " + value);
121122
combination.add(value);
122123
reader.returnNextEndStructure("VALELT");

src/org/openlowcode/design/utility/MultiFieldConstraint.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public void generateFile(SourceGenerator sg, Module module) throws IOException {
126126
boolean done = false;
127127
if (thisfield instanceof ChoiceField) {
128128
sg.wl(" rawconstraintline.add((" + thisfield.getName().toLowerCase() + "!=null?"
129-
+ thisfield.getName().toLowerCase() + ".getStorageCode():null));");
129+
+ thisfield.getName().toLowerCase() + ".getStorageCode():\"\"));");
130130
done = true;
131131
}
132132
if (thisfield instanceof DecimalField) {

0 commit comments

Comments
 (0)