Skip to Content

Fiori Elements Dropdown Filter Description

Creating value help in the consumption CDS view:

ObjectModel.foreignKey.association: '_StatusValueHelp'
ObjectModel.text.association: '_StatusValueHelp'Status

This creates a nice value help dialog and autocompletion, showing all possible values for the status attribute.

Using the right annotations, Fiori Elements automatically shows this filter as dropdown [1]. I annotated my value help CDS view, to get the fixed-values metadata annotation sap:value-list="fixed-values":

@ObjectModel.resultSet.sizeCategory:#XS

This works great, but the dropdown only shows keys, not the associated text descriptions - quite hard for a user to understand what to select.

The created metadata looks like texts should be displayed (DisplayOnly), but they are not:

            <Annotations Target="SalesOrderType/Status" 
                xmlns="http://docs.oasis-open.org/odata/ns/edm">
                <Annotation Term="Common.ValueList">
                    <Record>
                        <PropertyValue Property="Label" String="Status"/>
                        <PropertyValue Property="CollectionPath" String="I_Status"/>
                        <PropertyValue Property="SearchSupported" Bool="true"/>
                        <PropertyValue Property="Parameters">
                            <Collection>
                                <Record Type="Common.ValueListParameterInOut">
                                    <PropertyValue Property="LocalDataProperty" PropertyPath="Status"/>
                                    <PropertyValue Property="ValueListProperty" String="Status"/>
                                </Record>
                                <Record Type="Common.ValueListParameterDisplayOnly">
                                    <PropertyValue Property="ValueListProperty" String="Name"/>
                                </Record>
                            </Collection>
                        </PropertyValue>
                    </Record>
                </Annotation>
            </Annotations>

Has anyone managed to show a nice dropdown with texts, optionally directly from a CDS annotation?

[1] https://answers.sap.com/questions/452881/change-filter-field-to-dropdown-in-fiori-elements.html

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    6 days ago

    ObjectModel.text.element

    did you try this in your text view cds for the valuehelp cds?

    Add comment
    10|10000 characters needed characters exceeded