Skip to Content
0
Jan 25 at 12:56 PM

Fiori Elements ValueHelp Sorting

169 Views

Hi,

I have an Fiori-Elements-App with local Annotations. I have created an entity that is used as a ValueHelp.

Like this:

<Annotations Target="Metadata.ZMainEntity/ZReferenceID">
                <Annotation Term="Common.ValueListWithFixedValues" Bool="true"/>
                <Annotation Term="Common.ValueList">
                    <Record Type="Common.ValueListType">
                        <PropertyValue Property="CollectionPath" String="ZVHSet"/>
                        <PropertyValue Property="SearchSupported" Bool="true"/>
                        <PropertyValue Property="Parameters">
                            <Collection>
                                <Record Type="Common.ValueListParameterInOut">
                                    <PropertyValue Property="LocalDataProperty" PropertyPath="ZReferenceID"/>
                                    <PropertyValue Property="ValueListProperty" String="Id"/>
                                </Record>
                                <Record Type="Common.ValueListParameterIn">
                                    <PropertyValue Property="LocalDataProperty" PropertyPath="ZReferenceID"/>
                                    <PropertyValue Property="ValueListProperty" String="ZReferenceID"/>
                                </Record>
                                <Record Type="Common.ValueListParameterDisplayOnly">
                                    <PropertyValue Property="ValueListProperty" String="Id_Text"/>
                                </Record>
                            </Collection>
                        </PropertyValue>
                        <PropertyValue Property="FetchValues" Int="1"/>
                    </Record>
                </Annotation>
            </Annotations>

That works as expected. Now I try to add a sorting on the ValueHelp on a specific property. I defined an PresentationVarient and add the reference to the ValueHelp.

<Annotations Target="Metadata.ZVHSetType" Qualifier="MySorter">
 <Annotation Term="UI.PresentationVariant">
 <Record>
 <PropertyValue Property="Text" String=""/>
 <PropertyValue Property="SortOrder">
 <Collection>
 <Record Type="Common.SortOrderType">
 <PropertyValue Property="Property" PropertyPath="ZDescription"/>
 <PropertyValue Property="Descending" Bool="false"/>
 </Record>
 </Collection>
 </PropertyValue>
 </Record>
 </Annotation>
 </Annotations>

But now the field dont appears.

I debugged this and found the following line. So this feature not supported anymore? Is there an other way to sort values in a FixedValueHelp (ComboBox) ?


// TODO: to be removed in the next release! - Ignore ValueList with PresentationVariantQualifier
if (oResolvedAnnotation.annotation && !oResolvedAnnotation.annotation["PresentationVariantQualifier"]) {
this._enrichValueHelpAnnotation(oResolvedAnnotation, sParentFieldName);
// Check if there is no qualifier --> the default/primaryValueListAnnotation
if (!sQualifier) {
mAnnotation.primaryValueListAnnotation = oResolvedAnnotation;
} else {
// Set the qualifier on the resolved annotation
oResolvedAnnotation.qualifier = sQualifier;
mAnnotation.additionalAnnotations.push(oResolvedAnnotation);
}
}