cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Fiori Element Filter with hardcoded value

0 Likes
1,479

Hey colleagues,

Our team is developing a UI application with Fiori Element & Odata v4.

We have a requirement for adding Selection Field (Drop down filter) with hardcoded value. (e.g. To have a Status Filter with value in [New, In Progress, Failed])

Now we have the filter with <Annotation Term="UI.SelectionFields">, it works but we have the duplicated selection.

Our table has 21 results, and the status filter will have 21 values.

<Annotations Target="sap.odata.ApiTransaction/Status"> <Annotation Term="Common.Label" String="{@i18n>recStatus}" /> <Annotation Term="Common.ValueList"> <Record Type="Common.ValueListType"> <PropertyValue Property="CollectionPath" String="ApiTransaction"/> <PropertyValue Property="DistinctValuesSupported" Bool="true"/> <PropertyValue Property="SearchSupported" Bool="true"/> <PropertyValue Property="Parameters"> <Collection> <Record Type="Common.ValueListParameterInOut"> <PropertyValue Property="LocalDataProperty" PropertyPath="Status" /> <PropertyValue Property="ValueListProperty" String="Status" /> </Record> </Collection> </PropertyValue> </Record> </Annotation> <Annotation Term="Common.ValueListWithFixedValues" Bool="true" /> </Annotations>

I have tried with Annotation ValueList & ValueListWithFixedValues, but it doesn't meet the requirement.

I've tried extension in manifest.json, with combobox in a fragment. I can get the combobox with fixed value. But my extended filter can't get attached to the original FE odata search.

Anyone can give me any advice?

Thanks,

Howard

Accepted Solutions (1)

Accepted Solutions (1)

0 Likes

Finally, I got the solution.

We implement the enum entity set in our backend OData server. And use that enum set as CollectionPath in valuList.

The TransactionStatus is the enum entity set.

<Annotations Target="sap.odata.ApiTransaction/Status"> <Annotation Term="Common.Label" String="{@i18n>recStatus}" /> <Annotation Term="Common.ValueList"> <Record Type="Common.ValueListType"> <PropertyValue Property="CollectionPath" String="TransactionStatus"/> <PropertyValue Property="Parameters"> <Collection> <Record Type="Common.ValueListParameterInOut"> <PropertyValue Property="LocalDataProperty" PropertyPath="Status" /> <PropertyValue Property="ValueListProperty" String="Value" /> </Record> </Collection> </PropertyValue> </Record> </Annotation> <Annotation Term="Common.ValueListWithFixedValues" Bool="true" /> </Annotations>

It works fine. We got the filter as we expected.

Answers (0)