Skip to Content
Nov 08, 2017 at 06:36 PM

[SAPUI5] Refresh table data using query Parameters and bind JSON data

672 Views Last edit Nov 08, 2017 at 07:25 PM 2 rev

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.