on 11-14-2022 12:52 PM
Hi RAP Experts,
I try to start my first RAP Application. So far everything works fine. But I still have a general (maybe understanding) problem. I have the follwoing situation:
I have a small CDS view with corresponding service for create and update. The view has only three attributes. On of this attribute should be displayed as dropdown.
The underlyng structure for this dropdown is table, with a key and a text value. Now I struggling with this dropdown. I like to display the text value of this dropdown, but interal I like to use the key.
But I'm not able to solve my probelm. If I display the key, the application wokrs fine, but logical, it will show the key in the dropdown only. If I switch to the text, I got error on the create page,
that the text doesn't fit the data attribute key. Which is also logical. But, is there any possiblity to fix my problem?
What I did so far:
In my Interface view I added the following:
define root view entity Z******
as select from ztable
association [0..*] to ZSP_V_DROP_DOWN as _VHelp
on $projection.vhelp_key = _VHelp.dd_key
In ZSP_V_DROP_DOWN I hjave only two fields: dd_key and dd_text.
In my consumption view I added both fields. For the dd_key field I added:
@Consumption.valueHelpDefinition: [{ entity : { name: 'ZSP_V_DROP_DOWN', element: 'dd_key' } }]
@ObjectModel.text.element: ['dd_text']
In the meta definition I added nothing special for this field.
Many thanks in advcance
Stefan
Solved by my own.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Stefan,
does that work for you?
https://blogs.sap.com/2018/11/16/dropdown-list-in-fiori-elements/
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marian,
thx for your time. I have to answer with yes and no. It works fine for the list, but not in the creation. I guess I have to implement a determination on modify event or something else. But this seems to over complicated. I wondering that there is no other solution.
Cheers Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
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.