cancel
Showing results for 
Search instead for 
Did you mean: 

use smartmultiinput in fiori extension

0 Kudos

Hi, everyone,

I'm developing an app based on CAP architecture. I generate a list report fiori app with an entity named LoginUser under a service named MasterDataService. I need to add a smartmultiinput in a dialog via fiori extension.

it should look like this:

here's my code

<core:FragmentDefinition
    xmlns:core="sap.ui.core"
    xmlns="sap.m"
    xmlns:f="sap.ui.layout.form"
    xmlns:s="sap.ui.comp.smartmultiinput">
	<Dialog id="dialog" afterClose="destroy" contentWidth="400px">
		<f:SimpleForm>
			<f:content>
				<Label required="true" text="{@i18n>CompanyName}"/>
				<s:SmartMultiInput />
				<Label required="true" text="{@i18n>FirstName}"/>
				<Input />
			</f:content>
		</f:SimpleForm>
		<buttons>
			<Button id="okButton" text="{@i18n>OK}" press="modify"></Button>
			<Button text="{@i18n>Cancel}" press="cancel"></Button>
		</buttons>
	</Dialog>
</core:FragmentDefinition>

doesn't bind to any entity so far

but it looks like this:

the smartmultiinput didn't show, how so?

also, i'd like to know how to bind an entity named Company under the same service.

Thanks a lot ! This is my first time with the CAP architecture, a lot of things may not be clear to me.

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

without binding, smart control is "stupid" control.

0 Kudos

You mean i must set the entitySet?

But i tried this

<s:SmartMultiInput entitySet="Company"/>

it still doesn't work

0 Kudos

also i tried

<s:SmartMultiInput entitySet="Company" value="{name}"/>

junwu
Active Contributor
0 Kudos

do you have the odatamodel created?

0 Kudos

I thought this is a fiori(list report) app, once i got it bind with an entity, there is no need to create a new odataModel. There is nothing wrong with the entity of course, the smartTable in the list report can display the data from the entity successfully.

junwu
Active Contributor
0 Kudos

how you add that fragement to your app?

0 Kudos

i add an action button in my list report app, when clicked, the fragment will be opened.

junwu
Active Contributor
0 Kudos

so the fragment is not part the view, it cannot access the model.

you have to add the fragment to the view using adddependent

0 Kudos

i checked my code just now

var oDialog = sap.ui.xmlfragment(this.getView().getId(), "user.ext.fragment.Dialog", this); 
this.getView().addDependent(oDialog);

I already used addDependent