Refresh data is not working in service action

Hi 

My requirement is given below.

My client wants we have to use service action for all means crud operation.we are accessing db through service action.problem we are using service action to fetch list data from db.that service we have use in our page and we able to show data in UI.but the problem when I am trying to filter data at that time we are unable to refresh data.because Ajax refresh is there but refresh data widget is not working.please help me

Hello,


You only need to refresh data when you have filters on the aggregate or advance query. the case you are saying where the data comes from an action you do not need to refresh data, you need to work with the list returned by the action like use list filters on that action or list sorting or remove values and add values and then use the ajax refresh to display that list in screen


BR

Carlos is correct.

Your service action should have input parameters for the filters to apply. When you need to get a new resultset, instead of using the refresh data widget, you need to request a new list of data from the service action.

Alternatively, you can get a full resultset from the service action, and then use the List_Filter system action to filter the results to your needs locally.

Please look at the following posts as they may have additional information for your scenario:

https://www.outsystems.com/forums/discussion/36359/how-to-apply-pagination-on-local-data/

https://www.outsystems.com/forums/discussion/13678/pagination-on-a-list-record-varialble/

Hi

yes i got the filtered data.but in page my grid is not refreshed.

Hello. 

If you could provide the OML it would be appreciated.

As Hanno said, you need to rerun the action in order to get the new data. If you have a local list as a source to the grid, you need to assign the results to that list, and then run the ajax refresh.

i referred service output list to grid.

Page name is=


CourseApplicationTrainees


Solution

Arkyadeep,

The source for the list is GetCourseList, while in the refresh, you're using another instance of the the same action, GetCourseList2. This last one is not connected to your grid. I'd recommend for you create a local List, and add it as a source, appending each set, when appliable, to that list.


Either way, you should give attention to Carlos and Hanno answers. Unless you add proper parameters to the action GetCourseList, you won't need to be constantly fetching data from DB, and using the available ListActions should be enough.


Solution