cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Table: PresentationVariant annotation for default sort not working

kammaje_cis
Active Contributor

Hi,

I am using a smart table in my app. I want to set a default sort order on a column. UI5 Version 1.52.5.

I have not used UI.LineItem annotation, rather used all custom columns. The reason was that I wanted custom widths for all my columns. (max-width does not work well and other formatting requirements).

For the default Sort Order I used UI.PresentationVariant, specifying default sort property. But this is not having any effect. What can be the reason?

jocelyn.dart , I saw your blog and followed all the steps. It will be great if you can help.

Thanks

Krishna

0 Kudos

Hi

Did you get solution for this? I am unable to get the sorting on a key field inspite of defining the PresentationVariant annotation without the qualifier.

Accepted Solutions (0)

Answers (3)

Answers (3)

jmattfeld
Participant

According to the current documentation (1.82.4) [1], the PresentationVariant annotation is interpreted by the SmartTable. However, the follwoing restriction applies:

  • SortOrder is not evaluated for the ResponsiveTable control.

[1] https://sapui5.hana.ondemand.com/#/api/sap.ui.comp.smarttable.SmartTable%23annotations/PresentationV...

Marian_Zeis
Active Contributor
0 Kudos

Thanks for the Answer.

Really frustrating

gabriel_candrian
Explorer
0 Kudos

Hello Krishna

Have you set a qualifier for the UI.presentationVariant annotation?

When you use the UI.PresentationVariant annotation in the CDS view to set a default sort order you may not set the "qualifier" attribute and also not set the "id" attribute (if no qualifier is set but an id exists the id is used as the qualifier by SADL and the presentation variant also is not taken into account on the object page).

I had the same problem and issued a call to SAP. Here an excerpt of their answer:
The presentation variant taken into account is (on the ObjectPage) always the one without a qualifier (which does not exist in your case).
(The only exception where we use a presentation variant with qualifier is on the ListReport in case of multiple views - here the qualifier to identify which presentation variant to use is specified in the manifest.)

Regards
Gabriel

prabhatp
Participant
0 Kudos

Could you please share the link to the blog? I can take a look into this to replicate the issue and hopefully find the issue as well. 😄