cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Using MultiInput

mdixit_1401
Explorer
0 Likes
2,601

Hi Experts,

I want to use multiinput with the functionality that if i press enter a new token gets added . Also I need to bind it to odata so that if anything is already saved then that should flow while rendering and If user enter something new , that should also gets saved.

Examples which I have seen are not adding new token after pressing enter with data binding.

Can you please help me out?

Thanks,

Mansi

Accepted Solutions (0)

Answers (3)

Answers (3)

vijay_kumar49
Active Contributor
0 Likes

Please refer the example document. it may be useful document


<!DOCTYPE html>

<html>

<head>

<script src="src='/sapui5-internal/resources/sap-ui-core.js" id="sap-ui-bootstrap" data-sap-ui-theme="sap_bluecrystal" data-sap-ui-libs="sap.m"></script>

  <meta charset="utf-8">

  <title>MultiInput</title>

  <script>

    var oInput = new sap.m.MultiInput({

  tokens : [

  new sap.m.Token({

  key : "1",

  text : "Token1"

  }),

  new sap.m.Token({

  key : "2",

  text : "Token2"

  }),

  new sap.m.Token({

  key : "3",

  text : "Token3"

  })

     ]

    });

    oInput.placeAt('content');

    </script>

</head>

<body class='sapUiBody'>

<div id='content'></div>

</body>

Kindly let me know if you need any more information

karthikarjun
Active Contributor
0 Likes

Sai's example is more than enough .

Meanwhile you can refer this link too... http://jsbin.com/nehaqu/edit?html,js,output

Regards,

Karthik A

saivellanki
Active Contributor
0 Likes

Hi Mansi,

Will this sample help? Plunker

1. Try to give some product name in the input and click on enter, then a token will be added to MultiInput.

2. Click on 'Check Model' button to read the model data.

3. Instead of OData model, I used a JSON model.

Regards,

Sai Vellanki.