Skip to Content
3
Jun 23 at 02:32 PM

SelectionVariant to filter valuelist in Fiori Elements

150 Views Last edit Jun 23 at 02:39 PM 2 rev

I want to use a SelectionVariant in a Fiori Elements application to filter the values of a value help table (valuelist).

I'm using CAP to define the annoations. Those seem to be ok cause the OData metadata looks fine to me.

Definition of SelectionVariant:

<?xml version="1.0" encoding="UTF-8"?>
<Annotation Term="UI.SelectionVariant" Qualifier="variant1">
   <Record Type="UI.SelectionVariantType">
      <PropertyValue Property="Text" String="Meine Selektionsvariante" />
      <PropertyValue Property="SelectOptions">
         <Collection>
            <Record Type="UI.SelectOptionType">
               <PropertyValue Property="PropertyName" PropertyPath="function" />
               <PropertyValue Property="Ranges">
                  <Collection>
                     <Record Type="UI.SelectionRangeType">
                        <PropertyValue Property="Sign" EnumMember="UI.SelectionRangeSignType/I" />
                        <PropertyValue Property="Option" EnumMember="UI.SelectionRangeOptionType/EQ" />
                        <PropertyValue Property="Low" String="MT1" />
                     </Record>
                  </Collection>
               </PropertyValue>
            </Record>
         </Collection>
      </PropertyValue>
   </Record>
</Annotation>

Usage of SelectionVariant in a ValueList:

<?xml version="1.0" encoding="UTF-8"?>
<Annotation Term="Common.ValueList">
   <Record Type="Common.ValueListType">
      <PropertyValue Property="CollectionPath" String="Functions" />
      <PropertyValue Property="SelectionVariantQualifier" String="variant1" />
      <PropertyValue Property="SearchSupported" Bool="false" />
      <PropertyValue Property="Parameters">
         <Collection>
            <Record Type="Common.ValueListParameterIn">
               <PropertyValue Property="LocalDataProperty" PropertyPath="environment_ID" />
               <PropertyValue Property="ValueListProperty" String="environment_ID" />
            </Record>
            <Record Type="Common.ValueListParameterInOut">
               <PropertyValue Property="LocalDataProperty" PropertyPath="senderFunction_ID" />
               <PropertyValue Property="ValueListProperty" String="ID" />
            </Record>
            <Record Type="Common.ValueListParameterDisplayOnly">
               <PropertyValue Property="ValueListProperty" String="function" />
            </Record>
            <Record Type="Common.ValueListParameterDisplayOnly">
               <PropertyValue Property="ValueListProperty" String="description" />
            </Record>
         </Collection>
      </PropertyValue>
   </Record>
</Annotation>

My problem is that the filter / the variant is not applied at runtime. Here's the resulting request when I call open the value help dialog in my Fiori UI:

 GET /service/modeling/Functions?$select=ID,IsActiveEntity,description,environment_ID,function,parent_ID&$orderby=function&$filter=environment_ID eq '1' and IsActiveEntity eq true&$skip=0&$top=67
Does this work for anyone on this planet?Regards Helmut