Hi All,
while developing the custom free-style UI5 app with OData v2, I’m using SAP smart controls to save some development time, and I have some examples to share.
<Annotations Target="your_srv.entity_type">
<Annotation Term="com.sap.vocabularies.UI.v1.PresentationVariant">
<Record>
<PropertyValue Property="Visualizations">
<Collection>
<AnnotationPath>@UI.LineItem</AnnotationPath>
</Collection>
</PropertyValue>
<PropertyValue Property="SortOrder">
<Collection>
<Record Type="Common.SortOrderType">
<PropertyValue Property="Property" PropertyPath="field1" />
<PropertyValue Property="Descending" Bool="true"/>
</Record>
</Collection>
<Collection>
<Record Type="Common.SortOrderType">
<PropertyValue Property="Property" PropertyPath="field2" />
<PropertyValue Property="Descending" Bool="true"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations><Annotations Target="your_srv.your_srv_Entities/EntitySet">
<Annotation Term="Org.OData.Capabilities.V1.FilterRestrictions">
<Record Type="Capabilities.FilterRestrictionsType">
<PropertyValue Property="RequiresFilter" Bool="true"/>
<PropertyValue Property="RequiredProperties">
<Collection>
<PropertyPath>field1</PropertyPath>
<PropertyPath>field2</PropertyPath>
</Collection>
</PropertyValue>
<PropertyValue Property="FilterExpressionRestrictions">
<Collection>
<Record Type="Capabilities.FilterExpressionRestrictionType">
<PropertyValue Property="Property" PropertyPath="field1"/>
<PropertyValue Property="AllowedExpressions" String="SingleValue"/>
</Record>
<Record Type="Capabilities.FilterExpressionRestrictionType">
<PropertyValue Property="Property" PropertyPath="field2"/>
<PropertyValue Property="AllowedExpressions" String="SingleValue"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>RequiresFilter to set mandatory
Single Value only in value help
<Annotations Target="your_srv.EntityType/field1">
<Annotation Term="com.sap.vocabularies.Common.v1.FieldControl" EnumMember="com.sap.vocabularies.Common.v1.FieldControlType/Hidden"/>
</Annotations>You can also use this annotation to field binded Value List.
<Annotations Target="your_srv.EntityType/field1">
<Annotation Term="Common.Text" Path="field1_name">
<Annotation Term="UI.TextArrangement" EnumMember="UI.TextArrangementType/TextFirst"/></Annotation>
<Annotation Term="Common.ValueList">
<Record>
<PropertyValue Property="Label" String="{i18n>Field1}"/>
<PropertyValue Property="CollectionPath" String="ZEXAMPLE_VH"/>
<PropertyValue Bool="true" Property="SearchSupported"/>
<PropertyValue Property="Parameters">
<Collection>
<Record Type="Common.ValueListParameterOut">
<PropertyValue Property="LocalDataProperty" PropertyPath="field1"/>
<PropertyValue Property="ValueListProperty" String="ValueList_field1"/>
</Record>
<Record Type="Common.ValueListParameterDisplayOnly">
<PropertyValue Property="ValueListProperty" String="ValueList_field1_name" />
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
<Annotations Target="your_srv.EntityType/field1">
<Annotation Term="UI.HiddenFilter" Bool="true"/>
</Annotations>
You can also find some local annotation examples in this blog by Chandra: https://community.sap.com/t5/technology-blog-posts-by-members/some-of-ui-annotations-local-annotatio...
I hope my examples are clear and can save some of your development time.
Thanks,
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 100 | |
| 46 | |
| 36 | |
| 25 | |
| 23 | |
| 23 | |
| 23 | |
| 22 | |
| 21 | |
| 21 |