cancel
Showing results for 
Search instead for 
Did you mean: 

Use a smart Field as MultiInput in UI5

former_member242922
Participant
0 Kudos

Hello experts,

Is it possible to use a smartField as MultiInput?

I have added annotations to add valueHelp to it. But it allows me to select only one input at a time.

When I inspected, I see it gets rendered as "sap.m.Input"

Is there a way to convert this to "sap.m.MultiInput"

My view.xml looks like

<mvc:View controllerName="Sf.smartField.controller.View1" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc"
xmlns:form="sap.ui.layout.form" xmlns:smartField="sap.ui.comp.smartfield">
<form:SimpleForm minWidth="1024" maxContainerCols="2" editable="true" layout="ResponsiveGridLayout" labelSpanL="3" labelSpanM="3"
emptySpanL="4" emptySpanM="4" columnsL="1" columnsM="1">
<form:content>
<smartField:SmartLabel labelFor="id"/>
<smartField:SmartField value="{id}" id="id"/>
<smartField:SmartLabel labelFor="desc"/>
<smartField:SmartField value="{desc}" id="desc">
<smartField:configuration>
<smartField:Configuration controlType="auto"/>
</smartField:configuration>
</smartField:SmartField>
</form:content>
</form:SimpleForm>
</mvc:View>

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hello @shinyj,

You can use SmartMultiInput instead of SmartField.

The following URL tells you how to use it.

https://sapui5.hana.ondemand.com/#/topic/5644169deb76438f800f269b0cb715fc

NOTE: This control is available since 1.56.0.

0 Kudos

Hi, i want to use SmartMultiInput in my fiori extension.

here's my code

 <core:FragmentDefinition
    xmlns:core="sap.ui.core"
    xmlns="sap.m"
    xmlns:s="sap.ui.comp.smartmultiinput">
	<Dialog id="dialog" class="dialog" afterClose="destroy" contentWidth="400px">
		<content>
                        <Label required="true" text="{@i18n>CompanyName}"/>
                        <s:SmartMultiInput entitySet="Company" value="{name}" />
		</content>
		<buttons>
			<Button id="okButton" text="{@i18n>OK}" press="modify"></Button>
			<Button text="{@i18n>Cancel}" press="cancel"></Button>
		</buttons>
	</Dialog>
</core:FragmentDefinition>

i hope to see an Input and an icon which can open a value help dialog after clicked are rendered, but nothing rendered.

I feel stuck for two days, please help me, thank you so much!

0 Kudos

Hi @amylee,

Sorry for not responding sooner.

Your problem is due to your SmartMultiInput Control not having the connection with a value help.

There may be three way to solve this.

  1. Fabricating a Dialog like a value list dialog
  2. Creating an OData annotation with any OData generator (ex: tr-cd segw)
  3. Creating a local annotation with WebIDE

If you create an OData service without importing existing search helps, you have to implement filter functions correctly to filter contents from your SmartMultiInput.

This URL explains defining ValueList annotation.

You can use this for my way 2 and way 3.

Best Regards,