[ 
https://issues.apache.org/jira/browse/TAP5-2752?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

LRein updated TAP5-2752:
------------------------
    Labels: easyfix  (was: )

> A Grid doesn't sort if sorting column cointans a dot in the PropertyModel of 
> the Grid. 
> ---------------------------------------------------------------------------------------
>
>                 Key: TAP5-2752
>                 URL: https://issues.apache.org/jira/browse/TAP5-2752
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.8.2
>            Reporter: LRein
>            Assignee: Ben Weidig
>            Priority: Minor
>              Labels: easyfix
>
> 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:
> {code:java}
> if ((paginationModel == null || paginationModel.getSortColumnId() == null)
> || 
> !(dataModel.getPropertyNames().contains(TapestryInternalUtils.extractIdFromPropertyExpression(paginationModel.getSortColumnId()))))
> {return Collections.emptyList();}
> {code}
> The correct code was something like that:
> {code:java}
> if (paginationModel == null || paginationModel.getSortColumnId() == null
> || dataModel.getPropertyNames().stream().noneMatch(x -> 
> TapestryInternalUtils.extractIdFromPropertyExpression(x).equals(paginationModel.getSortColumnId())))
> {
>       return Collections.emptyList();
> }
> {code}
> {code:java}
> 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;
> }
> }
> {code}
> Sorting on column "name" is not working because the property name includes a 
> dot.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to