I am playing around with a little application to manage buildings and rooms.
In the actionAdmin() of my RoomController I want to show a list of (all) rooms. Each room belongs to a building, having a particular level. In the view I show a list of the room names with the corresponding building name and level.
Example:
Room 1 Building 1 1st Floor
Room 2 Building 1 1st Floor
Room 3 Building 1 2nd Floor
Room 4 Building 2 1st Floor
As shown in the Cookbook Article, I introduced a DropDownList in order to be able to filter the rooms list by their building:
My first problem is, that the form submits to e.g. index.php?building=1 instead of index.php?r=room/admin&building=1. What may I have done wrong?
My second problem is, that when I filtered a list (working already if adding the parameter to the URL), this filter is not used again when pressing one of the pagination buttons or changing the sort of the table by pressing a column header. So with selecting another page or changing sort, the filter (although still displayed in the DropDownList) will not be applied any more. How can I make the filter work even with paginator's page changes or sort changes?
Does anybody have a code snippet showing the cooperation of filter, sort and pagination?
So the links look quite good, the parameters for sort and pagination seem to be OK, the only thing still not working is submitting the form. Although the URL seems correct, it goes to the default start page.