1
0
-1

Hi

I am using pagination with Dynamic Data lookup.

My rest service returns a json array result like [{"a":"a","b":"b" },{"a":"a","b":"b" },{"a":"a","b":"b" },{"a":"a","b":"b" }]

When I am getting the result I return the json object from Dynamic Data service and its works fine at UI.

1)But when there is no matching record for the input criteria for rest, I get an empty array like []. When same is rendered in UI, the pagination getting activated with page 1/0 and Next, Last button also active. If I continue to click on next..its an infinite loop .... like 2/0, 3/0...never ending. If result is empty it should show 0/0 with all pagination button disabled.

To Avoid That I passed a single empty array [{}], which is displaying 1/1 record with empty values for columns except a dropdown list field and navigation buttons are disabled.

How can I achive no result on screen (0/0 with navigation button inactive) to get for empty json result?

2)Also I observed, once I get a result from REST for search option, on next search even if there is no result from REST(empty json array), pagination taking the result from buffer. Don't know how it happens, but when I debug in groovy, I see empty result, however on screen I see few records.

Please suggest how to resolve above 2 issues

 

    CommentAdd your comment...