Example of adding an additional value help using sorting via local annotations for a RAP based application
Existing ValueHelp and PresentationVariant in Backend
The consumption view c_travel_a_001 contains a field TravelID that is annotated with a value help:
@Consumption.valueHelpDefinition: [{
entity : {name: ‘I_VH_TRAVEL_A_001’, element: ‘TravelID’},
qualifier: ‘BackendTravelID’,
presentationVariantQualifier: ‘SortByEndDate’
}]
TravelID,
Note: The presentationVariantQualifier points to the name of the presentation variant that contains the sorting definitions.
The view for the value help (i_vh_travel_a_001) containing the presentation variant:
…
@UI: { presentationVariant: [
{
qualifier : ‘SortByEndDate’,
sortOrder: [{
by: ‘EndDate’, direction: #DESC
}]
}
]
}
define view I_VH_TRAVEL_A_001
…
The metadata looks like the following.
The reference to the value help in the root metadata:
The value help itself containing the PresentationVariantQualifier:
The presentation variant:
With that I get a value help that is sorted by End Date (see the sorting icon in the column header):
Now I add a value help having only four columns via local annotations:
Important: See the properties CollectionRoot (the reference to the value help like shown in the root metadata above) and the PresentationVariantQualifier pointing to the presentation variant.
With that I get a second value help shown in the dialog. The two value helps (defined via backend and localAnnotations) can be selected using the drop-down left of the search field:
The value help defined by local annotations (Frontend VH for TravelID) shows only four columns – again sorted by End Date: