You need to do the following steps. Assume you defined the SmartField like this:
<smartField:SmartField value="{XXX}" textInEditModeSource="ValueList" innerControlsCreated="onControlCreated">
<smartField:configuration>
<smartField:Configuration preventInitialDataFetchInValueHelpDialog="false" displayBehaviour="idAndDescription"/>
</smartField:configuration>
</smartField:SmartField>
Of course you have defined the needed annotation that shows the value list itesm. Something like this:
<Annotations Target="Metadata.YourEntityName/XXX">
<Annotation Term="Common.Text" Path="Planttxt">
<Annotation Term="UI.TextArrangement" EnumMember="UI.TextArrangementType/TextLast"/>
</Annotation>
<Annotation Term="Common.ValueListWithFixedValues" Bool="false"/>
<Annotation Term="Common.ValueList">
<Record>
<PropertyValue Property="CollectionPath" String="XxxSet"/>
<PropertyValue Property="Parameters">
<Collection>
<Record Type="Common.ValueListParameterInOut">
<PropertyValue Property="LocalDataProperty" PropertyPath="XXX"/>
<PropertyValue Property="ValueListProperty" String="Id"/>
</Record>
<Record Type="Common.ValueListParameterDisplayOnly">
<PropertyValue Property="ValueListProperty" String="Name"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
We defined a innerControlsCreated="onControlCreated" handler, we need to provide the code for that in related controller:
/**
* event fired by innerControlsCreated of SmartField
* @param {sap.ui.base.Event} oEvent pattern match event
*/
onControlCreated: function (oEvent) {
if (oEvent.getParameters()[0] instanceof sap.m.Input && oEvent.getParameters()[0].getShowValueHelp()) {
// set ValueHelpOnly for Inputs with ValueHelp
oEvent.getParameters()[0].setValueHelpOnly(true);
}
},
disabledproperty in the input - inizio