From 7bbfb6a528f32f54f7db79db6c169e68be5c3df6 Mon Sep 17 00:00:00 2001 From: Edwin Betancourt Date: Wed, 22 Jun 2022 11:04:38 -0400 Subject: [PATCH] fix: Return value on field button. (#29) --- src/main/java/org/spin/base/util/ValueUtil.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/spin/base/util/ValueUtil.java b/src/main/java/org/spin/base/util/ValueUtil.java index ce2bf166e..8b0ae34ae 100644 --- a/src/main/java/org/spin/base/util/ValueUtil.java +++ b/src/main/java/org/spin/base/util/ValueUtil.java @@ -262,8 +262,16 @@ public static Value.Builder getValueFromReference(Object value, int referenceId) return getValueFromDate((Timestamp) value); } else if(DisplayType.isText(referenceId)) { return getValueFromString((String) value); + } else if (DisplayType.Button == referenceId) { + if (value instanceof Integer) { + return getValueFromInteger((Integer) value); + } else if(value instanceof BigDecimal) { + return getValueFromInteger(((BigDecimal) value).intValue()); + } else if (value instanceof String) { + return getValueFromString((String) value); + } } - // + // return builderValue; }