I have a CListview widget with a dataProvider object assigned to it that uses pagination but only the first page shows up. I have buttons that link to all the other pages, but when I click on "Next >" the subsequent pages are have 0 records and the pagination buttons disappear.
My code is a little too complicated to post here to look over so I am just asking if anyone knows of common causes for only one page to be displayed.
Ajax is working, a successful call is made to the server and a response received, the response just doesn’t have nay information in it.
No javascript errors are occurring.
The application log doesn’t have anything related to my requests.
I know this is a very vague post, so it is hard to get specific answers. As I said before, my code is too complicated to post everything related to this data provider, but here is the code to create the widget, am I missing something obvious?
I have also double checked and the dataProvider object has the correct number of records in it and the ‘count’ property is also being set correctly.
I double checked the query, and the SQL returns the correct number of records. In fact the pagination controls the correct number of pages for the number of results that should be shown, but when I click on the "next" button, the entire widget disappears.
After extensive effort and many days, I finally figured out what the problem was. The code to generate my dataprovider and the widget were flawless, but the problem was in the controller itself. I didn’t think things through clearly when I designed the controller’s actions.
The CListView to be displayed was the result of a search being run from another page. When a user arrived on the page to display the widget, he had to make a POST request. When the user clicked the “next” button to view pagination, the widget would make an AJAX GET request to the same URL. The controller’s action was programmed in such a way that it would not accept GET requests and would return no data which would make the widget disappear entirely in the user’s window. Once I realized what the problem was, fixing it was trivial.
Thanks for your help in trying to solve the problem. I know I asked a very generic question so it was hard to address, but I really appreciate the attempts.