on 01-11-2019 1:22 PM
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
ObjectModel.text.element
did you try this in your text view cds for the valuehelp cds?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello.
I want to show more than 100 entries in the drop-down list.
I've tried this: @ObjectModel.resultSet.sizeCategory: #S
Unfortunately, no success.
The annotation ObjectModel.resultSet.sizeCategory expects a String(3), but #S has the length 2.
Can someone help me there?
Olga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.