Skip to Content
Former Member
Apr 30, 2014 at 12:32 PM

how to make searchfield as mandatory in formelement


We need to make the searchfield label as mandatory in a formelement.

GIven below is the code we have used. but not working.

new sap.ui.layout.form.FormElement({fields: [oSearch = new sap.ui.commons.SearchField("sf_srvcRecipient",{
value: "",
enableListSuggest: false,
layoutData: new sap.ui.layout.form.GridElementData({hCells: "5"})}
label: new sap.ui.commons.Label("lb_srvcRecipient",{
required: true, text: "Service Recipient", labelFor: oSearch