Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
5.8.2
-
None
-
None
Description
A Grid doesn't sort if the sorting column contains a dot in the PropertyModel of the Grid.
This BUG was introduced by fixing an issue TAP5-2689.
This actual Code always returns an empty list for columns with a dot within the property name:
if ((paginationModel == null || paginationModel.getSortColumnId() == null) || !(dataModel.getPropertyNames().contains(TapestryInternalUtils.extractIdFromPropertyExpression(paginationModel.getSortColumnId())))) {return Collections.emptyList();}
The correct code was something like that:
if (paginationModel == null || paginationModel.getSortColumnId() == null || dataModel.getPropertyNames().stream().noneMatch(x -> TapestryInternalUtils.extractIdFromPropertyExpression(x).equals(paginationModel.getSortColumnId()))) { return Collections.emptyList(); }
public class A { public B b; } public class B { public name; } public class C { public BeanModel<A> getGridModel() { final BeanModel<A> model = beanModelSource.createDisplayModel(A.class, messages); model.include(); model.add("b.name").sortable(true); return model; } }
Sorting on column "name" is not working because the property name includes a dot.
Attachments
Issue Links
- is caused by
-
TAP5-2689 Cached SortedColumnId causing UnknownValueException with Dynamci columns
- Closed