I’ve been working on adding conditional formatting to a column in a group table, but when I run the code no formatting is applied. I’ve stepped through it and confirmed the correct values are being returned. I have tried the GroupTable.GroupStyleProvider interface as well as the Table.StyleProvider interface both in the ready hook and the init hook. Here’s the StyleProvider source:
new Table.StyleProvider() {
@Override
public String getStyleName(Entity e, String property) {
if (e == null) {
return null;
}
if (property != null && property.equals("estimatedReceivedDate")) {
PermitRequest pr = (PermitRequest) e;
Date estRecDate = pr.getEstimatedReceivedDate();
if (estRecDate == null) {
return null;
}
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
LocalDate estRecLocalDate = LocalDate.parse(
df.format(estRecDate)
);
LocalDate now = LocalDate.now();
if (now.isAfter(estRecLocalDate) || now.isEqual(estRecLocalDate)) {
return "red-color";
} else if (DAYS.between(estRecLocalDate, now) <= conditionalFormattingCutoff) {
return "orange-color";
}
}
return null;
}
}