cancel
Showing results for 
Search instead for 
Did you mean: 

Using UI5 Smart Controls (ValueHelp) with SAP CAP

nicoschoenteich
Developer Advocate
Developer Advocate
0 Kudos

Hi all,

I am working on a CAP service and want consume it using UI5 Smart Controls. Smart Controls are only compatible with OData V2, so I am using the cds-odata-v2-adapter-proxy.

It is a simple data model:


In order to use Smart Controls, the OData metadata document needs to contain a few key elements such as the "sap:" annotations (see UI5 documentation) - I found the respective part in the CAP documentation and updated my CAP service accordingly:

The metadata document now looks like this:

As far as I can see, that pretty much matches the example in the UI5 documentation (except "DESCR" is "name" in my example). Also, the CAP documentation (specific part for pre-defined types like "Currencies") states that "all SAP Fiori UIs [...] will automatically receive Value Help for currencies". However, my UI5 smart control does not display any ValueHelp (the SmartLabel works!):

Does anyone have any ideas why the ValueHelp won't show up?

Accepted Solutions (0)

Answers (2)

Answers (2)

Marian_Zeis
Active Contributor

i don´t really know your usecase, but you can look at the examples:

https://sapui5.hana.ondemand.com/sdk/#/entity/sap.ui.comp.smartfield.SmartField/sample/sap.ui.comp.s...

Maybe it´s not in edit mode?

I guess you want to use SmartFields. Just in case you just want to use the "Smart" Features, you can use macros Fields with V4:
https://ui5.sap.com/test-resources/sap/fe/core/fpmExplorer/index.html#/buildingBlocks/field/fieldEdi...

nicoschoenteich
Developer Advocate
Developer Advocate
0 Kudos

Thanks Marian, yes, it is set to editable="true". And yes, I do specifically want to use the SmartField 🙂

yogananda
Product and Topic Expert
Product and Topic Expert
0 Kudos

nicolai.geburek

I recommend to go with this below approach for editing the field.

https://sapui5.hana.ondemand.com/sdk/test-resources/sap/fe/core/fpmExplorer/index.html#/buildingBloc...

Amount with Dynamic field control on the currency

nicoschoenteich
Developer Advocate
Developer Advocate
0 Kudos

Hi Yogananda, thanks for your suggestion - I will try it out. However, I am still really trying to get this to work with Smart Controls. Best, Nico