on 11-08-2017 6:36 PM
Hi Experts,
I am using REST APIs to fetch data from backend, I want to fetch data based on query parameters.
My REST service does not return any data if there is no query parameter.
e.g My service URL is https://Host/rest/countries?region=asia
It will give list of countries if I give region=asia but if I don't add region then I will not get any country. I have defined service URL in menifest.json as below
"dataSources": { "mainService":{ "uri": "https://Host/rest/countries?region=", "type": "JSON" } },
Now I want to pass region value as parameter from input field and populate table.
If I give complete URL in manifest.json then my table is loaded on initial load
"dataSources": { "mainService":{ "uri": "https://Host/rest/countries?region=asia", "type": "JSON" } },
For me it's fine if initial load is blank but I want to load table after I pass parameter from input field.
How can be this achieved, any pointer will be helpful.
Regards,
Rohit
you will need to create a json model in your app and load the data async.
here is an example of how the json model makes an ajax call
https://sapui5.hana.ondemand.com/#/api/sap.ui.model.json.JSONModel -- look into loadData function
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.