cancel
Showing results for 
Search instead for 
Did you mean: 

How to capture value from input field

reshmanagavalli
Explorer
0 Kudos

Hi Experts,

I have created a report in Fiori which displays all records,but i want to display particular record when i clicked on button after providing input values .

Can anyone suggest me how to capture values from input  field and send it back to odata.

Thanks,

Reshma

Accepted Solutions (1)

Accepted Solutions (1)

karthikarjun
Active Contributor
0 Kudos

Hi Reshma,

This.getView().byId(your input id).getValue()

This will help you to take value from input field

Thanks,

Karthik A

reshmanagavalli
Explorer
0 Kudos

Hi Karthik,

  Thanks for response, i have a requirement in SAP UI5 , based on four input fields it should fetch multiple records from backend. Can you please tell me how  to do this in odata  in which method i have to implement code.

Thanks,

Reshma.

karthikarjun
Active Contributor
0 Kudos

Hi Reshmi,

You should use odata model to get records from services.

For example.

Input1 - employees collection

Input 2 - purchase collection

Step 1: call metadata by using sap.ui.model.odata.odatamodel

Step2: create one json model

Var data= {

'input1' : metadata model collection name dot entity type,

'input2' : metadata model collection name dot entity type,

}

Sap.ui.getCore ( ) . setModel (new sap.ui.model.json.jsonModel (data))

Now go to view

New sap.m.Input({value: '{input1}'})

Thanks,

Karthik A

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Once you have input all the data in the UI fields, you can submit it for persistence using odata create function. Please refer the create function in the below api help

SAPUI5 SDK - Demo Kit

Then, you can refresh your Table to display the latest data using the refresh operation. Please refer the same help api above for this.

Hope this answers your question.

Regards , Krishna