cancel
Showing results for 
Search instead for 
Did you mean: 

Hide fields in Column Personalization Button of Fiori Elements List Report

kachin_agarwal
Explorer

Hi All,

I have created a fiori elements app using a CAP module that exposes an oData v4 service. I am using the list report layout. We have the adapt filter button in the filter bar and the column personalisation button on the table. Currently the selection/line item fields mentioned in my annotation.cds renders the default view and rest of the fields move to the adapt filters and personalisation button. I dont want to show all the fields in the adapt filter and column personalisation. So for hiding the field in the filter bar i can use the annotation @UI.HiddenFilter. What annotation can be used to hide the property in the personalisation button? if i use @UI.Hidden that field is completely removed from UI because i have to show that field in the detail page. I just want to hide that property in the personalization button?

Thanks,

Kachin

gregorw
Active Contributor
0 Kudos

Maybe oliver.graeff can help here?

View Entire Topic

Hello Kachin,

If you are using UI5 version 1.85+, you can define this setting in your app's manifest.json. Notice that this would mean it is a configuration in the UI app and not in the service.
In your app's manifest.json, under sap.ui5/routing/targets/<YOUR_VIEW_TARGET_NAME>/options/settings/controlConfiguration/<YOUR_LINEITEM_ANNOTATION>/columns/"DataField::<YOUR_PROPERTY_NAME>"/availability

Here's an example (please excuse the formatting limitations) -

{
  "sap.ui5": {
    "routing": {
      "targets": {
        "SalesOrderManageList": {
          "options": {
            "settings": {
              "controlConfiguration": {
                "@com.sap.vocabularies.UI.v1.LineItem": {
                  "columns": {
                    "CustomColumnRating": {
                      "header": "{i18n>LR.Custom_Column|Button}",
                      "width": "10em",
                      "horizontalAlign": "Center",
                      "position": {
                        "placement": "After",
                        "anchor": "DataFieldForAnnotation::FieldGroup::multipleActionFields"
                      },
                      "template": "SalesOrder.custom.CustomColumnButton",
                      "availability": "Default",
                      "properties": [
                        "ID",
                        "TotalNetAmount",
                        "_CustomerPaymentTerms/CustomerPaymentTerms",
                        "_ShipToParty/BusinessPartner"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

You can have the following options for this setting -

availability*"Default" | "Adaptation" | "Hidden"Defines where the column should be shown.

  • Default: it will be shown by default in the table.
  • Adaptation: it will be initially not shown in the table but will be available via end user adaptation
  • Hidden: the column is neither available in the table nor in adaptation

Note: This setting can also be used for existing annotation columns.

You would require such a configuration for all the properties belonging to the entity bound against your table, which you do not want to expose for personalization. The setting that should work for you here is "Hidden".

I hope this helps!

0 Kudos
kachin_agarwal
Explorer
0 Kudos

Thanks Meet. Works well.

Aurelien
Participant
0 Kudos

Hi,

It looks handy but how do we proceed in older version ( 1.71) ?

Kr

Aurélien