cancel
Showing results for 
Search instead for 
Did you mean: 

UI Annotation for masking field value

satadas30
Explorer
0 Kudos
417

Hello,

We have created a Fiori Elements App and used the List Report Floor Plan for generating the front end application. We would need to mask a couple of fields like Security Token, User Password, etc. As per SAP Help in the following link, we should be able to achieve this by using the annotation @ui.masked: true. However, it does not seem to have any effect when we add this annotation to the Metadata Extension. 

https://help.sap.com/doc/saphelp_nw75/7.5.5/en-US/95/86f9043c194cfcb6b72c671e50d690/frameset.htm

Any help would be appreciated.

Thank you.

junwu
Active Contributor
0 Kudos
what is your ui5 version?
satadas30
Explorer
0 Kudos

The minimum UI5 version we chose when creating the app was 1.124.6.

junwu
Active Contributor
0 Kudos
the data is displayed as form or in table?
satadas30
Explorer
0 Kudos
It is the list report floorplan. It shows all the entries like a list on the initial page but when yo select a specific entry it opens up in a form.
View Entire Topic
Bibhu
Participant
0 Kudos

The way you can identify this is by checking your $metadata 

As given below 

 

<Property Name="Password" />
  <Annotations Target="Password" xmlns="http://docs.oasis-open.org/odata/ns/edm">
    <Annotation Term="com.sap.vocabularies.Common.v1.Masked" />
  </Annotations>

 

Determines that a control must not display the actual value in a field with sensitive data, but replace it with a placeholder, for example, *. Use this annotation for sensitive data.

And it's available since: 1.28.1 make sure your UI5 version is higher than this.

class sap.ui.comp.smartfield.SmartField

 
satadas30
Explorer
0 Kudos
We are on OData v4. The Smart Field is only for OData v2 as per the link you had shared.