SAP UI5 value help only for Smartfield

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



SAP UI5 value help only for Smartfield



I have a smartfield that has a value-list annotation.
I would like it to behave such that text input is disabled for the field so the user is forced to open the value help when he clicks on the field, and select from a valid list - much like the valueHelpOnly property of sap.m.Input. I was looking for a similar property for smartfield but there isn't seem to be one?


value-list


valueHelpOnly


sap.m.Input


smartfield



If there's no standard property for this, what's the best way to validate input vs valid value help values for smartfields?
Thanks in advance.


smartfields



enter image description here





You can add the disabled property in the input
– inizio
Aug 6 at 6:25


disabled




2 Answers
2



I have a work around, if any one has a better solution then kindly suggest me


class


SmartField


class


ID


disabled


SmartField input



var sSmrtFldId = "#" + jQuery(".CustomSmrtFldClass").attr("id") + ".sapMInputBaseInner";
jQuery(sSmrtFldId).attr("disabled ", true);


var sSmrtFldId = "#" + jQuery(".CustomSmrtFldClass").attr("id") + ".sapMInputBaseInner";
jQuery(sSmrtFldId).attr("disabled ", true);



You have to use the Event innerControlsCreated of SmartField, then check if is a Input and call the method setValueHelpOnly(true)


innerControlsCreated


setValueHelpOnly(true)


onInnerControlsCreated: function (oEvent)
oEvent.getParameters()[0].setValueHelpOnly(true);



Note: This code is a sample, you need to check if is a Input and avoid hard code the index access on the array of parameters.


Input






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS