Skip to content

Commit f7b488c

Browse files
brunoagrettijavier-godoy
authored andcommitted
fix: prioritize custom value provider when extracting column values
1 parent 9076728 commit f7b488c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/java/com/flowingcode/vaadin/addons/gridexporter/GridExporter.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,13 @@ Object extractValueFromColumn(T item, Column<T> column) {
221221
ValueProvider<T, String> customVP =
222222
(ValueProvider<T, String>)
223223
ComponentUtil.getData(column, GridExporter.COLUMN_VALUE_PROVIDER_DATA);
224-
if (customVP != null) {
225-
value = customVP.apply(item);
226-
}
224+
if (customVP != null) {
225+
value = customVP.apply(item);
226+
if (value == null && nullValueSupplier != null) {
227+
value = nullValueSupplier.get();
228+
}
229+
return value;
230+
}
227231

228232
// if there is a key, assume that the property can be retrieved from it
229233
if (value == null && column.getKey() != null) {

0 commit comments

Comments
 (0)