Hello,
I noticed that when using ajax filters (in my case grouped), that they don't initialise properly after they have been used. For example I had a drop down with people names and when I filtered on one of them, the filter does work but the drop down is not initialised to the value selected.
After looking at the generated source code I think I found the issue. In my example 'person' is the list view and 'personitem' is the item view. When it tries to get the state variable, there are actually two issues. One of them is that the wrong model is accessed (it gets the item model and the state variable should be stored in the list model). The other thing is that the filter does not exists yet in the filters array and should be created.
In my example this code for the view.html.php for my list view was originally:
$model_person_id = JModel::getInstance('personitem', 'SlmModel');
$this->filters['person_id']->values = array(
$model->getState("filter.person_id"),
);
I changed this to:
$model_person_id = $this->getModel(); // get it's own model (the list view for persons)
$this->filters['person_id'] = new stdClass(); // create a new entry in the filter array
$this->filters['person_id']->values = array(
$model->getState("filter.person_id"),
);
And now it all works. So I will just need to do this for all other views as well where an ajax filter is used.
I don't know if this is an issue I only experienced or whether others had this as well. If so, you can use the solution above. If it happens always it will probably need to be fixed in the generation code of Cook.
Hope it will help others.
Kind regards,
Misha