Hi support,
I tried to follow this topic Sorting generated columns - #5 от пользователя gorelov to insert a transient entity attribute in a table with sort function.
I add this filed in my entity
@Transient
@MetaProperty
private String descrArt;
I implement getter and setter method
@MetaProperty(related = "codArt")
public String getDescrArt() {
// code for getting descrArt
return descrArt;
}
public void setDescrArt(String descrArt) {
// code for setting descrArt
this.descrArt = descrArt;
}
In my browse screen I add
When I open screen my table display correctly descrArt attribute.
It’s possibile also sort on this attribute but I’m be able to sort only one time on this column.
If I click on header column my table is ordered fordescrArt Ascending, If I click on header column another time nothing happens.
what is missing in my code?
I have doing another intresting test tring to start from this topic:
I following this example but I’m not be able to doing the same code in 7.2 version.
I don’t understand how to use datasupplier in 7.2 version.
I don’t find documentation
I create a class for load entity
public class artDataSupplier extends GenericDataSupplier {
@Nonnull
@Override
public <E extends Entity> List<E> loadList(LoadContext<E> context) {
List<E> list = super.loadList(context);
List<Art> customers = new ArrayList(list);
customers.sort(Comparator.comparing(Art::getCodiceArticolo));
int i = 1;
for (Art customer : customers) {
customer.setDescrArt("aaaa");
}
return list;
}
}
In my java class I understand that I must implement delegate method
@Install(to = “artsDl”, target = Target.DATA_LOADER)
private List artsDlLoadDelegate(LoadContext loadContext) {
…
}
How can I use dataManager and dataSupplier to return my artDataSupplier list?
Can you help me?
Thank’s for support
Giuseppe