cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

UI Annotation for masking field value

satadas30
Explorer
0 Kudos
890

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

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.
satadas30
Explorer
0 Kudos

         

sandeep_rs
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Did you already take a look at the section "Representation as a Masked Input Field" in page? Maybe this helps with your requirement.

Thanks and Best Regards,

   Sandeep

satadas30
Explorer
0 Kudos
The requirement is to have field values hidden with some other values. E.g. Password masked as ********
pragupta14
Explorer
0 Kudos
Have you found any solution for this ? I am also facing this issue where UI.MASKED annotation is not working with Odata V4 Model.