In this article we shall continue where we left off by adding paging functionality to our Adobe Flex REST grid client.
Put in Paging Drop Down
We have revised our code to deal with dynamic paging. The below code does the following:
In the display portion, we have drawn a combo box to hold paging and initialize it to invisible.
We have changed our webservice offset to be bound to a function of combo box index. Note the index denotes the page we want to pull.
We need to do a bit more when the search button is clicked, so we have created a function called search_click()
which will reset our offset and paging back to one. We do this because clicking Search triggers a new search
In the combo box page drop down we have it to trigger the webservice call.
During the webservice call, if the page combo is at 1 (meaning a new search), we redraw the combo as function of number of results.
Our revised application view and code is shown below.