on 08-12-2020 8:55 PM
Hello All,
I have a Value Help Dialog XML Fragment that has a <StandardListItem> control. The title and description properties are bound to an oData EntitySet which has 3 properties but only two are bound, the key and text. The issue I am facing is that the data doesn't show correctly, it repeats one record for the amount of times the EntitySet has data related to the key in question. For example, EntitySet('KEY') may have 14 records associated to it, but instead of showing 14 unique values in the UI control it repeats one value 14 times. Then EntitySet('KEY2') might have 29 associated values but it will repeat one row 29 times...etc.
The code for the fragment is:
<core:FragmentDefinition xmlns="sap.m">
<SelectDialog
id="id"
title="title"
class="sapUiPopupWithPadding"
items="{/EntitySet}"
search="_onValueHelpSearch"
confirm="_onValueHelpConfirmPress"
cancel="_onValueHelpConfirmPress">
<StandardListItem
title="{key}"
description="{text}"/>
</SelectDialog>
</core:FragmentDefinition>
Then in the app.view.xml I have the Input field which has the value help to this fragment like so:
<Input
id="id"
showValueHelp="true"
valueHelpOnly="true"
valueHelpRequest=".onValueHelp"
suggestionItems="{
path: '/EntitySet',
sorter: { path: 'key' }
}"
>
<core:Item key="{key}" text="{text}"/>
</Input>
Then finally in the controller, I create the ValueHelpDialog in the onValueHelp function like so:
onValueHelp: function (oEvent) {
this._oValueHelpDialog = sap.ui.xmlfragment("com.myco.vhd", this);
this.getView().addDependent(this._oValueHelpDialog);
this._oValueHelpDialog.open();
}
Any help, tips, suggestions and ideas are all welcome! Thanks experts.
PS.
Hi Paskal,
Such issues usually occur, if the keys for the entitys are not unique. As oData is subset of rest service, it is mandatory that each key for the item in your entity should have unique URI.
Thanks
Prashil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.