Skip to Content

Smart Table: PresentationVariant annotation for default sort not working

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Aug 23, 2018 at 08:38 PM

    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. :D

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 04, 2018 at 01:29 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 06 at 04:55 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded