cancel
Showing results for 
Search instead for 
Did you mean: 

Disable field history on an input field

javier_arboleya
Explorer
0 Kudos

Hi ,

I am wondering whether it is possible to disable, on an input field (sap.m.Input), the list of values previously entered.

Currently when the user clicks on the input field, the list of previously entered values appear and we would like to disable it.

Is that possible?

Best regards

Javier

Accepted Solutions (0)

Answers (6)

Answers (6)

EdwarSoto
Participant
0 Kudos

Hello,

This works for me,

thank for idea gaurav.shami ...

read this: https://bugs.chromium.org/p/chromium/issues/detail?id=370363#c7

onAfterRendering: function () {
$(".sapMInputBaseInner").attr("autocomplete", 'new-password');

/* Idea from Gaurav Shami
setInterval(function () {
var sRandomStr = (Math.random() + 1).toString(36).substring(7);
$(".sapMInputBaseInner").attr("autocomplete", sRandomStr);
}, 1000); */
}
0 Kudos

This works for me, to avoid previously entered value list, also setting attribute autocomplete off does not work.

setInterval(function() { let sRandomStr = (Math.random() + 1).toString(36).substring(7); $(".sapMInputBaseInner").attr("autocomplete", sRandomStr); }, 1000);

0 Kudos

Hi, all. I was facing a similar problem, and came up with a sneaky solution:

You can briefly set the Type of Input to 'Password' and reset ist right after - the first operation disable the autocomplete and the second restoring the visibility of Input values:

onLiveChange:function(oEvent){
	oEvent.getSource().setType("Password");
	oEvent.getSource().setType("Text");
},

I hope that helps. Best wishes, Konstantin

former_member340030
Contributor
0 Kudos

Hi ,

I think you can't do it by fiori or ui5 input control properties or attributes ..

Try using javascript in the controller to do this for you .. you can put this code in you onInit event handler .. Just get the HTML input control using the Id and add the property autocomplete="off" or autocomplete = false .. (DOM manipulation .. use createAttribute to add the autocomplete attribute with value off or false https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_document_createattribute)

Thanks

Viplove

javier_arboleya
Explorer
0 Kudos

Hello Jakob,

thank you for your answer, but according to the documentation for the showSuggestion

If this is set to true, suggest event is fired when user types in the input. Changing the suggestItems aggregation in suggest event listener will show suggestions within a popup. When runs on phone, input will first open a dialog where the input and suggestions are shown. When runs on a tablet, the suggestions are shown in a popup next to the input.

As far as I know this is used when we link the field to a table on the backend an suggestions are shown to the user based on that table.

What I mean is the values the user entered in previous executions, this history you can actually see in any field in a regular form in internet websites. So I am thinking that maybe this is linked to the browser (chrome, IE, or the fiori client itself) and it cannot be controlled from the Input component.

Maybe there is an option in fiori client to deactivate this.

Best regards,

Javier

UxKjaer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Use the showSuggestion property and set it to false